Commit c8b478f0 authored by Christian Stenger's avatar Christian Stenger

Squish: Stabilize invoking tab item widgets on Mac

Change-Id: I16a61c1215d64243238a4cfbee007a78c282eb4c
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent be5c2ea3
......@@ -184,7 +184,7 @@ def getQtInformationForQmlProject():
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Build & Run")
clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
targetsTreeView = waitForObject(":Kits_Or_Compilers_QTreeView")
if not __selectTreeItemOnBuildAndRun__(targetsTreeView, "%s(\s\(default\))?" % kit, True):
test.fatal("Found no matching kit - this shouldn't happen.")
......@@ -192,7 +192,7 @@ def getQtInformationForQmlProject():
return None, None, None, None
qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText)
test.log("Kit '%s' uses Qt Version '%s'" % (kit, qtVersionStr))
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Qt Versions")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions")
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
if not __selectTreeItemOnBuildAndRun__(treeWidget, qtVersionStr):
test.fatal("Found no matching Qt Version for kit - this shouldn't happen.")
......
......@@ -66,7 +66,7 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
def changeAutocompleteToManual():
invokeMenuItem("Tools", "Options...")
mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Completion")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion")
ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), False)
selectFromCombo(":Behavior.completionTrigger_QComboBox", "Manually")
verifyEnabled(":Options.OK_QPushButton")
......
......@@ -294,7 +294,7 @@ def addHelpDocumentationFromSDK():
waitForObjectItem(":Options_QListView", "Help")
clickItem(":Options_QListView", "Help", 14, 15, 0, Qt.LeftButton)
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' text='Documentation'}")
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Documentation")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Documentation")
# get rid of all docs already registered
listWidget = waitForObject("{type='QListWidget' name='docsListWidget' visible='1'}")
if listWidget.count > 0:
......@@ -485,7 +485,7 @@ def iterateQtVersions(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Build & Run")
clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
clickTab(waitForObject(":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>.*)")
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
root = treeWidget.invisibleRootItem()
......@@ -546,7 +546,7 @@ def iterateKits(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Build & Run")
clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
treeView = waitForObject(":Kits_Or_Compilers_QTreeView")
model = treeView.model()
test.compare(model.rowCount(), 2, "Verifying expected target section count")
......@@ -589,7 +589,7 @@ def setAlwaysStartFullHelp():
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Help")
clickItem(":Options_QListView", "Help", 5, 5, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "General")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
selectFromCombo(":Startup.contextHelpComboBox_QComboBox", "Always Start Full Help")
clickButton(waitForObject(":Options.OK_QPushButton"))
......@@ -651,3 +651,13 @@ def readFile(filename):
def simpleFileName(navigatorFileName):
return ".".join(navigatorFileName.split(".")[-2:]).replace("\\","")
def clickOnTab(tabBarStr, tabText, timeout=5000):
if platform.system() == 'Darwin':
if not waitFor("object.exists(tabBarStr)", timeout):
raise LookupError("Could not find QTabBar: %s" % objectMap.realName(tabBarStr))
tabBar = findObject(tabBarStr)
if not tabBar.visible:
test.log("Using workaround for Mac.")
setWindowState(tabBar, WindowState.Normal)
clickTab(waitForObject(tabBarStr, timeout), tabText)
......@@ -127,7 +127,7 @@ def safeClickTab(tab):
for bar in [":*Qt Creator.JavaScript_QTabBar",
":*Qt Creator.Events_QTabBar"]:
try:
clickTab(waitForObject(bar, 1000), tab)
clickOnTab(bar, tab, 1000)
return True
except:
pass
......
......@@ -64,7 +64,7 @@ def __checkBuildAndRun__():
expectedCompilers = __getExpectedCompilers__()
foundCompilers = []
foundCompilerNames = []
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Compilers")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Compilers")
compilerTV = waitForObject(":Kits_Or_Compilers_QTreeView")
__iterateTree__(compilerTV, __compFunc__, foundCompilers, foundCompilerNames)
test.verify(__compareCompilers__(foundCompilers, expectedCompilers),
......@@ -72,13 +72,13 @@ def __checkBuildAndRun__():
# check Qt versions
qmakePath = which("qmake")
foundQt = []
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Qt Versions")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions")
qtTW = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
__iterateTree__(qtTW, __qtFunc__, foundQt, qmakePath)
if foundQt:
foundQt = foundQt[0]
# check kits
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
kitsTV = waitForObject(":Kits_Or_Compilers_QTreeView")
__iterateTree__(kitsTV, __kitFunc__, foundQt, foundCompilerNames)
......
......@@ -38,7 +38,7 @@ def main():
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Environment")
clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "General")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
languageName = testData.field(lang, "language")
selectFromCombo(":User Interface.languageBox_QComboBox", languageName)
clickButton(waitForObject(":Options.OK_QPushButton"))
......
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