Skip to content

Commit

Permalink
SquishTests: Don't proceed in hopeless situation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rlohning committed May 16, 2024
1 parent 15446c9 commit 394e9a9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/system/suite_tools/tst_designer_autocomplete/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
nativeType("<Return>")
test.verify(waitFor('str(lineUnderCursor(editor)).strip() == "ui->%s" % buttonName', 1000),
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName))
if test.verify(waitFor(proposalExists, 4000),
"Verify that GenericProposalWidget is being shown."):
nativeType("<Return>")
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()

0 comments on commit 394e9a9

Please sign in to comment.