forked from qt-creator/qt-creator
Squish: Update suite_WELP
This is a follow-up to 744279. Change-Id: I24485972b3a292952c653f2cfab1af198578fcc4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -59,6 +59,13 @@ def getWelcomeTreeView(treeViewLabel):
|
|||||||
except:
|
except:
|
||||||
return None
|
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):
|
def findExampleOrTutorial(tableView, regex, verbose=False):
|
||||||
model = tableView.model()
|
model = tableView.model()
|
||||||
children = __childrenOfType__(tableView, 'QModelIndex')
|
children = __childrenOfType__(tableView, 'QModelIndex')
|
||||||
|
@@ -82,7 +82,7 @@ def main():
|
|||||||
setFixedHelpViewer(HelpViewer.HELPMODE)
|
setFixedHelpViewer(HelpViewer.HELPMODE)
|
||||||
addCurrentCreatorDocumentation()
|
addCurrentCreatorDocumentation()
|
||||||
|
|
||||||
buttonsAndState = {'Projects':True, 'Examples':False, 'Tutorials':False}
|
buttonsAndState = {'Projects':False, 'Examples':True, 'Tutorials':False}
|
||||||
for button, state in buttonsAndState.items():
|
for button, state in buttonsAndState.items():
|
||||||
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(button)
|
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(button)
|
||||||
if test.verify(all((wsButtonFrame, wsButtonLabel)),
|
if test.verify(all((wsButtonFrame, wsButtonLabel)),
|
||||||
@@ -90,6 +90,8 @@ def main():
|
|||||||
test.compare(buttonActive(wsButtonFrame), state,
|
test.compare(buttonActive(wsButtonFrame), state,
|
||||||
"Verifying whether '%s' button is active (%s)." % (button, 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']:
|
for button in ['New Project', 'Open Project']:
|
||||||
wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton(button)
|
wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton(button)
|
||||||
if test.verify(all((wsButtonFrame, wsButtonLabel)),
|
if test.verify(all((wsButtonFrame, wsButtonLabel)),
|
||||||
@@ -130,9 +132,7 @@ def main():
|
|||||||
test.verify(wsButtonFrame is not None and wsButtonLabel is not None,
|
test.verify(wsButtonFrame is not None and wsButtonLabel is not None,
|
||||||
"Verifying: Getting Started topic is being displayed.")
|
"Verifying: Getting Started topic is being displayed.")
|
||||||
# select Examples and roughly check them
|
# select Examples and roughly check them
|
||||||
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Examples')
|
switchToSubMode('Examples')
|
||||||
if all((wsButtonFrame, wsButtonLabel)):
|
|
||||||
mouseClick(wsButtonLabel)
|
|
||||||
test.verify(waitForButtonsState(False, True, False), "Buttons' states have changed.")
|
test.verify(waitForButtonsState(False, True, False), "Buttons' states have changed.")
|
||||||
|
|
||||||
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
|
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.")
|
"Verifying that at least one example is displayed.")
|
||||||
|
|
||||||
# select Tutorials and roughly check them
|
# select Tutorials and roughly check them
|
||||||
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Tutorials')
|
switchToSubMode('Tutorials')
|
||||||
if all((wsButtonFrame, wsButtonLabel)):
|
|
||||||
mouseClick(wsButtonLabel)
|
|
||||||
test.verify(waitForButtonsState(False, False, True), "Buttons' states have changed.")
|
test.verify(waitForButtonsState(False, False, True), "Buttons' states have changed.")
|
||||||
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
|
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
|
||||||
"tutorials list"),
|
"tutorials list"),
|
||||||
|
@@ -74,6 +74,7 @@ def main():
|
|||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
switchToSubMode('Projects')
|
||||||
typePropDet = (("QPushButton", "Get Started Now", "Get Started Now button"),
|
typePropDet = (("QPushButton", "Get Started Now", "Get Started Now button"),
|
||||||
("QTreeView", "Sessions", "Sessions section"),
|
("QTreeView", "Sessions", "Sessions section"),
|
||||||
("SessionModelIndex", ("default", False), "default session listed"),
|
("SessionModelIndex", ("default", False), "default session listed"),
|
||||||
|
@@ -74,9 +74,7 @@ def main():
|
|||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
# select "Examples" topic
|
# select "Examples" topic
|
||||||
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Examples')
|
switchToSubMode('Examples')
|
||||||
if all((wsButtonFrame, wsButtonLabel)):
|
|
||||||
mouseClick(wsButtonLabel)
|
|
||||||
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
|
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
|
||||||
"examples list"),
|
"examples list"),
|
||||||
("QLineEdit", "placeholderText='Search in Examples...'", "examples search line edit"),
|
("QLineEdit", "placeholderText='Search in Examples...'", "examples search line edit"),
|
||||||
|
@@ -37,10 +37,7 @@ def main():
|
|||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
# select "Tutorials"
|
# select "Tutorials"
|
||||||
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Tutorials')
|
if not switchToSubMode('Tutorials'):
|
||||||
if all((wsButtonFrame, wsButtonLabel)):
|
|
||||||
mouseClick(wsButtonLabel)
|
|
||||||
else:
|
|
||||||
test.fatal("Could not find Tutorials button - leaving test")
|
test.fatal("Could not find Tutorials button - leaving test")
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user