SquishTests: Adapt to doc changes

Change-Id: If67606f85b45a9c787cf8cef7fc42721f0be8eaa
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2024-07-08 09:12:27 +02:00
parent 7dfbab418f
commit 533f03f248
3 changed files with 10 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ def getQtCreatorVersionFromFile():
def checkQtCreatorHelpVersion(expectedVersion): def checkQtCreatorHelpVersion(expectedVersion):
def rightStart(x): def rightStart(x):
return x.startswith('Qt Creator Manual') return x.startswith('Qt Creator Documentation')
switchViewTo(ViewConstants.HELP) switchViewTo(ViewConstants.HELP)
try: try:
@@ -45,7 +45,7 @@ def checkQtCreatorHelpVersion(expectedVersion):
waitFor("any(map(rightStart, dumpItems(helpContentWidget.model())))", 10000) waitFor("any(map(rightStart, dumpItems(helpContentWidget.model())))", 10000)
items = dumpItems(helpContentWidget.model()) items = dumpItems(helpContentWidget.model())
test.compare(next(iter(filter(rightStart, items))), test.compare(next(iter(filter(rightStart, items))),
'Qt Creator Manual %s' % expectedVersion, 'Qt Creator Documentation %s' % expectedVersion,
'Verifying whether manual uses expected version.') 'Verifying whether manual uses expected version.')
except: except:
t, v = sys.exc_info()[:2] t, v = sys.exc_info()[:2]

View File

@@ -17,7 +17,7 @@ def invokeContextMenuItemOnBookmarkFolder(view, item, menuItem):
"window=':Add Bookmark_BookmarkDialog'}", menuItem)) "window=':Add Bookmark_BookmarkDialog'}", menuItem))
def textForQtVersion(text): def textForQtVersion(text):
suffix = "Qt Creator Manual" suffix = "Qt Creator Documentation"
if text != suffix: if text != suffix:
text += " | " + suffix text += " | " + suffix
return text return text
@@ -28,15 +28,14 @@ def main():
return return
# goto help mode and click on topic # goto help mode and click on topic
switchViewTo(ViewConstants.HELP) switchViewTo(ViewConstants.HELP)
manualQModelIndex = getQModelIndexStr("text?='Qt Creator Manual *'", manualQModelIndex = getQModelIndexStr("text?='Qt Creator Documentation *'",
":Qt Creator_QHelpContentWidget") ":Qt Creator_QHelpContentWidget")
manualQMIObj = waitForObject(manualQModelIndex) manualQMIObj = waitForObject(manualQModelIndex)
doubleClick(manualQMIObj, 5, 5, 0, Qt.LeftButton) doubleClick(manualQMIObj, 5, 5, 0, Qt.LeftButton)
if not waitFor("not manualQMIObj.collapsed", 2000): if not waitFor("not manualQMIObj.collapsed", 2000):
test.warning("It takes more than two seconds to expand the help content tree.") test.warning("It takes more than two seconds to expand the help content tree.")
devQModelIndex = getQModelIndexStr("text='Developing with Qt Creator'", manualQModelIndex)
doubleClick(devQModelIndex) gettingStartedQModelIndex = getQModelIndexStr("text='Getting Started'", manualQModelIndex)
gettingStartedQModelIndex = getQModelIndexStr("text='Getting Started'", devQModelIndex)
doubleClick(gettingStartedQModelIndex) doubleClick(gettingStartedQModelIndex)
pageTitle = "Configuring Qt Creator" pageTitle = "Configuring Qt Creator"
mouseClick(waitForObject(getQModelIndexStr("text='%s'" % pageTitle, mouseClick(waitForObject(getQModelIndexStr("text='%s'" % pageTitle,
@@ -80,7 +79,7 @@ def main():
configQModelIndex = getQModelIndexStr("text?='%s'" % textForQtVersion("%s*" % pageTitle), configQModelIndex = getQModelIndexStr("text?='%s'" % textForQtVersion("%s*" % pageTitle),
folder2QModelIndex) folder2QModelIndex)
newFolderQModelIndex = getQModelIndexStr("text='New Folder'", sampleQModelIndex) newFolderQModelIndex = getQModelIndexStr("text='New Folder'", sampleQModelIndex)
manualQModelIndex = getQModelIndexStr("text='%s'" % textForQtVersion("Qt Creator Manual"), manualQModelIndex = getQModelIndexStr("text='%s'" % textForQtVersion("Qt Creator Documentation"),
newFolderQModelIndex) newFolderQModelIndex)
test.verify(checkIfObjectExists(sampleQModelIndex, verboseOnFail = True) and test.verify(checkIfObjectExists(sampleQModelIndex, verboseOnFail = True) and
checkIfObjectExists(folder1QModelIndex, verboseOnFail = True) and checkIfObjectExists(folder1QModelIndex, verboseOnFail = True) and
@@ -99,7 +98,7 @@ def main():
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Right>") type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Right>")
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Down>") type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Down>")
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Return>") type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Return>")
test.verify(textForQtVersion("Qt Creator Manual") in getHelpTitle(), test.verify(textForQtVersion("Qt Creator Documentation") in getHelpTitle(),
"Verifying if second bookmark is opened") "Verifying if second bookmark is opened")
# delete previously created directory # delete previously created directory
clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton")) clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton"))

View File

@@ -75,7 +75,7 @@ def main():
wsButton = getWelcomeScreenSideBarButton(getStarted) wsButton = getWelcomeScreenSideBarButton(getStarted)
if test.verify(object.exists(wsButton), if test.verify(object.exists(wsButton),
"Verifying: Qt Creator displays Welcome Page with '%s' button." % getStarted): "Verifying: Qt Creator displays Welcome Page with '%s' button." % getStarted):
if clickItemVerifyHelpCombo(wsButton, "Getting Started | Qt Creator Manual", if clickItemVerifyHelpCombo(wsButton, "Getting Started \| Qt Creator Documentation",
"Verifying: Help with Creator Documentation is being opened."): "Verifying: Help with Creator Documentation is being opened."):
textUrls = {'Online Community':'https://forum.qt.io', textUrls = {'Online Community':'https://forum.qt.io',
@@ -92,7 +92,7 @@ def main():
wsButton = getWelcomeScreenSideBarButton(getStarted) wsButton = getWelcomeScreenSideBarButton(getStarted)
if object.exists(wsButton): if object.exists(wsButton):
mouseClick(wsButton) mouseClick(wsButton)
qcManualQModelIndexStr = getQModelIndexStr("text~='Qt Creator Manual [0-9.]+'", qcManualQModelIndexStr = getQModelIndexStr("text~='Qt Creator Documentation [0-9.]+'",
":Qt Creator_QHelpContentWidget") ":Qt Creator_QHelpContentWidget")
if str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) == "(Untitled)": if str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) == "(Untitled)":
mouseClick(qcManualQModelIndexStr) mouseClick(qcManualQModelIndexStr)