diff options
author | Robert Löhning <robert.loehning@qt.io> | 2023-01-30 14:58:05 +0100 |
---|---|---|
committer | Robert Löhning <robert.loehning@qt.io> | 2023-02-01 12:41:47 +0000 |
commit | 54326a127eece7cb5c5387b0a0ac73cb734e808b (patch) | |
tree | 53da41775b948cf99f8398c1e1f96afc23ab57ea | |
parent | c22b4b35e1e8205a3106dd1c9c04af6a3ea8ab7c (diff) | |
download | qt-creator-54326a127eece7cb5c5387b0a0ac73cb734e808b.tar.gz |
SquishTests: Use openDocument()'s return for verifying project tree
It's used anyway, relies on the expected project
tree and works around a problem on some machines.
Change-Id: Ic1e3e7a3f492f37d70c4409699ca78ad548d7445
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | tests/system/suite_QMLS/tst_QMLS04/test.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 2c42c178cc..f3758ca8b0 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -40,17 +40,16 @@ def main(): myCompTE = "SampleApp.SampleApp.qml\\.qrc./.MyComponent\\.qml" # there should be new QML file generated with name "MyComponent.qml" try: - waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 5000) + # openDocument() doesn't wait for expected elements, so it might be faster than the updates + # to the tree. Explicitly wait here to avoid timing issues. Using wFOI() instead of + # snooze() allows to proceed earlier, just in case it can find the item. + waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", + addBranchWildcardToRoot(myCompTE), 2000) except: - try: - waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000) - except: - test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer") - saveAndExit() - return - test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") + pass # open MyComponent.qml file for verification - if not openDocument(myCompTE): + if not test.verify(openDocument(myCompTE), + "Was MyComponent.qml properly generated in project explorer?"): test.fatal("Could not open MyComponent.qml.") saveAndExit() return |