diff options
author | Christian Stenger <christian.stenger@qt.io> | 2022-02-14 17:03:11 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2022-02-24 14:04:51 +0000 |
commit | 3ae6f41c3f9a6b5cafe05e854b12b932fe8ade6c (patch) | |
tree | f36b24b22e44dd4c0747e53b24a4d2ae228603a5 | |
parent | c077f42e23cb5fb0c514d092784e82798684c176 (diff) | |
download | qt-creator-3ae6f41c3f9a6b5cafe05e854b12b932fe8ade6c.tar.gz |
Squish: Adapt to changed UI
Change-Id: Ie25ba8a72b7fd93f60f04303ed223e7cdf2406af
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
-rw-r--r-- | tests/system/objects.map | 2 | ||||
-rw-r--r-- | tests/system/shared/project.py | 10 | ||||
-rw-r--r-- | tests/system/shared/welcome.py | 5 | ||||
-rw-r--r-- | tests/system/suite_WELP/tst_WELP02/test.py | 6 | ||||
-rw-r--r-- | tests/system/suite_WELP/tst_WELP03/test.py | 16 | ||||
-rw-r--r-- | tests/system/suite_WELP/tst_WELP04/test.py | 17 |
6 files changed, 30 insertions, 26 deletions
diff --git a/tests/system/objects.map b/tests/system/objects.map index 60d760a681..a222860aad 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -84,7 +84,7 @@ :Go to slot.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Go to slot_QDialog'} :Go to slot.Select signal_QGroupBox {name='groupBox' title='Select signal' type='QGroupBox' visible='1' window=':Go to slot_QDialog'} :Go to slot_QDialog {name='SelectSignalDialog' type='QDialog' visible='1' windowTitle='Go to slot'} -:Help Widget_Help::Internal::HelpWidget {type='Help::Internal::HelpWidget' unnamed='1' visible='1' windowTitle?='Help -*'} +:Help Widget_Help::Internal::HelpWidget {type='Help::Internal::HelpWidget' unnamed='1' visible='1' windowTitle?='Help*'} :Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Hits_QResultWidget {aboveWidget=':Hits_QLabel' type='QResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :JsonWizard_ProjectExplorer::JsonFieldPage {type='ProjectExplorer::JsonFieldPage' unnamed='1' visible='1' window=':New_ProjectExplorer::JsonWizard'} diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 85d8c1d5e6..e5f4c4bc6b 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -31,9 +31,9 @@ def openQbsProject(projectPath): def openQmakeProject(projectPath, targets=Targets.desktopTargetClasses(), fromWelcome=False): cleanUpUserFiles(projectPath) if fromWelcome: - wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton('Open') + wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Open Project...') if not all((wsButtonFrame, wsButtonLabel)): - test.fatal("Could not find 'Open' button on Welcome Page.") + test.fatal("Could not find 'Open Project...' button on Welcome Page.") return [] mouseClick(wsButtonLabel) else: @@ -83,10 +83,10 @@ def openCmakeProject(projectPath, buildDir): def __createProjectOrFileSelectType__(category, template, fromWelcome = False, isProject=True): if fromWelcome: if not isProject: - test.fatal("'New' on Welcome screen only handles projects nowadays.") - wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton("New") + test.fatal("'Create Project...' on Welcome screen only handles projects nowadays.") + wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton("Create Project...") if not all((wsButtonFrame, wsButtonLabel)): - test.fatal("Could not find 'New' button on Welcome Page") + test.fatal("Could not find 'Create Project...' button on Welcome Page") return [] mouseClick(wsButtonLabel) elif isProject: diff --git a/tests/system/shared/welcome.py b/tests/system/shared/welcome.py index 86f773e275..cb11074b87 100644 --- a/tests/system/shared/welcome.py +++ b/tests/system/shared/welcome.py @@ -41,8 +41,9 @@ def __getWelcomeScreenButtonHelper__(buttonLabel, widgetWithQFrames, isUrlButton return None, None def getWelcomeScreenSideBarButton(buttonLabel, isUrlButton = False): - sideBar = waitForObject("{type='Welcome::Internal::SideBar' unnamed='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}") + sideBar = waitForObject("{container={type='Welcome::Internal::SideArea' unnamed='1' " + "window=':Qt Creator_Core::Internal::MainWindow'} type='QWidget' " + "unnamed='1'}") return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar, isUrlButton) def getWelcomeScreenMainButton(buttonLabel): diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py index d2650081f8..e3537a573b 100644 --- a/tests/system/suite_WELP/tst_WELP02/test.py +++ b/tests/system/suite_WELP/tst_WELP02/test.py @@ -75,13 +75,15 @@ def main(): return switchToSubMode('Projects') - typePropDet = (("QPushButton", "Get Started Now", "Get Started Now button"), - ("QTreeView", "Sessions", "Sessions section"), + typePropDet = (("QTreeView", "Sessions", "Sessions section"), ("SessionModelIndex", ("default", False), "default session listed"), ("QTreeView", "Recent Projects", "Projects section") ) checkTypeAndProperties(typePropDet) + getStartedF, getStartedL = getWelcomeScreenSideBarButton("Get Started") + test.verify(getStartedF is not None and getStartedL is not None, "'Get Started' button found") + # select "Create Project" and try to create a new project createNewQtQuickApplication(tempDir(), "SampleApp", fromWelcome = True) test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'" diff --git a/tests/system/suite_WELP/tst_WELP03/test.py b/tests/system/suite_WELP/tst_WELP03/test.py index 92e09f536a..bc16fd0e59 100644 --- a/tests/system/suite_WELP/tst_WELP03/test.py +++ b/tests/system/suite_WELP/tst_WELP03/test.py @@ -42,10 +42,10 @@ def handlePackagingMessageBoxes(): def openExample(examplesLineEdit, input, exampleRegex, exampleName): replaceEditorContent(examplesLineEdit, input) - tableView = waitForObject("{type='QTableView' unnamed='1' visible='1' " + listView = waitForObject("{type='QListView' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}") - waitFor('findExampleOrTutorial(tableView, exampleRegex) is not None', 3000) - example = findExampleOrTutorial(tableView, exampleRegex, True) + waitFor('findExampleOrTutorial(listView, exampleRegex) is not None', 3000) + example = findExampleOrTutorial(listView, exampleRegex, True) if test.verify(example is not None, "Verifying: Example (%s) is shown." % exampleName): mouseClick(example) handlePackagingMessageBoxes() @@ -67,7 +67,7 @@ def main(): qchs.extend([os.path.join(p, "qtopengl.qch"), os.path.join(p, "qtwidgets.qch")]) addHelpDocumentation(qchs) setFixedHelpViewer(HelpViewer.HELPMODE) - wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Get Started Now') + wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Get Started') if not test.verify(all((wsButtonFrame, wsButtonLabel)), "Verifying: Qt Creator displays Welcome Page with Getting Started."): test.fatal("Something's wrong - leaving test.") @@ -75,7 +75,7 @@ def main(): return # select "Examples" topic switchToSubMode('Examples') - expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", + expect = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", "examples list"), ("QLineEdit", "placeholderText='Search in Examples...'", "examples search line edit"), ("QComboBox", "currentText~='.*Qt.*' visible='1'", "Qt version combo box")) @@ -88,9 +88,9 @@ def main(): combo = waitForObject(search % (expect[2][0], expect[2][1])) test.log("Using examples from Kit %s." % str(combo.currentText)) replaceEditorContent(examplesLineEdit, "qwerty") - tableView = waitForObject(search % (expect[0][0], expect[0][1])) - waitFor('findExampleOrTutorial(tableView, ".*") is None', 3000) - example = findExampleOrTutorial(tableView, ".*", True) + listView = waitForObject(search % (expect[0][0], expect[0][1])) + waitFor('findExampleOrTutorial(listView, ".*") is None', 3000) + example = findExampleOrTutorial(listView, ".*", True) test.verify(example is None, "Verifying: No example is shown.") proFiles = map(lambda p: os.path.join(p, "opengl", "2dpainting", "2dpainting.pro"), diff --git a/tests/system/suite_WELP/tst_WELP04/test.py b/tests/system/suite_WELP/tst_WELP04/test.py index f66efba6c5..a5026808b4 100644 --- a/tests/system/suite_WELP/tst_WELP04/test.py +++ b/tests/system/suite_WELP/tst_WELP04/test.py @@ -30,7 +30,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Get Started Now') + wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Get Started') if not test.verify(all((wsButtonFrame, wsButtonLabel)), "Verifying: Qt Creator displays Welcome Page with Getting Started."): test.fatal("Something's wrong - leaving test.") @@ -44,16 +44,16 @@ def main(): searchTutorials = waitForObject("{type='QLineEdit' placeholderText='Search in Tutorials...'}") mouseClick(searchTutorials) replaceEditorContent(searchTutorials, "qwerty") - tableView = waitForObject("{type='QTableView' unnamed='1' visible='1' " + listView = waitForObject("{type='QListView' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}") - waitFor('findExampleOrTutorial(tableView, ".*") is None', 3000) - tutorial = findExampleOrTutorial(tableView, ".*", True) + waitFor('findExampleOrTutorial(listView, ".*") is None', 3000) + tutorial = findExampleOrTutorial(listView, ".*", True) test.verify(tutorial is None, "Verifying: 'Tutorials' topic is opened and nothing is shown.") bnr = "Help: Building and Running an Example" replaceEditorContent(searchTutorials, bnr.lower()) - waitFor('findExampleOrTutorial(tableView, "%s.*") is not None' % bnr, 3000) - tutorial = findExampleOrTutorial(tableView, "%s.*" % bnr, True) + waitFor('findExampleOrTutorial(listView, "%s.*") is not None' % bnr, 3000) + tutorial = findExampleOrTutorial(listView, "%s.*" % bnr, True) test.verify(tutorial is not None, "Verifying: Expected Text tutorial is shown.") # clicking before documentation was updated will open the tutorial in browser progressBarWait(warn=False) @@ -67,8 +67,9 @@ def main(): # check a demonstration video link mouseClick(searchTutorials) replaceEditorContent(searchTutorials, "embedded device") - waitFor('findExampleOrTutorial(tableView, "Online: Qt for Device Creation.*") is not None', 3000) - tutorial = findExampleOrTutorial(tableView, "Online: Qt for Device Creation.*", True) + embeddedTutorial = "Online: How to install and set up Qt for Device Creation.*" + waitFor('findExampleOrTutorial(listView, embeddedTutorial) is not None', 3000) + tutorial = findExampleOrTutorial(listView, embeddedTutorial, True) test.verify(tutorial is not None, "Verifying: Link to the expected demonstration video exists.") # exit Qt Creator |