Commit 74649b7b authored by Robert Loehning's avatar Robert Loehning

Squish: Update handling of HelpViewer

Change-Id: I5b0b3e4d6c7e1e9e72ac0265bc4bfb276561e247
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 20c4f523
......@@ -160,7 +160,7 @@
:Qt Creator_FilenameQComboBox {type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Find::Internal::SearchResultTreeView {type='Core::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Git::Internal::GitEditor {type='Git::Internal::GitEditor' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::HelpViewer' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::QtWebKitHelpWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_ProFileEditorWidget {type='QmakeProjectManager::Internal::ProFileEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
......
......@@ -655,3 +655,17 @@ def getChildByClass(parent, classToSearchFor, occurrence=1):
return None
else:
return children[occurrence - 1]
def getHelpViewer():
try:
return waitForObject(":Qt Creator_Help::Internal::HelpViewer", 1000)
except:
return waitForObject("{type='Help::Internal::TextBrowserHelpWidget' unnamed='1' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 1000)
def getHelpTitle():
hv = getHelpViewer()
try:
return str(hv.title)
except:
return str(hv.documentTitle)
......@@ -35,7 +35,7 @@ searchKeywordDictionary={ "deployment":True, "deplmint":False, "build":True, "bl
def __getSelectedText__():
hv = findObject(":Qt Creator_Help::Internal::HelpViewer")
hv = getHelpViewer()
try:
selText = hv.selectedText
if className(selText) != 'instancemethod':
......@@ -50,7 +50,7 @@ def __getSelectedText__():
return str(selText)
def __getUrl__():
helpViewer = findObject(":Qt Creator_Help::Internal::HelpViewer")
helpViewer = getHelpViewer()
try:
url = helpViewer.url
except:
......
......@@ -43,7 +43,7 @@ def verifyInteractiveQMLHelp(lineText, helpText):
type(editorArea, homeKey)
# call help
type(editorArea, "<F1>")
test.verify(helpText in str(waitForObject(":Qt Creator_Help::Internal::HelpViewer").title),
test.verify(helpText in getHelpTitle(),
"Verifying if help is opened with documentation for '%s'." % helpText)
def main():
......
......@@ -103,14 +103,14 @@ def main():
for i in range(6):
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Right>")
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Return>")
test.verify(textForQtVersion("Building and Running an Example") in str(waitForObject(":Qt Creator_Help::Internal::HelpViewer").title),
test.verify(textForQtVersion("Building and Running an Example") in getHelpTitle(),
"Verifying if first bookmark is opened")
mouseClick(waitForObject(bldRunQModelIndex))
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Down>")
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Right>")
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Down>")
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Return>")
test.verify(textForQtVersion("Qt Creator Manual") in str(waitForObject(":Qt Creator_Help::Internal::HelpViewer").title),
test.verify(textForQtVersion("Qt Creator Manual") in getHelpTitle(),
"Verifying if second bookmark is opened")
# delete previously created directory
clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment