forked from qt-creator/qt-creator
Squish: Enable running on Qt5
Change-Id: Id74f1f2162542cbac98f86bc0c0b049334cdf035 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -33,11 +33,11 @@ import re
|
||||
processStarted = False
|
||||
processExited = False
|
||||
|
||||
def __handleProcessStarted__(object):
|
||||
def __handleProcessStarted__(*args):
|
||||
global processStarted
|
||||
processStarted = True
|
||||
|
||||
def __handleProcessExited__(object, exitCode):
|
||||
def __handleProcessExited__(*args):
|
||||
global processExited
|
||||
processExited = True
|
||||
|
||||
@@ -330,8 +330,8 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None
|
||||
global processStarted, processExited
|
||||
processStarted = processExited = False
|
||||
overrideInstallLazySignalHandler()
|
||||
installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processStarted()", "__handleProcessStarted__")
|
||||
installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processExited(int)", "__handleProcessExited__")
|
||||
installLazySignalHandler("{type='QProcess'}", "started()", "__handleProcessStarted__")
|
||||
installLazySignalHandler("{type='QProcess'}", "finished(int,QProcess::ExitStatus)", "__handleProcessExited__")
|
||||
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
|
||||
clickButton(runButton)
|
||||
if sType != SubprocessType.QT_QUICK_UI:
|
||||
@@ -445,7 +445,7 @@ def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefT
|
||||
"Using fallback of pushing STOP inside Creator.")
|
||||
resetApplicationContextToCreator()
|
||||
__closeSubprocessByPushingStop__(sType)
|
||||
waitFor("processExited==True", 10000)
|
||||
waitFor("processExited==True and 'exited with code' in str(output.plainText)", 10000)
|
||||
if not processExited:
|
||||
test.warning("Sub-process seems not to have closed properly.")
|
||||
try:
|
||||
|
@@ -84,8 +84,8 @@ def main():
|
||||
invokeMenuItem("File", "Save All")
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
||||
def __handleFutureProgress__(obj):
|
||||
def __handleFutureProgress__(*args):
|
||||
global searchFinished
|
||||
if className(obj) == "Core::FutureProgress":
|
||||
if className(args[0]) == "Core::FutureProgress":
|
||||
searchFinished = True
|
||||
|
||||
|
@@ -35,19 +35,20 @@ gettingStartedText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
|
||||
"text='Getting Started'")
|
||||
|
||||
# wait until help gets loaded
|
||||
def webPageContentLoaded(obj, param):
|
||||
def webPageContentLoaded(*args):
|
||||
global webPageContentLoadedValue
|
||||
objectClass = str(obj.metaObject().className())
|
||||
objectClass = str(args[0].metaObject().className())
|
||||
if objectClass in ("QWebPage", "Help::Internal::HelpViewer"):
|
||||
webPageContentLoadedValue += 1
|
||||
|
||||
def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboText, testDetails):
|
||||
def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboRegex, testDetails):
|
||||
global gettingStartedText
|
||||
webPageContentLoadedValue = 0
|
||||
mouseClick(waitForObject(qmlItem), 5, 5, 0, Qt.LeftButton)
|
||||
waitFor("webPageContentLoadedValue == 4", 5000)
|
||||
test.compare(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText,
|
||||
expectedHelpComboText, testDetails)
|
||||
foundText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText)
|
||||
if not test.verify(re.match(expectedHelpComboRegex, foundText), testDetails):
|
||||
test.log("Found %s" % foundText)
|
||||
# select "Welcome" page from left toolbar again
|
||||
switchViewTo(ViewConstants.WELCOME)
|
||||
test.verify(checkIfObjectExists(gettingStartedText),
|
||||
@@ -68,7 +69,7 @@ def main():
|
||||
mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
|
||||
"text='Getting Started'")), 5, 5, 0, Qt.LeftButton)
|
||||
qmlItem = getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, "text='User Guide'")
|
||||
expectedText = "QtCreator : Qt Creator Manual"
|
||||
expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)"
|
||||
testDetails = "Verifying: Help with Creator Documentation is being opened."
|
||||
# select "User Guide" topic
|
||||
clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
|
||||
@@ -80,12 +81,12 @@ def main():
|
||||
"text='Blogs'")),
|
||||
"Verifying: Link to Planet Qt exists.")
|
||||
qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='IDE Overview'")
|
||||
expectedText = "QtCreator : IDE Overview"
|
||||
expectedText = "(QtCreator : IDE Overview)|(IDE Overview [|] QtCreator)"
|
||||
testDetails = "Verifying: Help with IDE Overview topic is being opened."
|
||||
# select "IDE Overview"
|
||||
clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
|
||||
qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='User Interface'")
|
||||
expectedText = "QtCreator : User Interface"
|
||||
expectedText = "(QtCreator : User Interface)|(User Interface [|]) QtCreator"
|
||||
testDetails = "Verifying: Help with User Interface topic is being opened."
|
||||
# select "User interface"
|
||||
clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
|
||||
@@ -95,7 +96,8 @@ def main():
|
||||
"text='Building and Running an Example Application'")),
|
||||
5, 5, 0, Qt.LeftButton)
|
||||
waitFor("webPageContentLoadedValue == 4", 5000)
|
||||
checkPattern = "QtCreator : Building and Running an Example( Application)?"
|
||||
checkPattern = ("(QtCreator : Building and Running an Example( Application)?)"
|
||||
"|(Building and Running an Example( Application)? [|] QtCreator)")
|
||||
checkText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText)
|
||||
if not test.verify(re.search(checkPattern, checkText),
|
||||
"Verifying: Building and Running an Example is opened."):
|
||||
|
@@ -33,9 +33,9 @@ source("../../shared/suites_qtta.py")
|
||||
webPageContentLoadedValue = 0
|
||||
|
||||
# wait until help gets loaded
|
||||
def webPageContentLoaded(obj, param):
|
||||
def webPageContentLoaded(*args):
|
||||
global webPageContentLoadedValue
|
||||
objectClass = str(obj.metaObject().className())
|
||||
objectClass = str(args[0].metaObject().className())
|
||||
if objectClass in ("QWebPage", "Help::Internal::HelpViewer"):
|
||||
webPageContentLoadedValue += 1
|
||||
|
||||
|
@@ -112,7 +112,7 @@ def main():
|
||||
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)")
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
||||
def __handleTextChanged__(object):
|
||||
def __handleTextChanged__(*args):
|
||||
global textChanged
|
||||
textChanged = True
|
||||
|
||||
|
@@ -206,7 +206,7 @@ def maskSpecialCharsForProjectTree(filename):
|
||||
filename = filename.replace("/?","\\?").replace("/*","\\*")
|
||||
return filename
|
||||
|
||||
def __handleFutureProgress__(obj):
|
||||
def __handleFutureProgress__(*args):
|
||||
global searchFinished
|
||||
if className(obj) == "Core::FutureProgress":
|
||||
if className(args[0]) == "Core::FutureProgress":
|
||||
searchFinished = True
|
||||
|
@@ -76,7 +76,7 @@ def prepareQmlFile():
|
||||
editor.plainText = "\n".join([line.lstrip() for line in lines]) + "\n"
|
||||
return True
|
||||
|
||||
def handleTextChanged(object):
|
||||
def handleTextChanged(*args):
|
||||
global textHasChanged
|
||||
textHasChanged = True
|
||||
|
||||
|
@@ -160,6 +160,6 @@ def enableMaddePlugin():
|
||||
"occurrence='%d'}" % (devSupport, maddePos)), 5, 5, 0, Qt.LeftButton)
|
||||
clickButton(":Installed Plugins.Close_QPushButton")
|
||||
|
||||
def __handleTextChanged__(object):
|
||||
def __handleTextChanged__(*args):
|
||||
global textChanged
|
||||
textChanged = True
|
||||
|
@@ -40,6 +40,9 @@ def main():
|
||||
clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton)
|
||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
|
||||
languageName = testData.field(lang, "language")
|
||||
if "%1" in languageName:
|
||||
country = str(QLocale.countryToString(QLocale(testData.field(lang, "ISO")).country()))
|
||||
languageName = languageName.replace("%1", country)
|
||||
selectFromCombo(":User Interface.languageBox_QComboBox", languageName)
|
||||
clickButton(waitForObject(":Options.OK_QPushButton"))
|
||||
clickButton(waitForObject(":Restart required.OK_QPushButton"))
|
||||
|
@@ -1,10 +1,10 @@
|
||||
"language" "File" "Exit"
|
||||
"Czech (CzechRepublic)" "Soubor" "Ukončit"
|
||||
"German (Germany)" "Datei" "Beenden"
|
||||
"French (France)" "Fichier" "Quitter"
|
||||
"Japanese (Japan)" "ファイル(F)" "終了(X)"
|
||||
"Polish (Poland)" "Plik" "Zakończ"
|
||||
"Russian (RussianFederation)" "Файл" "Выход"
|
||||
"Slovenian (Slovenia)" "Datoteka" "Končaj"
|
||||
"Chinese (China)" "文件(F)" "退出(X)"
|
||||
"Chinese (Taiwan)" "檔案(F)" "離開(X)"
|
||||
"language" "File" "Exit" "ISO"
|
||||
"Czech (CzechRepublic)" "Soubor" "Ukončit" "cs_CZ"
|
||||
"German (Germany)" "Datei" "Beenden" "de_DE"
|
||||
"French (France)" "Fichier" "Quitter" "fr_FR"
|
||||
"Japanese (Japan)" "ファイル(F)" "終了(X)" "ja_JP"
|
||||
"Polish (Poland)" "Plik" "Zakończ" "pl_PL"
|
||||
"Russian (%1)" "Файл" "Выход" "ru_RU"
|
||||
"Slovenian (Slovenia)" "Datoteka" "Končaj" "sl_SL"
|
||||
"Chinese (China)" "文件(F)" "退出(X)" "zh_CN"
|
||||
"Chinese (Taiwan)" "檔案(F)" "離開(X)" "zh_TW"
|
||||
|
|
Reference in New Issue
Block a user