forked from qt-creator/qt-creator
SquishTests: Don't proceed in hopeless situation
When the GenericProposalWidget is not being shown, there's no point in trying to use it. Change-Id: Ibe6f3ed9230fdc41271f5ff8538bd863da3d0ab3 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -48,12 +48,15 @@ def main():
|
||||
snooze(1)
|
||||
type(editor, ">")
|
||||
snooze(1)
|
||||
proposalExists = lambda: object.exists(':popupFrame_TextEditor::GenericProposalWidget')
|
||||
nativeType("%s" % buttonName[0])
|
||||
test.verify(waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 1500),
|
||||
"Verify that GenericProposalWidget is being shown.")
|
||||
if test.verify(waitFor(proposalExists, 4000),
|
||||
"Verify that GenericProposalWidget is being shown."):
|
||||
nativeType("<Return>")
|
||||
test.verify(waitFor('str(lineUnderCursor(editor)).strip() == "ui->%s" % buttonName', 1000),
|
||||
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName))
|
||||
lineCorrect = lambda: str(lineUnderCursor(editor)).strip() == "ui->%s" % buttonName
|
||||
test.verify(waitFor(lineCorrect, 1000),
|
||||
('Comparing line "%s" to expected "%s"'
|
||||
% (lineUnderCursor(editor), "ui->%s" % buttonName)))
|
||||
type(editor, "<Shift+Delete>") # Delete line
|
||||
selectFromLocator("mainwindow.ui")
|
||||
saveAndExit()
|
||||
|
Reference in New Issue
Block a user