summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kerekes <jan.kerekes@ixonos.com>2012-03-21 14:48:31 +0100
committerRobert Löhning <robert.loehning@nokia.com>2012-06-12 19:00:24 +0200
commit23c7665cc5d94bedd2278ef70e7cb1a7ae3ab431 (patch)
tree200175b486b8329bd940ada55033dd85bb5adb8c
parenta66e344b424643fce71c127fdfb0a21103ca0171 (diff)
downloadqt-creator-23c7665cc5d94bedd2278ef70e7cb1a7ae3ab431.tar.gz
Squish: Added new test cases/suite for help functionality
initial commit Change-Id: I20aae999dec164a29e40c2926e36c015526c17cd Reviewed-by: Christian Stenger <christian.stenger@nokia.com> Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
-rwxr-xr-xtests/system/shared/suites_qtta.py7
-rwxr-xr-xtests/system/suite_HELP/envvars1
-rw-r--r--tests/system/suite_HELP/objects.map55
-rwxr-xr-xtests/system/suite_HELP/suite.conf10
-rwxr-xr-xtests/system/suite_HELP/tst_HELP02/test.py50
-rwxr-xr-xtests/system/suite_HELP/tst_HELP04/test.py116
-rwxr-xr-xtests/system/suite_HELP/tst_HELP05/test.py34
-rwxr-xr-xtests/system/suite_HELP/tst_HELP06/test.py83
8 files changed, 354 insertions, 2 deletions
diff --git a/tests/system/shared/suites_qtta.py b/tests/system/shared/suites_qtta.py
index a3cb36d8d3..70b4d9a467 100755
--- a/tests/system/shared/suites_qtta.py
+++ b/tests/system/shared/suites_qtta.py
@@ -35,8 +35,11 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
return False
# wait and verify if object exists/not exists
-def checkIfObjectExists(name, shouldExist = True, timeout = 3000):
- return waitFor("object.exists(name) == shouldExist", timeout)
+def checkIfObjectExists(name, shouldExist = True, timeout = 3000, verboseOnFail = False):
+ result = waitFor("object.exists(name) == shouldExist", timeout)
+ if verboseOnFail and not result:
+ test.log("checkIfObjectExists() failed for '%s'" % name)
+ return result
# change autocomplete options to manual
def changeAutocompleteToManual():
diff --git a/tests/system/suite_HELP/envvars b/tests/system/suite_HELP/envvars
new file mode 100755
index 0000000000..00aad3eab7
--- /dev/null
+++ b/tests/system/suite_HELP/envvars
@@ -0,0 +1 @@
+QT_PLATFORM_PLUGIN=nonesuch
diff --git a/tests/system/suite_HELP/objects.map b/tests/system/suite_HELP/objects.map
new file mode 100644
index 0000000000..149070d411
--- /dev/null
+++ b/tests/system/suite_HELP/objects.map
@@ -0,0 +1,55 @@
+:About Qt Creator.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':About Qt Creator_Core::Internal::VersionDialog'}
+:About Qt Creator.Label {text?='*Qt Creator*' type='QLabel' unnamed='1' visible='1' window=':About Qt Creator_Core::Internal::VersionDialog'}
+:About Qt Creator_Core::Internal::VersionDialog {type='Core::Internal::VersionDialog' unnamed='1' visible='1' windowTitle='About Qt Creator'}
+:Add Bookmark.+_QToolButton {name='toolButton' text='+' type='QToolButton' visible='1' window=':Add Bookmark_BookmarkDialog'}
+:Add Bookmark.New Folder_QPushButton {name='newFolderButton' text='New Folder' type='QPushButton' visible='1' window=':Add Bookmark_BookmarkDialog'}
+:Add Bookmark.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'}
+:Add Bookmark.line_QFrame {name='line' type='QFrame' visible='1' window=':Add Bookmark_BookmarkDialog'}
+:Add Bookmark.line_QMenu {aboveWidget=':Add Bookmark.line_QFrame' type='QMenu' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'}
+:Add Bookmark.treeView_QTreeView {name='treeView' type='QTreeView' visible='1' window=':Add Bookmark_BookmarkDialog'}
+:Add Bookmark_BookmarkDialog {name='BookmarkDialog' type='BookmarkDialog' visible='1' windowTitle='Add Bookmark'}
+:Folder 1.Folder 2_QModelIndex {column='0' container=':Sample.Folder 1_QModelIndex' text='Folder 2' type='QModelIndex'}
+:Folder 2.Qt Creator : Building and Running an Example_QModelIndex {column='0' container=':Folder 1.Folder 2_QModelIndex' text?='Qt Creator : Building and Running an Example*' type='QModelIndex'}
+:Getting Started.Building and Running an Example_QModelIndex {column='0' container=':Qt Creator Manual*.Getting Started_QModelIndex' text='Building and Running an Example' type='QModelIndex'}
+:Hits_QCLuceneResultWidget {aboveWidget=':Hits_QLabel' type='QCLuceneResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:New Folder.Qt Creator : Qt Creator Manual_QModelIndex {column='0' container=':Sample.New Folder_QModelIndex' text='Qt Creator : Qt Creator Manual' type='QModelIndex'}
+:Next_QPushButton {text~='(Next.*|Continue)' type='QPushButton' visible='1'}
+:Options.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
+:Options.qt_tabwidget_tabbar_QTabBar {name='qt_tabwidget_tabbar' type='QTabBar' visible='1' window=':Options_Core::Internal::SettingsDialog'}
+:Options_Core::Internal::SettingsDialog {type='Core::Internal::SettingsDialog' unnamed='1' visible='1' windowTitle~='Options|Preferences'}
+:Options_QListView {type='QListView' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
+:Qt Creator Manual QModelIndex {column='0' container=':Qt Creator_QHelpContentWidget' text='Qt Creator Manual 2.5.1' type='QModelIndex'}
+:Qt Creator Manual*.Getting Started_QModelIndex {column='0' container=':Qt Creator Manual QModelIndex' text='Getting Started' type='QModelIndex'}
+:Qt Creator.+_QToolButton {text='+' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.Search for:_QLabel {text='Search for:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.Search for:_QLineEdit {leftWidget=':Qt Creator.Search for:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.Search_QPushButton {text='Search' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.with all of the words:_QLabel {text='with <B>all</B> of the words:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.with all of the words:_QLineEdit {leftWidget=':Qt Creator.with all of the words:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.with at least one of the words:_QLabel {text='with <B>at least one</B> of the words:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.with at least one of the words:_QLineEdit {leftWidget=':Qt Creator.with at least one of the words:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.with exact phrase:_QLabel {text='with <B>exact phrase</B>:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.with exact phrase:_QLineEdit {leftWidget=':Qt Creator.with exact phrase:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.without the words:_QLabel {text='<B>without</B> the words:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.without the words:_QLineEdit {leftWidget=':Qt Creator.without the words:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.words similar to:_QLabel {text='words <B>similar</B> to:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator.words similar to:_QLineEdit {leftWidget=':Qt Creator.words similar to:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_Core::Internal::CommandComboBox {occurrence='2' type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_Core::Internal::CommandComboBox_2 {type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' unnamed='1' visible='1' windowTitle?='*Qt Creator'}
+:Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::HelpViewer' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_QHelpContentWidget {type='QHelpContentWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_QHelpSearchQueryWidget {type='QHelpSearchQueryWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::QmlJSTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_TreeView {type='TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Reference Documentation_QModelIndex {column='0' container=':Qt Creator_QHelpContentWidget' text='Qt Reference Documentation' type='QModelIndex'}
+:Sample.Folder 1_QModelIndex {column='0' container=':Sample_QModelIndex' text='Folder 1' type='QModelIndex'}
+:Sample.New Folder_QModelIndex {column='0' container=':Sample_QModelIndex' text?='New Folder*' type='QModelIndex'}
+:Sample_QModelIndex {column='0' container=':Qt Creator_TreeView' text='Sample' type='QModelIndex'}
+:addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'}
+:treeView.Sample_QModelIndex {column='0' container=':Add Bookmark.treeView_QTreeView' text='Sample' type='QModelIndex'}
+:treeView.Yes_QPushButton {container=':Add Bookmark.treeView_QTreeView' text='Yes' type='QPushButton' unnamed='1' visible='1'}
+:treeView_QExpandingLineEdit {container=':Add Bookmark.treeView_QTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'}
diff --git a/tests/system/suite_HELP/suite.conf b/tests/system/suite_HELP/suite.conf
new file mode 100755
index 0000000000..bc9c7f65ab
--- /dev/null
+++ b/tests/system/suite_HELP/suite.conf
@@ -0,0 +1,10 @@
+AUT=qtcreator
+CLASS=
+CLASSPATH=
+ENVVARS=envvars
+HOOK_SUB_PROCESSES=false
+IMPLICITAUTSTART=0
+LANGUAGE=Python
+TEST_CASES=tst_HELP02 tst_HELP04 tst_HELP05 tst_HELP06
+VERSION=2
+WRAPPERS=Qt
diff --git a/tests/system/suite_HELP/tst_HELP02/test.py b/tests/system/suite_HELP/tst_HELP02/test.py
new file mode 100755
index 0000000000..79673ed445
--- /dev/null
+++ b/tests/system/suite_HELP/tst_HELP02/test.py
@@ -0,0 +1,50 @@
+source("../../shared/qtcreator.py")
+source("../../shared/suites_qtta.py")
+
+# test Qt Creator version information from file and dialog
+def getQtCreatorVersionFromDialog():
+ chk = re.search("(?<=Qt Creator)\s\d+.\d+.\d+" , str(waitForObject(':About Qt Creator.Label' ).text))
+ try:
+ ver = chk.group(0).strip()
+ return ver
+ except:
+ test.fail("Failed to get the exact version from Dialog")
+ return ""
+
+def getQtCreatorVersionFromFile():
+ qtCreatorPriFileName = "../../../../qtcreator.pri"
+ # open file <qtCreatorPriFileName> and read version
+ fileText = open(qtCreatorPriFileName, "r").read()
+ chk = re.search("(?<=QTCREATOR_VERSION =)\s\d+.\d+.\d+", fileText)
+ try:
+ ver = chk.group(0).strip()
+ return ver
+ except:
+ test.fail("Failed to get the exact version from File")
+ return ""
+
+def main():
+ expectedVersion = getQtCreatorVersionFromFile()
+ if not expectedVersion:
+ test.fatal("Can't find version from file.")
+ return
+ startApplication("qtcreator" + SettingsPath)
+ if platform.system() == "Darwin":
+ invokeMenuItem("Help", "About Qt Creator")
+ else:
+ invokeMenuItem("Help", "About Qt Creator...")
+ # verify qt creator version
+ waitForObject(":About Qt Creator_Core::Internal::VersionDialog")
+ actualVersion = getQtCreatorVersionFromDialog()
+ test.verify(actualVersion == expectedVersion,
+ "Verifying if version is good. Current version is: " + actualVersion + ", expected version is: " + expectedVersion)
+ # close and verify about dialog closed
+ clickButton(waitForObject(":About Qt Creator.Close_QPushButton"))
+ test.verify(checkIfObjectExists(":About Qt Creator_Core::Internal::VersionDialog", False),
+ "Verifying if About dialog closed.")
+ # exit qt creator
+ invokeMenuItem("File", "Exit")
+ # verify if qt creator closed properly
+ test.verify(checkIfObjectExists(":Qt Creator_Core::Internal::MainWindow", False),
+ "Verifying if Qt Creator closed.")
+# no cleanup needed
diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py
new file mode 100755
index 0000000000..c75cc069b2
--- /dev/null
+++ b/tests/system/suite_HELP/tst_HELP04/test.py
@@ -0,0 +1,116 @@
+source("../../shared/qtcreator.py")
+source("../../shared/suites_qtta.py")
+import re
+
+# test search in help mode and advanced search
+searchKeywordDictionary={ "deployment":True, "deplmint":False, "build":True, "bld":False }
+
+def __getSelectedText__():
+ try:
+ selText = findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText
+ if className(selText) != 'instancemethod':
+ return str(selText)
+ except:
+ pass
+ try:
+ hv = findObject(":Qt Creator_Help::Internal::HelpViewer")
+ selText = getHighlightsInHtml(str(hv.toHtml()))
+ except:
+ test.warning("Could not get highlighted text.")
+ selText = ''
+ return str(selText)
+
+def __handleTextChanged__(obj):
+ global textHasChanged
+ textHasChanged = True
+
+def getHighlightsInHtml(htmlCode):
+ pattern = re.compile('color:#ff0000;">(.*?)</span>')
+ res = ""
+ for curr in pattern.finditer(htmlCode):
+ if curr.group(1) in res:
+ continue
+ res += "%s " % curr.group(1)
+ test.log(res)
+ return res
+
+# wait for indexing progress bar to appear and disappear
+def progressBarWait():
+ checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", True, 2000)
+ checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, 60000)
+
+def main():
+ global textHasChanged
+ noMatch = "Your search did not match any documents."
+ startApplication("qtcreator" + SettingsPath)
+ installLazySignalHandler(":Qt Creator_Help::Internal::HelpViewer", "textChanged()", "__handleTextChanged__")
+ addHelpDocumentationFromSDK()
+ # switch to help mode
+ switchViewTo(ViewConstants.HELP)
+ # verify that search widget is accessible
+ mouseClick(waitForObjectItem(":Qt Creator_Core::Internal::CommandComboBox_2", "Search"))
+ test.verify(checkIfObjectExists(":Qt Creator_QHelpSearchQueryWidget"),
+ "Verifying search widget visibility.")
+ # try to search empty string
+ clickButton(waitForObject(":Qt Creator.Search_QPushButton"))
+ progressBarWait()
+ test.verify(waitFor("noMatch in "
+ "str(waitForObject(':Hits_QCLuceneResultWidget').plainText)", 2000),
+ "Verifying if search did not match anything.")
+ # workaround for "endless waiting cursor"
+ mouseClick(waitForObject(":Qt Reference Documentation_QModelIndex"))
+ # try to search keyword from list
+ for searchKeyword,shouldFind in searchKeywordDictionary.items():
+ mouseClick(waitForObject(":Qt Creator.Search for:_QLineEdit"))
+ replaceEditorContent(":Qt Creator.Search for:_QLineEdit", searchKeyword)
+ type(waitForObject(":Qt Creator.Search for:_QLineEdit"), "<Return>")
+ progressBarWait()
+ if shouldFind:
+ test.verify(waitFor("re.match('[1-9]\d* - [1-9]\d* of [1-9]\d* Hits',"
+ "str(findObject(':Hits_QLabel').text))", 2000),
+ "Verifying if search results found with 1+ hits for: " + searchKeyword)
+ textHasChanged = False
+ selText = __getSelectedText__()
+ # click in the widget, tab to first item and press enter
+ mouseClick(waitForObject(":Hits_QCLuceneResultWidget"), 1, 1, 0, Qt.LeftButton)
+ type(waitForObject(":Hits_QCLuceneResultWidget"), "<Tab>")
+ type(waitForObject(":Hits_QCLuceneResultWidget"), "<Return>")
+ waitFor("textHasChanged or selText != __getSelectedText__()")
+ # verify if search keyword is found in results
+ test.verify(searchKeyword.lower() in __getSelectedText__().lower(),
+ searchKeyword + " search result can be found")
+ else:
+ test.verify(waitFor("noMatch in "
+ "str(waitForObject(':Hits_QCLuceneResultWidget').plainText)", 1000),
+ "Verifying if search did not match anything for: " + searchKeyword)
+ # advanced search - setup
+ clickButton(waitForObject(":Qt Creator.+_QToolButton"))
+ type(waitForObject(":Qt Creator.words similar to:_QLineEdit"), "deploy")
+ type(waitForObject(":Qt Creator.without the words:_QLineEdit"), "bookmark")
+ type(waitForObject(":Qt Creator.with exact phrase:_QLineEdit"), "sql in qt")
+ type(waitForObject(":Qt Creator.with all of the words:_QLineEdit"), "designer sql")
+ type(waitForObject(":Qt Creator.with at least one of the words:_QLineEdit"), "printing")
+ # advanced search - do search
+ clickButton(waitForObject(":Qt Creator.Search_QPushButton"))
+ progressBarWait()
+ # verify that advanced search results found
+ test.verify(waitFor("re.search('1 - 2 of 2 Hits',"
+ "str(findObject(':Hits_QLabel').text))", 3000),
+ "Verifying if 2 search results found")
+ resultsView = waitForObject(":Hits_QCLuceneResultWidget")
+ mouseClick(resultsView, 1, 1, 0, Qt.LeftButton)
+ type(resultsView, "<Tab>")
+ type(resultsView, "<Return>")
+ test.verify("printing" in str(findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText).lower(),
+ "printing advanced search result can be found")
+ for i in range(2):
+ type(resultsView, "<Tab>")
+ type(resultsView, "<Return>")
+ test.verify("sql" in str(findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText).lower(),
+ "sql advanced search result can be found")
+ # verify if simple search is properly disabled
+ test.verify(findObject(":Qt Creator.Search for:_QLineEdit").enabled == False,
+ "Verifying if simple search is not active in advanced mode.")
+ # exit
+ invokeMenuItem("File", "Exit")
+# no cleanup needed
diff --git a/tests/system/suite_HELP/tst_HELP05/test.py b/tests/system/suite_HELP/tst_HELP05/test.py
new file mode 100755
index 0000000000..c0a675e498
--- /dev/null
+++ b/tests/system/suite_HELP/tst_HELP05/test.py
@@ -0,0 +1,34 @@
+source("../../shared/qtcreator.py")
+source("../../shared/suites_qtta.py")
+
+# test context sensitive help in edit mode
+# place cursor to <lineText> keyword, in <editorArea>, and verify help to contain <helpText>
+def verifyInteractiveQMLHelp(lineText, helpText):
+ editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
+ # go to the specified word
+ placeCursorToLine(editorArea, lineText)
+ homeKey = "<Home>"
+ if platform.system() == "Darwin":
+ homeKey = "<Ctrl+Left>"
+ type(editorArea, homeKey)
+ else:
+ type(editorArea, homeKey)
+ # call help
+ type(editorArea, "<F1>")
+ test.verify(helpText in str(waitForObject(":Qt Creator_Help::Internal::HelpViewer").title),
+ "Verifying if help is opened with documentation for '%s'." % helpText)
+
+def main():
+ startApplication("qtcreator" + SettingsPath)
+ addHelpDocumentationFromSDK()
+ # create qt quick application
+ createNewQtQuickApplication(tempDir(), "SampleApp")
+ # verify Rectangle help
+ verifyInteractiveQMLHelp("Rectangle {", "QML Rectangle Element")
+ # go back to edit mode
+ switchViewTo(ViewConstants.EDIT)
+ # verify MouseArea help
+ verifyInteractiveQMLHelp("MouseArea {", "QML MouseArea Element")
+ # exit
+ invokeMenuItem("File","Exit")
+# no cleanup needed
diff --git a/tests/system/suite_HELP/tst_HELP06/test.py b/tests/system/suite_HELP/tst_HELP06/test.py
new file mode 100755
index 0000000000..feee1342c0
--- /dev/null
+++ b/tests/system/suite_HELP/tst_HELP06/test.py
@@ -0,0 +1,83 @@
+source("../../shared/qtcreator.py")
+source("../../shared/suites_qtta.py")
+
+# test bookmark functionality
+def renameBookmarkFolder(view, item, newName):
+ openItemContextMenu(view, item, 5, 5, 0)
+ activateItem(waitForObjectItem(":Add Bookmark.line_QMenu", "Rename Folder"))
+ replaceEditorContent(waitForObject(":treeView_QExpandingLineEdit"), newName)
+ type(waitForObject(":treeView_QExpandingLineEdit"), "<Return>")
+ return
+
+def main():
+ startApplication("qtcreator" + SettingsPath)
+ # goto help mode and click on topic
+ switchViewTo(ViewConstants.HELP)
+ doubleClick(":Qt Creator Manual QModelIndex", 5, 5, 0, Qt.LeftButton)
+ doubleClick(":Qt Creator Manual*.Getting Started_QModelIndex", 5, 5, 0, Qt.LeftButton)
+ mouseClick(waitForObject(":Getting Started.Building and Running an Example_QModelIndex"), 5, 5, 0, Qt.LeftButton)
+ # open bookmarks window
+ clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton"))
+ clickButton(waitForObject(":Add Bookmark.+_QToolButton"))
+ # create root bookmark directory
+ clickButton(waitForObject(":Add Bookmark.New Folder_QPushButton"))
+ # rename root bookmark directory
+ bookmarkView = waitForObject(":Add Bookmark.treeView_QTreeView")
+ renameBookmarkFolder(bookmarkView, "New Folder*", "Sample")
+ # create two more subfolders
+ clickButton(waitForObject(":Add Bookmark.New Folder_QPushButton"))
+ renameBookmarkFolder(bookmarkView, "Sample.New Folder*", "Folder 1")
+ clickButton(waitForObject(":Add Bookmark.New Folder_QPushButton"))
+ renameBookmarkFolder(bookmarkView, "Sample.Folder 1.New Folder*", "Folder 2")
+ clickButton(waitForObject(":Add Bookmark.OK_QPushButton"))
+ mouseClick(":Qt Creator Manual QModelIndex", 5, 5, 0, Qt.LeftButton)
+ type(waitForObject(":Qt Creator_QHelpContentWidget"), "<Down>")
+ clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton"))
+ clickButton(waitForObject(":Add Bookmark.+_QToolButton"))
+ # click on "Sample" and create new directory under it
+ mouseClick(waitForObject(":treeView.Sample_QModelIndex"))
+ clickButton(waitForObject(":Add Bookmark.New Folder_QPushButton"))
+ clickButton(waitForObject(":Add Bookmark.OK_QPushButton"))
+ # choose bookmarks
+ mouseClick(waitForObjectItem(":Qt Creator_Core::Internal::CommandComboBox", "Bookmarks"))
+ # verify if all folders are created and bookmarks present
+ test.verify(checkIfObjectExists(":Sample_QModelIndex", verboseOnFail = True) and
+ checkIfObjectExists(":Sample.Folder 1_QModelIndex", verboseOnFail = True) and
+ checkIfObjectExists(":Folder 1.Folder 2_QModelIndex", verboseOnFail = True) and
+ checkIfObjectExists(":Folder 2.Qt Creator : Building and Running an Example_QModelIndex", verboseOnFail = True) and
+ checkIfObjectExists(":New Folder.Qt Creator : Qt Creator Manual_QModelIndex", verboseOnFail = True),
+ "Verifying if all folders and bookmarks are present")
+ mouseClick(waitForObject(":Qt Creator_TreeView"), 5, 5, 0, Qt.LeftButton)
+ for i in range(6):
+ type(waitForObject(":Qt Creator_TreeView"), "<Right>")
+ type(waitForObject(":Qt Creator_TreeView"), "<Return>")
+ test.verify("Qt Creator : Building and Running an Example" in str(waitForObject(":Qt Creator_Help::Internal::HelpViewer").title),
+ "Verifying if first bookmark is opened")
+ mouseClick(waitForObject(":Folder 2.Qt Creator : Building and Running an Example_QModelIndex"))
+ type(waitForObject(":Qt Creator_TreeView"), "<Down>")
+ type(waitForObject(":Qt Creator_TreeView"), "<Right>")
+ type(waitForObject(":Qt Creator_TreeView"), "<Down>")
+ type(waitForObject(":Qt Creator_TreeView"), "<Return>")
+ test.verify("Qt Creator : Qt Creator Manual" in str(waitForObject(":Qt Creator_Help::Internal::HelpViewer").title),
+ "Verifying if second bookmark is opened")
+ # delete previously created directory
+ clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton"))
+ clickButton(waitForObject(":Add Bookmark.+_QToolButton"))
+ openItemContextMenu(waitForObject(":Add Bookmark.treeView_QTreeView"), "Sample.Folder 1", 5, 5, 0)
+ activateItem(waitForObjectItem(":Add Bookmark.line_QMenu", "Delete Folder"))
+ clickButton(waitForObject(":treeView.Yes_QPushButton"))
+ # close bookmarks
+ clickButton(waitForObject(":Add Bookmark.OK_QPushButton"))
+ # choose bookmarks from command combobox (left top corner of qt creator)
+ mouseClick(waitForObject(":Qt Creator_Core::Internal::CommandComboBox"))
+ mouseClick(waitForObjectItem(":Qt Creator_Core::Internal::CommandComboBox", "Bookmarks"))
+ # verify if folders and bookmark deleted
+ test.verify(checkIfObjectExists(":Sample_QModelIndex", verboseOnFail = True) and
+ checkIfObjectExists(":Sample.Folder 1_QModelIndex ", shouldExist = False, verboseOnFail = True) and
+ checkIfObjectExists(":Folder 1.Folder 2_QModelIndex", shouldExist = False, verboseOnFail = True) and
+ checkIfObjectExists(":Folder 2.Qt Creator : Building and Running an Example_QModelIndex", shouldExist = False, verboseOnFail = True) and
+ checkIfObjectExists(":New Folder.Qt Creator : Qt Creator Manual_QModelIndex", verboseOnFail = True),
+ "Verifying if folder 1 and folder 2 deleted including their bookmark")
+ # exit
+ invokeMenuItem("File", "Exit")
+# no cleanup needed