SquishTests: Make tst_designer_autocomplete pass on clangd

- Give GenericProposalWidget more time to appear because the precise
  clangd-based code model is not as quick as the built-in one.

- Don't search for button's name in list of proposals because clangd
  seems to generate too many proposals for this to work reliably. It's
  pointless anyway because it doesn't matter whether the button is being
  displayed somewhere deep down in the list. The following tests
  validate whether the button is available.

Change-Id: I8f59154c0ce5251d942665084e0e4a54626853bc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2024-07-24 22:53:24 +02:00
parent 25736b1ca8
commit 455497725b

View File

@@ -64,16 +64,12 @@ def main():
snooze(1) snooze(1)
type(editor, ">") type(editor, ">")
if not test.verify(waitFor(proposalExists, 1500), "Proposal should be shown"): if not test.verify(waitFor(proposalExists, 6000), "Proposal should be shown"):
type(editor, "<Shift+Delete>") type(editor, "<Shift+Delete>")
continue continue
proposalListView = waitForObject(':popupFrame_Proposal_QListView') proposalListView = waitForObject(':popupFrame_Proposal_QListView')
items = dumpItems(proposalListView.model()) type(proposalListView, str(buttonName[0]))
if test.verify(" %s" % buttonName in items, "Button present in proposal?"):
type(proposalListView, str(buttonName[0]))
else:
test.log(str(items))
snooze(1) snooze(1)
if test.verify(waitFor(proposalExists, 4000), if test.verify(waitFor(proposalExists, 4000),
"Verify that GenericProposalWidget is being shown."): "Verify that GenericProposalWidget is being shown."):