aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2018-07-10 13:57:16 +0200
committerRobert Loehning <robert.loehning@qt.io>2018-07-11 09:25:15 +0000
commite0f877916828d808f5baf0d926132a73cbc5d332 (patch)
tree6fbfcf78bee214cb1b0026c70768afd986324e27
parent626c08aaa5243a854149bdc0a0f3e2f9f6ea6d2e (diff)
Squish: Update suite_WELP
This is a follow-up to 744279. Change-Id: I24485972b3a292952c653f2cfab1af198578fcc4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--tests/system/shared/welcome.py7
-rwxr-xr-xtests/system/suite_WELP/tst_WELP01/test.py12
-rw-r--r--tests/system/suite_WELP/tst_WELP02/test.py1
-rw-r--r--tests/system/suite_WELP/tst_WELP03/test.py4
-rw-r--r--tests/system/suite_WELP/tst_WELP04/test.py5
5 files changed, 15 insertions, 14 deletions
diff --git a/tests/system/shared/welcome.py b/tests/system/shared/welcome.py
index 73ee0a486e..dc48424a5c 100644
--- a/tests/system/shared/welcome.py
+++ b/tests/system/shared/welcome.py
@@ -59,6 +59,13 @@ def getWelcomeTreeView(treeViewLabel):
except:
return None
+def switchToSubMode(subModeLabel):
+ wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(subModeLabel)
+ frameAndLabelFound = all((wsButtonFrame, wsButtonLabel))
+ if frameAndLabelFound:
+ mouseClick(wsButtonLabel)
+ return frameAndLabelFound
+
def findExampleOrTutorial(tableView, regex, verbose=False):
model = tableView.model()
children = __childrenOfType__(tableView, 'QModelIndex')
diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py
index d4d2d25bde..89bb63353f 100755
--- a/tests/system/suite_WELP/tst_WELP01/test.py
+++ b/tests/system/suite_WELP/tst_WELP01/test.py
@@ -82,7 +82,7 @@ def main():
setFixedHelpViewer(HelpViewer.HELPMODE)
addCurrentCreatorDocumentation()
- buttonsAndState = {'Projects':True, 'Examples':False, 'Tutorials':False}
+ buttonsAndState = {'Projects':False, 'Examples':True, 'Tutorials':False}
for button, state in buttonsAndState.items():
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(button)
if test.verify(all((wsButtonFrame, wsButtonLabel)),
@@ -90,6 +90,8 @@ def main():
test.compare(buttonActive(wsButtonFrame), state,
"Verifying whether '%s' button is active (%s)." % (button, state))
+ # select Projects and roughly check this
+ switchToSubMode('Projects')
for button in ['New Project', 'Open Project']:
wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton(button)
if test.verify(all((wsButtonFrame, wsButtonLabel)),
@@ -130,9 +132,7 @@ def main():
test.verify(wsButtonFrame is not None and wsButtonLabel is not None,
"Verifying: Getting Started topic is being displayed.")
# select Examples and roughly check them
- wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Examples')
- if all((wsButtonFrame, wsButtonLabel)):
- mouseClick(wsButtonLabel)
+ switchToSubMode('Examples')
test.verify(waitForButtonsState(False, True, False), "Buttons' states have changed.")
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
@@ -147,9 +147,7 @@ def main():
"Verifying that at least one example is displayed.")
# select Tutorials and roughly check them
- wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Tutorials')
- if all((wsButtonFrame, wsButtonLabel)):
- mouseClick(wsButtonLabel)
+ switchToSubMode('Tutorials')
test.verify(waitForButtonsState(False, False, True), "Buttons' states have changed.")
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
"tutorials list"),
diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py
index e809a753df..aaf80e5e80 100644
--- a/tests/system/suite_WELP/tst_WELP02/test.py
+++ b/tests/system/suite_WELP/tst_WELP02/test.py
@@ -74,6 +74,7 @@ def main():
if not startedWithoutPluginError():
return
+ switchToSubMode('Projects')
typePropDet = (("QPushButton", "Get Started Now", "Get Started Now button"),
("QTreeView", "Sessions", "Sessions section"),
("SessionModelIndex", ("default", False), "default session listed"),
diff --git a/tests/system/suite_WELP/tst_WELP03/test.py b/tests/system/suite_WELP/tst_WELP03/test.py
index b6d4e1c940..347d37ec1a 100644
--- a/tests/system/suite_WELP/tst_WELP03/test.py
+++ b/tests/system/suite_WELP/tst_WELP03/test.py
@@ -74,9 +74,7 @@ def main():
invokeMenuItem("File", "Exit")
return
# select "Examples" topic
- wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Examples')
- if all((wsButtonFrame, wsButtonLabel)):
- mouseClick(wsButtonLabel)
+ switchToSubMode('Examples')
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
"examples list"),
("QLineEdit", "placeholderText='Search in Examples...'", "examples search line edit"),
diff --git a/tests/system/suite_WELP/tst_WELP04/test.py b/tests/system/suite_WELP/tst_WELP04/test.py
index 18659f2262..c1855ac0ed 100644
--- a/tests/system/suite_WELP/tst_WELP04/test.py
+++ b/tests/system/suite_WELP/tst_WELP04/test.py
@@ -37,10 +37,7 @@ def main():
invokeMenuItem("File", "Exit")
return
# select "Tutorials"
- wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Tutorials')
- if all((wsButtonFrame, wsButtonLabel)):
- mouseClick(wsButtonLabel)
- else:
+ if not switchToSubMode('Tutorials'):
test.fatal("Could not find Tutorials button - leaving test")
invokeMenuItem("File", "Exit")
return