Squish: Update Welcome page test

Change-Id: I447addcba50e932886a8ed5e730a1eab663a2224
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2022-03-22 14:00:36 +01:00
parent 0f7a4484d0
commit 34b94d8cd2
2 changed files with 11 additions and 11 deletions

View File

@@ -46,10 +46,10 @@ def getWelcomeScreenSideBarButton(buttonLabel, isUrlButton = False):
"unnamed='1'}") "unnamed='1'}")
return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar, isUrlButton) return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar, isUrlButton)
def getWelcomeScreenMainButton(buttonLabel): def getWelcomeScreenBottomButton(buttonLabel):
stackedWidget = waitForObject(":Qt Creator.WelcomeScreenStackedWidget") bottomArea = waitForObject("{type='Welcome::Internal::BottomArea' unnamed='1' "
currentStackWidget = stackedWidget.currentWidget() "window=':Qt Creator_Core::Internal::MainWindow'}")
return __getWelcomeScreenButtonHelper__(buttonLabel, currentStackWidget) return __getWelcomeScreenButtonHelper__(buttonLabel, bottomArea, False)
def getWelcomeTreeView(treeViewLabel): def getWelcomeTreeView(treeViewLabel):
try: try:

View File

@@ -25,7 +25,7 @@
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
getStarted = 'Get Started Now' getStarted = 'Get Started'
def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails): def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails):
global getStarted global getStarted
@@ -41,7 +41,7 @@ def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails):
"Verifying: '%s' button is being displayed." % getStarted) "Verifying: '%s' button is being displayed." % getStarted)
def buttonActive(button): def buttonActive(button):
# colors of the default theme for active button on Welcome page # colors of the default theme for active button on Welcome page
(activeRed, activeGreen, activeBlue) = (64, 65, 66) (activeRed, activeGreen, activeBlue) = (69, 206, 85)
# QPalette::Window (used background color of Welcome page buttons) # QPalette::Window (used background color of Welcome page buttons)
enumQPaletteWindow = 10 enumQPaletteWindow = 10
color = button.palette.color(enumQPaletteWindow) color = button.palette.color(enumQPaletteWindow)
@@ -92,8 +92,8 @@ def main():
# select Projects and roughly check this # select Projects and roughly check this
switchToSubMode('Projects') switchToSubMode('Projects')
for button in ['New', 'Open']: for button in ['Create Project...', 'Open Project...']:
wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton(button) wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(button)
if test.verify(all((wsButtonFrame, wsButtonLabel)), if test.verify(all((wsButtonFrame, wsButtonLabel)),
"Verified whether '%s' button is shown." % button): "Verified whether '%s' button is shown." % button):
test.verify(not buttonActive(wsButtonFrame), test.verify(not buttonActive(wsButtonFrame),
@@ -111,7 +111,7 @@ def main():
'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html' 'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html'
} }
for text, url in textUrls.items(): for text, url in textUrls.items():
button, label = getWelcomeScreenSideBarButton(text, True) button, label = getWelcomeScreenBottomButton(text)
if test.verify(all((button, label)), if test.verify(all((button, label)),
"Verifying whether link button (%s) exists." % text): "Verifying whether link button (%s) exists." % text):
test.compare(str(button.toolTip), url, "Verifying URL for %s" % text) test.compare(str(button.toolTip), url, "Verifying URL for %s" % text)
@@ -135,7 +135,7 @@ def main():
switchToSubMode('Examples') switchToSubMode('Examples')
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 = (("QListView", "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"),
("QComboBox", "currentText~='.*Qt.*'", "Qt version combo box")) ("QComboBox", "currentText~='.*Qt.*'", "Qt version combo box"))
@@ -149,7 +149,7 @@ def main():
# select Tutorials and roughly check them # select Tutorials and roughly check them
switchToSubMode('Tutorials') switchToSubMode('Tutorials')
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 = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
"tutorials list"), "tutorials list"),
("QLineEdit", "placeholderText='Search in Tutorials...'", ("QLineEdit", "placeholderText='Search in Tutorials...'",
"tutorials search line edit")) "tutorials search line edit"))