forked from qt-creator/qt-creator
Squish: Clean up single (left) mouse clicks on items or objects
Do no more use pixels as offset if we can handle this without. Clicking on items by using an (x, y) offset will likely fail if running on a machine with a different DPI setting. Change-Id: I0e5a4985104bd1d68aadf8c5534583fa1b048edb Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
@@ -53,8 +53,7 @@ def startCreatorVerifyingClang(useClang):
|
|||||||
|
|
||||||
def __openCodeModelOptions__():
|
def __openCodeModelOptions__():
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "C++")
|
mouseClick(waitForObjectItem(":Options_QListView", "C++"))
|
||||||
clickItem(":Options_QListView", "C++", 14, 15, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Code Model")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Code Model")
|
||||||
|
|
||||||
def getCodeModelString(useClang):
|
def getCodeModelString(useClang):
|
||||||
|
@@ -55,7 +55,7 @@ def takeDebuggerLog():
|
|||||||
debuggerLogWindow = waitForObject("{container=':DebugModeWidget.Debugger Log_QDockWidget' "
|
debuggerLogWindow = waitForObject("{container=':DebugModeWidget.Debugger Log_QDockWidget' "
|
||||||
"type='Debugger::Internal::DebuggerPane' unnamed='1' visible='1'}")
|
"type='Debugger::Internal::DebuggerPane' unnamed='1' visible='1'}")
|
||||||
debuggerLog = str(debuggerLogWindow.plainText)
|
debuggerLog = str(debuggerLogWindow.plainText)
|
||||||
mouseClick(debuggerLogWindow, 5, 5, 0, Qt.LeftButton)
|
mouseClick(debuggerLogWindow)
|
||||||
invokeContextMenuItem(debuggerLogWindow, "Clear Contents")
|
invokeContextMenuItem(debuggerLogWindow, "Clear Contents")
|
||||||
waitFor("str(debuggerLogWindow.plainText)==''", 5000)
|
waitFor("str(debuggerLogWindow.plainText)==''", 5000)
|
||||||
invokeMenuItem("Window", "Views", "Global Debugger Log")
|
invokeMenuItem("Window", "Views", "Global Debugger Log")
|
||||||
|
@@ -88,11 +88,11 @@ def __createProjectOrFileSelectType__(category, template, fromWelcome = False, i
|
|||||||
invokeMenuItem("File", "New File or Project...")
|
invokeMenuItem("File", "New File or Project...")
|
||||||
categoriesView = waitForObject(":New.templateCategoryView_QTreeView")
|
categoriesView = waitForObject(":New.templateCategoryView_QTreeView")
|
||||||
if isProject:
|
if isProject:
|
||||||
clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(categoriesView, "Projects." + category))
|
||||||
else:
|
else:
|
||||||
clickItem(categoriesView, "Files and Classes." + category, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(categoriesView, "Files and Classes." + category))
|
||||||
templatesView = waitForObject("{name='templatesView' type='QListView'}")
|
templatesView = waitForObject("{name='templatesView' type='QListView'}")
|
||||||
clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(templatesView, template))
|
||||||
text = waitForObject("{type='QTextBrowser' name='templateDescription' visible='1'}").plainText
|
text = waitForObject("{type='QTextBrowser' name='templateDescription' visible='1'}").plainText
|
||||||
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}"))
|
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}"))
|
||||||
return __getSupportedPlatforms__(str(text), template)[0]
|
return __getSupportedPlatforms__(str(text), template)[0]
|
||||||
|
@@ -62,7 +62,7 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
|
|||||||
# change autocomplete options to manual
|
# change autocomplete options to manual
|
||||||
def changeAutocompleteToManual(toManual=True):
|
def changeAutocompleteToManual(toManual=True):
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"))
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion")
|
||||||
ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), not toManual)
|
ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), not toManual)
|
||||||
activateCompletion = "Always"
|
activateCompletion = "Always"
|
||||||
|
@@ -65,7 +65,7 @@ def ensureChecked(objectName, shouldBeChecked = True, timeout=20000):
|
|||||||
except:
|
except:
|
||||||
# widgets not derived from QCheckbox don't have checkState()
|
# widgets not derived from QCheckbox don't have checkState()
|
||||||
if not waitFor('widget.checked == shouldBeChecked', 1500):
|
if not waitFor('widget.checked == shouldBeChecked', 1500):
|
||||||
mouseClick(widget, 10, 6, 0, Qt.LeftButton)
|
mouseClick(widget)
|
||||||
test.verify(waitFor("widget.checked == shouldBeChecked", 1000))
|
test.verify(waitFor("widget.checked == shouldBeChecked", 1000))
|
||||||
test.log("New state for QCheckBox: %s" % state,
|
test.log("New state for QCheckBox: %s" % state,
|
||||||
str(objectName))
|
str(objectName))
|
||||||
@@ -97,9 +97,9 @@ def selectFromCombo(objectSpec, itemName):
|
|||||||
if itemName == str(object.currentText):
|
if itemName == str(object.currentText):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
mouseClick(object, 5, 5, 0, Qt.LeftButton)
|
mouseClick(object)
|
||||||
snooze(1)
|
snooze(1)
|
||||||
mouseClick(waitForObjectItem(object, itemName.replace(".", "\\.")), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(object, itemName.replace(".", "\\.")))
|
||||||
test.verify(waitFor("str(object.currentText)==itemName", 5000),
|
test.verify(waitFor("str(object.currentText)==itemName", 5000),
|
||||||
"Switched combo item to '%s'" % itemName)
|
"Switched combo item to '%s'" % itemName)
|
||||||
return True
|
return True
|
||||||
@@ -277,8 +277,7 @@ def selectFromFileDialog(fileName, waitForFile=False, ignoreFinalSnooze=False):
|
|||||||
# param which a list/tuple of the paths to the qch files to be added
|
# param which a list/tuple of the paths to the qch files to be added
|
||||||
def addHelpDocumentation(which):
|
def addHelpDocumentation(which):
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Help")
|
mouseClick(waitForObjectItem(":Options_QListView", "Help"))
|
||||||
clickItem(":Options_QListView", "Help", 14, 15, 0, Qt.LeftButton)
|
|
||||||
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' text='Documentation'}")
|
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' text='Documentation'}")
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Documentation")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Documentation")
|
||||||
# get rid of all docs already registered
|
# get rid of all docs already registered
|
||||||
@@ -304,8 +303,7 @@ def addCurrentCreatorDocumentation():
|
|||||||
test.fatal("Missing current Qt Creator documentation (expected in %s)" % docPath)
|
test.fatal("Missing current Qt Creator documentation (expected in %s)" % docPath)
|
||||||
return
|
return
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Help")
|
mouseClick(waitForObjectItem(":Options_QListView", "Help"))
|
||||||
clickItem(":Options_QListView", "Help", 14, 15, 0, Qt.LeftButton)
|
|
||||||
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' text='Documentation'}")
|
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' text='Documentation'}")
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Documentation")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Documentation")
|
||||||
clickButton(waitForObject("{type='QPushButton' name='addButton' visible='1' text='Add...'}"))
|
clickButton(waitForObject("{type='QPushButton' name='addButton' visible='1' text='Add...'}"))
|
||||||
@@ -361,8 +359,7 @@ def getConfiguredKits():
|
|||||||
return str(treeView.currentIndex().data().toString())
|
return str(treeView.currentIndex().data().toString())
|
||||||
# end of internal function for iterateQtVersions
|
# end of internal function for iterateQtVersions
|
||||||
def __setQtVersionForKit__(kit, kitName, kitsQtVersionName):
|
def __setQtVersionForKit__(kit, kitName, kitsQtVersionName):
|
||||||
treeView = waitForObject(":BuildAndRun_QTreeView")
|
mouseClick(waitForObjectItem(":BuildAndRun_QTreeView", kit))
|
||||||
clickItem(treeView, kit, 5, 5, 0, Qt.LeftButton)
|
|
||||||
qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText)
|
qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText)
|
||||||
kitsQtVersionName[kitName] = qtVersionStr
|
kitsQtVersionName[kitName] = qtVersionStr
|
||||||
# end of internal function for iterate kits
|
# end of internal function for iterate kits
|
||||||
@@ -433,8 +430,7 @@ def iterateQtVersions(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
|
|||||||
additionalResult = []
|
additionalResult = []
|
||||||
if not alreadyOnOptionsDialog:
|
if not alreadyOnOptionsDialog:
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Kits")
|
mouseClick(waitForObjectItem(":Options_QListView", "Kits"))
|
||||||
clickItem(":Options_QListView", "Kits", 14, 15, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions")
|
||||||
pattern = re.compile("Qt version (?P<version>.*?) for (?P<target>.*)")
|
pattern = re.compile("Qt version (?P<version>.*?) for (?P<target>.*)")
|
||||||
treeView = waitForObject(":qtdirList_QTreeView")
|
treeView = waitForObject(":qtdirList_QTreeView")
|
||||||
@@ -443,7 +439,7 @@ def iterateQtVersions(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
|
|||||||
rootChildText = str(rootIndex.data()).replace(".", "\\.").replace("_", "\\_")
|
rootChildText = str(rootIndex.data()).replace(".", "\\.").replace("_", "\\_")
|
||||||
for subIndex in dumpIndices(model, rootIndex):
|
for subIndex in dumpIndices(model, rootIndex):
|
||||||
subChildText = str(subIndex.data()).replace(".", "\\.").replace("_", "\\_")
|
subChildText = str(subIndex.data()).replace(".", "\\.").replace("_", "\\_")
|
||||||
clickItem(treeView, ".".join([rootChildText,subChildText]), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(treeView, ".".join([rootChildText,subChildText])))
|
||||||
currentText = str(waitForObject(":QtSupport__Internal__QtVersionManager.QLabel").text)
|
currentText = str(waitForObject(":QtSupport__Internal__QtVersionManager.QLabel").text)
|
||||||
matches = pattern.match(currentText)
|
matches = pattern.match(currentText)
|
||||||
if matches:
|
if matches:
|
||||||
@@ -493,8 +489,7 @@ def iterateKits(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
|
|||||||
additionalResult = []
|
additionalResult = []
|
||||||
if not alreadyOnOptionsDialog:
|
if not alreadyOnOptionsDialog:
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Build & Run")
|
mouseClick(waitForObjectItem(":Options_QListView", "Kits"))
|
||||||
clickItem(":Options_QListView", "Kits", 14, 15, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
|
||||||
treeView = waitForObject(":BuildAndRun_QTreeView")
|
treeView = waitForObject(":BuildAndRun_QTreeView")
|
||||||
model = treeView.model()
|
model = treeView.model()
|
||||||
@@ -539,8 +534,7 @@ class HelpViewer:
|
|||||||
|
|
||||||
def setFixedHelpViewer(helpViewer):
|
def setFixedHelpViewer(helpViewer):
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Help")
|
mouseClick(waitForObjectItem(":Options_QListView", "Help"))
|
||||||
clickItem(":Options_QListView", "Help", 5, 5, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
|
||||||
mode = "Always Show "
|
mode = "Always Show "
|
||||||
if helpViewer == HelpViewer.HELPMODE:
|
if helpViewer == HelpViewer.HELPMODE:
|
||||||
|
@@ -29,7 +29,7 @@ def handleInsertVirtualFunctions(expected, toAdd):
|
|||||||
def __checkVirtualFunction(treeView, classIndex, isCheckedF, child):
|
def __checkVirtualFunction(treeView, classIndex, isCheckedF, child):
|
||||||
item = "%s.%s" % (str(classIndex.text), str(child.text))
|
item = "%s.%s" % (str(classIndex.text), str(child.text))
|
||||||
test.log("Checking '%s'." % item)
|
test.log("Checking '%s'." % item)
|
||||||
clickItem(treeView, item.replace("_", "\\_"), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(treeView, item.replace("_", "\\_")))
|
||||||
test.verify(waitFor("isCheckedF(child)", 1000), "Function must be checked after clicking")
|
test.verify(waitFor("isCheckedF(child)", 1000), "Function must be checked after clicking")
|
||||||
|
|
||||||
treeView = waitForObject("{container={title='Functions to insert:' type='QGroupBox' unnamed='1'"
|
treeView = waitForObject("{container={title='Functions to insert:' type='QGroupBox' unnamed='1'"
|
||||||
|
@@ -52,7 +52,7 @@ def main():
|
|||||||
# Steps 3&4: Insert text "class" to new line in Editor mode and press Ctrl+Space.
|
# Steps 3&4: Insert text "class" to new line in Editor mode and press Ctrl+Space.
|
||||||
# Focus "class derived from QObject" in the list and press Tab or Enter to complete the code.
|
# Focus "class derived from QObject" in the list and press Tab or Enter to complete the code.
|
||||||
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||||
mouseClick(editorWidget, 5, 5, 0, Qt.LeftButton)
|
mouseClick(editorWidget)
|
||||||
jumpToFirstLine(editorWidget)
|
jumpToFirstLine(editorWidget)
|
||||||
type(editorWidget, "<Return>")
|
type(editorWidget, "<Return>")
|
||||||
type(editorWidget, "<Up>")
|
type(editorWidget, "<Up>")
|
||||||
|
@@ -69,7 +69,7 @@ def main():
|
|||||||
replaceEditorContent(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), "find")
|
replaceEditorContent(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), "find")
|
||||||
oldCodeText = str(editorWidget.plainText)
|
oldCodeText = str(editorWidget.plainText)
|
||||||
clickButton(waitForObject(":Qt Creator.Replace All_QToolButton"))
|
clickButton(waitForObject(":Qt Creator.Replace All_QToolButton"))
|
||||||
mouseClick(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObject(":Qt Creator.replaceEdit_Utils::FilterLineEdit"))
|
||||||
newCodeText = str(editorWidget.plainText)
|
newCodeText = str(editorWidget.plainText)
|
||||||
test.compare(newCodeText, oldCodeText.replace("window", "find").replace("Window", "find"),
|
test.compare(newCodeText, oldCodeText.replace("window", "find").replace("Window", "find"),
|
||||||
"Verifying if: Found text is replaced with new word properly.")
|
"Verifying if: Found text is replaced with new word properly.")
|
||||||
|
@@ -68,8 +68,7 @@ def checkQtCreatorHelpVersion(expectedVersion):
|
|||||||
|
|
||||||
def setKeyboardShortcutForAboutQtC():
|
def setKeyboardShortcutForAboutQtC():
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Environment")
|
mouseClick(waitForObjectItem(":Options_QListView", "Environment"))
|
||||||
clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Keyboard")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Keyboard")
|
||||||
filter = waitForObject("{container={title='Keyboard Shortcuts' type='QGroupBox' unnamed='1' "
|
filter = waitForObject("{container={title='Keyboard Shortcuts' type='QGroupBox' unnamed='1' "
|
||||||
"visible='1'} type='Utils::FancyLineEdit' unnamed='1' visible='1' "
|
"visible='1'} type='Utils::FancyLineEdit' unnamed='1' visible='1' "
|
||||||
@@ -79,7 +78,7 @@ def setKeyboardShortcutForAboutQtC():
|
|||||||
modelIndex = waitForObject("{column='0' text='AboutQtCreator' type='QModelIndex' "
|
modelIndex = waitForObject("{column='0' text='AboutQtCreator' type='QModelIndex' "
|
||||||
"container={column='0' text='QtCreator' type='QModelIndex' "
|
"container={column='0' text='QtCreator' type='QModelIndex' "
|
||||||
"container=%s}}" % objectMap.realName(treewidget))
|
"container=%s}}" % objectMap.realName(treewidget))
|
||||||
mouseClick(modelIndex, 5, 5, 0, Qt.LeftButton)
|
mouseClick(modelIndex)
|
||||||
shortcutGB = "{title='Shortcut' type='QGroupBox' unnamed='1' visible='1'}"
|
shortcutGB = "{title='Shortcut' type='QGroupBox' unnamed='1' visible='1'}"
|
||||||
record = waitForObject("{container=%s type='Core::Internal::ShortcutButton' unnamed='1' "
|
record = waitForObject("{container=%s type='Core::Internal::ShortcutButton' unnamed='1' "
|
||||||
"visible='1' text~='(Stop Recording|Record)'}" % shortcutGB)
|
"visible='1' text~='(Stop Recording|Record)'}" % shortcutGB)
|
||||||
|
@@ -34,7 +34,7 @@ def renameBookmarkFolder(view, item, newName):
|
|||||||
|
|
||||||
def invokeContextMenuItemOnBookmarkFolder(view, item, menuItem):
|
def invokeContextMenuItemOnBookmarkFolder(view, item, menuItem):
|
||||||
aboveWidget = "{name='line' type='QFrame' visible='1' window=':Add Bookmark_BookmarkDialog'}"
|
aboveWidget = "{name='line' type='QFrame' visible='1' window=':Add Bookmark_BookmarkDialog'}"
|
||||||
mouseClick(waitForObjectItem(view, item), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(view, item))
|
||||||
openItemContextMenu(view, item, 5, 5, 0)
|
openItemContextMenu(view, item, 5, 5, 0)
|
||||||
activateItem(waitForObject("{aboveWidget=%s type='QMenu' unnamed='1' visible='1' "
|
activateItem(waitForObject("{aboveWidget=%s type='QMenu' unnamed='1' visible='1' "
|
||||||
"window=':Add Bookmark_BookmarkDialog'}" % aboveWidget), menuItem)
|
"window=':Add Bookmark_BookmarkDialog'}" % aboveWidget), menuItem)
|
||||||
@@ -81,7 +81,7 @@ def main():
|
|||||||
clickButton(waitForObject(":Add Bookmark.New Folder_QPushButton"))
|
clickButton(waitForObject(":Add Bookmark.New Folder_QPushButton"))
|
||||||
renameBookmarkFolder(bookmarkView, "Sample.Folder 1.New Folder*", "Folder 2")
|
renameBookmarkFolder(bookmarkView, "Sample.Folder 1.New Folder*", "Folder 2")
|
||||||
clickButton(waitForObject(":Add Bookmark.OK_QPushButton"))
|
clickButton(waitForObject(":Add Bookmark.OK_QPushButton"))
|
||||||
mouseClick(manualQModelIndex, 5, 5, 0, Qt.LeftButton)
|
mouseClick(manualQModelIndex)
|
||||||
type(waitForObject(":Qt Creator_QHelpContentWidget"), "<Down>")
|
type(waitForObject(":Qt Creator_QHelpContentWidget"), "<Down>")
|
||||||
clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton"))
|
clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton"))
|
||||||
clickButton(waitForObject(":Add Bookmark.ExpandBookmarksList_QToolButton"))
|
clickButton(waitForObject(":Add Bookmark.ExpandBookmarksList_QToolButton"))
|
||||||
@@ -106,7 +106,7 @@ def main():
|
|||||||
checkIfObjectExists(bldRunQModelIndex, verboseOnFail = True) and
|
checkIfObjectExists(bldRunQModelIndex, verboseOnFail = True) and
|
||||||
checkIfObjectExists(manualQModelIndex, verboseOnFail = True),
|
checkIfObjectExists(manualQModelIndex, verboseOnFail = True),
|
||||||
"Verifying if all folders and bookmarks are present")
|
"Verifying if all folders and bookmarks are present")
|
||||||
mouseClick(waitForObject(":Qt Creator_Bookmarks_TreeView"), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObject(":Qt Creator_Bookmarks_TreeView"))
|
||||||
for _ in range(6):
|
for _ in range(6):
|
||||||
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Right>")
|
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Right>")
|
||||||
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Return>")
|
type(waitForObject(":Qt Creator_Bookmarks_TreeView"), "<Return>")
|
||||||
|
@@ -103,7 +103,7 @@ def main():
|
|||||||
"Verifying if usages were properly found using context menu.")
|
"Verifying if usages were properly found using context menu.")
|
||||||
# clear previous results & prepare for next search
|
# clear previous results & prepare for next search
|
||||||
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
|
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
|
||||||
mouseClick(editorArea, 5, 5, 0, Qt.LeftButton)
|
mouseClick(editorArea)
|
||||||
# 2. check usages using menu
|
# 2. check usages using menu
|
||||||
# place cursor to component
|
# place cursor to component
|
||||||
if not placeCursorToLine(editorArea, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"):
|
if not placeCursorToLine(editorArea, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"):
|
||||||
@@ -122,7 +122,7 @@ def main():
|
|||||||
"Verifying if usages were properly found using main menu.")
|
"Verifying if usages were properly found using main menu.")
|
||||||
# clear previous results & prepare for next search
|
# clear previous results & prepare for next search
|
||||||
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
|
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
|
||||||
mouseClick(editorArea, 5, 5, 0, Qt.LeftButton)
|
mouseClick(editorArea)
|
||||||
# 3. check usages using keyboard shortcut
|
# 3. check usages using keyboard shortcut
|
||||||
# place cursor to component
|
# place cursor to component
|
||||||
if not placeCursorToLine(editorArea, "SequentialAnimation on opacity {"):
|
if not placeCursorToLine(editorArea, "SequentialAnimation on opacity {"):
|
||||||
|
@@ -28,7 +28,7 @@ source("../../shared/qtcreator.py")
|
|||||||
def typeToDebuggerConsole(expression):
|
def typeToDebuggerConsole(expression):
|
||||||
editableIndex = getQModelIndexStr("text=''",
|
editableIndex = getQModelIndexStr("text=''",
|
||||||
":DebugModeWidget_Debugger::Internal::ConsoleView")
|
":DebugModeWidget_Debugger::Internal::ConsoleView")
|
||||||
mouseClick(editableIndex, 5, 5, 0, Qt.LeftButton)
|
mouseClick(editableIndex)
|
||||||
type(waitForObject(":Debugger::Internal::ConsoleEdit"), expression)
|
type(waitForObject(":Debugger::Internal::ConsoleEdit"), expression)
|
||||||
type(waitForObject(":Debugger::Internal::ConsoleEdit"), "<Return>")
|
type(waitForObject(":Debugger::Internal::ConsoleEdit"), "<Return>")
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ def getQmlJSConsoleOutput():
|
|||||||
return [""]
|
return [""]
|
||||||
|
|
||||||
def runChecks(elementProps, parent, checks):
|
def runChecks(elementProps, parent, checks):
|
||||||
mouseClick(getQModelIndexStr(elementProps, parent), 5, 5, 0, Qt.LeftButton)
|
mouseClick(getQModelIndexStr(elementProps, parent))
|
||||||
for check in checks:
|
for check in checks:
|
||||||
useDebuggerConsole(*check)
|
useDebuggerConsole(*check)
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ def modifyExternally(filePath):
|
|||||||
def switchOpenDocsTo(filename):
|
def switchOpenDocsTo(filename):
|
||||||
selectFromCombo(":Qt Creator_Core::Internal::NavComboBox", "Open Documents")
|
selectFromCombo(":Qt Creator_Core::Internal::NavComboBox", "Open Documents")
|
||||||
docs = waitForObject(":OpenDocuments_Widget")
|
docs = waitForObject(":OpenDocuments_Widget")
|
||||||
clickItem(docs, filename.replace(".", "\\.").replace("_", "\\_"), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(docs, filename.replace(".", "\\.").replace("_", "\\_")))
|
||||||
return getEditorForFileSuffix(filename)
|
return getEditorForFileSuffix(filename)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@@ -45,7 +45,7 @@ def createFile(folder, filename):
|
|||||||
__createProjectHandleLastPage__()
|
__createProjectHandleLastPage__()
|
||||||
|
|
||||||
def clickTableGetPatternLineEdit(table, row):
|
def clickTableGetPatternLineEdit(table, row):
|
||||||
clickItem(table, row, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(table, row))
|
||||||
return waitForObject("{name='patternsLineEdit' type='QLineEdit' visible='1'}")
|
return waitForObject("{name='patternsLineEdit' type='QLineEdit' visible='1'}")
|
||||||
|
|
||||||
def getOrModifyFilePatternsFor(mimeType, filter='', toBePresent=None):
|
def getOrModifyFilePatternsFor(mimeType, filter='', toBePresent=None):
|
||||||
@@ -54,7 +54,7 @@ def getOrModifyFilePatternsFor(mimeType, filter='', toBePresent=None):
|
|||||||
result = []
|
result = []
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Environment")
|
waitForObjectItem(":Options_QListView", "Environment")
|
||||||
clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(":Options_QListView", "Environment"))
|
||||||
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' "
|
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' "
|
||||||
"text='MIME Types'}")
|
"text='MIME Types'}")
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "MIME Types")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "MIME Types")
|
||||||
@@ -118,7 +118,7 @@ def addHighlighterDefinition(*languages):
|
|||||||
test.log("Updating highlighter definitions...")
|
test.log("Updating highlighter definitions...")
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Text Editor")
|
waitForObjectItem(":Options_QListView", "Text Editor")
|
||||||
clickItem(":Options_QListView", "Text Editor", 14, 15, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"))
|
||||||
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' "
|
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' "
|
||||||
"text='Generic Highlighter'}")
|
"text='Generic Highlighter'}")
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Generic Highlighter")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Generic Highlighter")
|
||||||
|
@@ -55,7 +55,7 @@ def main():
|
|||||||
# skip non-configurable
|
# skip non-configurable
|
||||||
if "Import" in category:
|
if "Import" in category:
|
||||||
continue
|
continue
|
||||||
clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(categoriesView, "Projects." + category))
|
||||||
templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}")
|
templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}")
|
||||||
# needed because categoriesView and templatesView using same model
|
# needed because categoriesView and templatesView using same model
|
||||||
for template in dumpItems(templatesView.model(), templatesView.rootIndex()):
|
for template in dumpItems(templatesView.model(), templatesView.rootIndex()):
|
||||||
@@ -147,12 +147,12 @@ def __createProject__(category, template):
|
|||||||
invokeMenuItem("File", "New File or Project...")
|
invokeMenuItem("File", "New File or Project...")
|
||||||
selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates")
|
selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates")
|
||||||
categoriesView = waitForObject(":New.templateCategoryView_QTreeView")
|
categoriesView = waitForObject(":New.templateCategoryView_QTreeView")
|
||||||
clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(categoriesView, "Projects." + category))
|
||||||
templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}")
|
templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}")
|
||||||
|
|
||||||
test.log("Verifying '%s' -> '%s'" % (category.replace("\\.", "."), template.replace("\\.", ".")))
|
test.log("Verifying '%s' -> '%s'" % (category.replace("\\.", "."), template.replace("\\.", ".")))
|
||||||
origTxt = safeGetTextBrowserText()
|
origTxt = safeGetTextBrowserText()
|
||||||
clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(templatesView, template))
|
||||||
waitFor("origTxt != safeGetTextBrowserText() != ''", 2000)
|
waitFor("origTxt != safeGetTextBrowserText() != ''", 2000)
|
||||||
displayedPlatforms = __getSupportedPlatforms__(safeGetTextBrowserText(), template, True)[0]
|
displayedPlatforms = __getSupportedPlatforms__(safeGetTextBrowserText(), template, True)[0]
|
||||||
safeClickButton("Choose...")
|
safeClickButton("Choose...")
|
||||||
|
@@ -50,8 +50,7 @@ def __createMinimumIni__(emptyParent):
|
|||||||
iniFile.close()
|
iniFile.close()
|
||||||
|
|
||||||
def __checkKits__():
|
def __checkKits__():
|
||||||
waitForObjectItem(":Options_QListView", "Kits")
|
mouseClick(waitForObjectItem(":Options_QListView", "Kits"))
|
||||||
clickItem(":Options_QListView", "Kits", 14, 15, 0, Qt.LeftButton)
|
|
||||||
# check compilers
|
# check compilers
|
||||||
expectedCompilers = __getExpectedCompilers__()
|
expectedCompilers = __getExpectedCompilers__()
|
||||||
foundCompilers = []
|
foundCompilers = []
|
||||||
@@ -95,7 +94,7 @@ def __processSubItems__(treeObjStr, section, parModelIndexStr, doneItems,
|
|||||||
itObj = "%s occurrence='%d'}" % (itObj[:-1], alreadyDone + 1)
|
itObj = "%s occurrence='%d'}" % (itObj[:-1], alreadyDone + 1)
|
||||||
currentSelectedTreeItem = waitForObject(itObj, 3000)
|
currentSelectedTreeItem = waitForObject(itObj, 3000)
|
||||||
tree.scrollTo(it)
|
tree.scrollTo(it)
|
||||||
mouseClick(currentSelectedTreeItem, 5, 5, 0, Qt.LeftButton)
|
mouseClick(currentSelectedTreeItem)
|
||||||
additionalFunc(indexName, *additionalParameters)
|
additionalFunc(indexName, *additionalParameters)
|
||||||
currentSelectedTreeItem = None
|
currentSelectedTreeItem = None
|
||||||
if model.rowCount(it) > 0:
|
if model.rowCount(it) > 0:
|
||||||
|
@@ -31,8 +31,7 @@ def main():
|
|||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Environment")
|
mouseClick(waitForObjectItem(":Options_QListView", "Environment"))
|
||||||
clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Interface")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Interface")
|
||||||
languageName = testData.field(lang, "language")
|
languageName = testData.field(lang, "language")
|
||||||
if "%1" in languageName:
|
if "%1" in languageName:
|
||||||
|
@@ -47,8 +47,7 @@ def __removeKit__(kit, kitName):
|
|||||||
# The following kits will be the default kit at that time
|
# The following kits will be the default kit at that time
|
||||||
kitNameTemplate += " (default)"
|
kitNameTemplate += " (default)"
|
||||||
item = kitNameTemplate % kitName.replace(".", "\\.")
|
item = kitNameTemplate % kitName.replace(".", "\\.")
|
||||||
waitForObjectItem(":BuildAndRun_QTreeView", item)
|
mouseClick(waitForObjectItem(":BuildAndRun_QTreeView", item))
|
||||||
clickItem(":BuildAndRun_QTreeView", item, 5, 5, 0, Qt.LeftButton)
|
|
||||||
clickButton(waitForObject(":Remove_QPushButton"))
|
clickButton(waitForObject(":Remove_QPushButton"))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@@ -27,8 +27,7 @@ source("../../shared/qtcreator.py")
|
|||||||
|
|
||||||
def ensureSaveBeforeBuildChecked(shouldBeChecked):
|
def ensureSaveBeforeBuildChecked(shouldBeChecked):
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
waitForObjectItem(":Options_QListView", "Build & Run")
|
mouseClick(waitForObjectItem(":Options_QListView", "Build & Run"))
|
||||||
clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
|
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
|
||||||
if test.compare(waitForObject(":Build and Run.Save all files before build_QCheckBox").checked,
|
if test.compare(waitForObject(":Build and Run.Save all files before build_QCheckBox").checked,
|
||||||
shouldBeChecked, "'Save all files before build' should be %s" % str(shouldBeChecked)):
|
shouldBeChecked, "'Save all files before build' should be %s" % str(shouldBeChecked)):
|
||||||
|
@@ -84,9 +84,9 @@ def prepareTestExamples():
|
|||||||
def switchSession(toSession):
|
def switchSession(toSession):
|
||||||
test.log("Switching to session '%s'" % toSession)
|
test.log("Switching to session '%s'" % toSession)
|
||||||
invokeMenuItem("File", "Sessions", "Manage...")
|
invokeMenuItem("File", "Sessions", "Manage...")
|
||||||
clickItem(waitForObject("{name='sessionView' type='ProjectExplorer::Internal::SessionView' visible='1' "
|
sessionView = ("{name='sessionView' type='ProjectExplorer::Internal::SessionView' visible='1' "
|
||||||
"window=':Session Manager_ProjectExplorer::Internal::SessionDialog'}"),
|
"window=':Session Manager_ProjectExplorer::Internal::SessionDialog'}")
|
||||||
toSession, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(sessionView, toSession))
|
||||||
clickButton(waitForObject("{name='btSwitch' text='Switch to' type='QPushButton' visible='1' "
|
clickButton(waitForObject("{name='btSwitch' text='Switch to' type='QPushButton' visible='1' "
|
||||||
"window=':Session Manager_ProjectExplorer::Internal::SessionDialog'}"))
|
"window=':Session Manager_ProjectExplorer::Internal::SessionDialog'}"))
|
||||||
|
|
||||||
|
@@ -157,8 +157,7 @@ def fetchSnippet(protocol, description, pasteId, skippedPasting):
|
|||||||
replaceEditorContent(waitForObject(":PasteSelectDialog.pasteEdit_QLineEdit"), pasteId)
|
replaceEditorContent(waitForObject(":PasteSelectDialog.pasteEdit_QLineEdit"), pasteId)
|
||||||
if foundSnippet:
|
if foundSnippet:
|
||||||
pasteLine = pasteLine.replace(".", "\\.")
|
pasteLine = pasteLine.replace(".", "\\.")
|
||||||
waitForObjectItem(":PasteSelectDialog.listWidget_QListWidget", pasteLine)
|
mouseClick(waitForObjectItem(":PasteSelectDialog.listWidget_QListWidget", pasteLine))
|
||||||
clickItem(":PasteSelectDialog.listWidget_QListWidget", pasteLine, 5, 5, 0, Qt.LeftButton)
|
|
||||||
clickButton(waitForObject(":PasteSelectDialog.OK_QPushButton"))
|
clickButton(waitForObject(":PasteSelectDialog.OK_QPushButton"))
|
||||||
return pasteId
|
return pasteId
|
||||||
|
|
||||||
|
@@ -135,7 +135,7 @@ def performEditCombo():
|
|||||||
test.compare(dumpItems(itemListWidget.model()), expectedItems,
|
test.compare(dumpItems(itemListWidget.model()), expectedItems,
|
||||||
"Verifying last item has moved to top of the list.")
|
"Verifying last item has moved to top of the list.")
|
||||||
# remove the "Combo Item 1" item from the list
|
# remove the "Combo Item 1" item from the list
|
||||||
clickItem(itemListWidget, "Combo Item 1", 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(itemListWidget, "Combo Item 1"))
|
||||||
clickButton("{name='deleteListItemButton' type='QToolButton' visible='1' window=%s}"
|
clickButton("{name='deleteListItemButton' type='QToolButton' visible='1' window=%s}"
|
||||||
% edComboWin)
|
% edComboWin)
|
||||||
waitFor("itemListWidget.model().rowCount() == len(expectedItems) - 1", 2000)
|
waitFor("itemListWidget.model().rowCount() == len(expectedItems) - 1", 2000)
|
||||||
|
@@ -52,8 +52,7 @@ def main():
|
|||||||
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot..."))
|
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot..."))
|
||||||
signalWidgetObject = waitForObject(":Select signal.signalList_QTreeView")
|
signalWidgetObject = waitForObject(":Select signal.signalList_QTreeView")
|
||||||
signalName = con[1] + "." + con[2]
|
signalName = con[1] + "." + con[2]
|
||||||
waitForObjectItem(signalWidgetObject, signalName)
|
mouseClick(waitForObjectItem(signalWidgetObject, signalName))
|
||||||
clickItem(signalWidgetObject, signalName, 5, 5, 0, Qt.LeftButton)
|
|
||||||
clickButton(waitForObject(":Go to slot.OK_QPushButton"))
|
clickButton(waitForObject(":Go to slot.OK_QPushButton"))
|
||||||
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||||
type(editor, "<Up>")
|
type(editor, "<Up>")
|
||||||
|
@@ -41,7 +41,7 @@ def commit(commitMessage, expectedLogMessage, uncheckUntracked=False):
|
|||||||
model = treeView.model()
|
model = treeView.model()
|
||||||
for indexStr in dumpItems(model):
|
for indexStr in dumpItems(model):
|
||||||
if 'untracked' in indexStr:
|
if 'untracked' in indexStr:
|
||||||
clickItem(treeView, indexStr, 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(treeView, indexStr))
|
||||||
checkOrFixCommitterInformation('invalidAuthorLabel', 'authorLineEdit', 'Nobody')
|
checkOrFixCommitterInformation('invalidAuthorLabel', 'authorLineEdit', 'Nobody')
|
||||||
checkOrFixCommitterInformation('invalidEmailLabel', 'emailLineEdit', 'nobody@nowhere.com')
|
checkOrFixCommitterInformation('invalidEmailLabel', 'emailLineEdit', 'nobody@nowhere.com')
|
||||||
clickButton(waitForObject(":splitter.Commit File(s)_VcsBase::QActionPushButton"))
|
clickButton(waitForObject(":splitter.Commit File(s)_VcsBase::QActionPushButton"))
|
||||||
|
Reference in New Issue
Block a user