SquishTests: Update tst_WELP04

Change-Id: I0fd52a1ab0538765736927bcca32e5b1e26f6c1d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2023-06-09 22:28:33 +02:00
parent 904fa0aca3
commit 9f89b87517

View File

@@ -3,6 +3,13 @@
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
def __waitForListView__():
listView = waitForObject("{container=':Qt Creator.WelcomeScreenStackedWidget' "
"type='QListView' unnamed='1' visible='1'}")
return listView
def main(): def main():
# open Qt Creator # open Qt Creator
startQC() startQC()
@@ -22,14 +29,14 @@ def main():
searchTutorials = waitForObject("{type='QLineEdit' placeholderText='Search in Tutorials...'}") searchTutorials = waitForObject("{type='QLineEdit' placeholderText='Search in Tutorials...'}")
mouseClick(searchTutorials) mouseClick(searchTutorials)
replaceEditorContent(searchTutorials, "qwerty") replaceEditorContent(searchTutorials, "qwerty")
listView = waitForObject("{type='QListView' unnamed='1' visible='1' " listView = __waitForListView__()
"window=':Qt Creator_Core::Internal::MainWindow'}")
waitFor('findExampleOrTutorial(listView, ".*") is None', 3000) waitFor('findExampleOrTutorial(listView, ".*") is None', 3000)
tutorial = findExampleOrTutorial(listView, ".*", True) tutorial = findExampleOrTutorial(listView, ".*", True)
test.verify(tutorial is None, test.verify(tutorial is None,
"Verifying: 'Tutorials' topic is opened and nothing is shown.") "Verifying: 'Tutorials' topic is opened and nothing is shown.")
bnr = "Help: Building and Running an Example" bnr = "Help: Building and Running an Example"
replaceEditorContent(searchTutorials, bnr.lower()) replaceEditorContent(searchTutorials, bnr.lower())
listView = __waitForListView__()
waitFor('findExampleOrTutorial(listView, "%s.*") is not None' % bnr, 3000) waitFor('findExampleOrTutorial(listView, "%s.*") is not None' % bnr, 3000)
tutorial = findExampleOrTutorial(listView, "%s.*" % bnr, True) tutorial = findExampleOrTutorial(listView, "%s.*" % bnr, True)
test.verify(tutorial is not None, "Verifying: Expected Text tutorial is shown.") test.verify(tutorial is not None, "Verifying: Expected Text tutorial is shown.")
@@ -46,6 +53,7 @@ def main():
mouseClick(searchTutorials) mouseClick(searchTutorials)
replaceEditorContent(searchTutorials, "embedded device") replaceEditorContent(searchTutorials, "embedded device")
embeddedTutorial = "Online: How to install and set up Qt for Device Creation.*" embeddedTutorial = "Online: How to install and set up Qt for Device Creation.*"
listView = __waitForListView__()
waitFor('findExampleOrTutorial(listView, embeddedTutorial) is not None', 3000) waitFor('findExampleOrTutorial(listView, embeddedTutorial) is not None', 3000)
tutorial = findExampleOrTutorial(listView, embeddedTutorial, True) tutorial = findExampleOrTutorial(listView, embeddedTutorial, True)
test.verify(tutorial is not None, test.verify(tutorial is not None,