diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 50b99e63ebd..101922e030f 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -631,3 +631,12 @@ def verifyItemOrder(items, text): index = text.find(item) test.verify(index > lastIndex, "'" + item + "' found at index " + str(index)) lastIndex = index + +def openVcsLog(): + if not object.exists(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"): + clickButton(waitForObject(":Qt Creator_Core::Internal::OutputPaneManageButton")) + if platform.system() == 'Darwin': + waitFor('macHackActivateContextMenuItem("Version Control")', 6000) + else: + activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Version Control")) + ensureChecked(waitForObject(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton")) diff --git a/tests/system/suite_tools/tst_git_clone/test.py b/tests/system/suite_tools/tst_git_clone/test.py index fc33f75a6ca..a0721411edb 100644 --- a/tests/system/suite_tools/tst_git_clone/test.py +++ b/tests/system/suite_tools/tst_git_clone/test.py @@ -37,31 +37,33 @@ def verifyCloneLog(targetDir, canceled): cloneLog = waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit") finish = findObject(":Git Repository Clone.Finish_QPushButton") waitFor("canceled or finish.enabled", 30000) - test.xverify(("Executing in " + targetDir + ":" in str(cloneLog.plainText)), - "Searching for target directory in clone log") - test.xverify((" ".join(["clone", cloneUrl, cloneDir]) in str(cloneLog.plainText)), - "Searching for git parameters in clone log") if canceled: - test.xverify("Stopping..." in str(cloneLog.plainText), - "Searching for 'Stopping...' in clone log") - result = "The process terminated in an abnormal way." summary = "Failed." else: test.verify(not "Stopping..." in str(cloneLog.plainText), "Searching for 'Stopping...' in clone log") test.verify(("'" + cloneDir + "'..." in str(cloneLog.plainText)), "Searching for clone directory in clone log") - result = "The process terminated with exit code 0." summary = "Succeeded." # cloneLog.plainText holds escape as character which makes QDom fail while printing the result # removing these for letting Jenkins continue execute the test suite - test.xverify((result in str(cloneLog.plainText)), - "Searching for result (%s) in clone log:\n%s" - % (result, str(cloneLog.plainText).replace(unicode("\x1b"), ""))) resultLabel = findObject(":Git Repository Clone.Result._QLabel") test.verify(waitFor('str(resultLabel.text) == summary', 3000), "Verifying expected result (%s)" % summary) +def verifyVersionControlView(targetDir, canceled): + openVcsLog() + vcsLog = str(waitForObject("{type='QPlainTextEdit' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}").plainText) + test.log("Clone log is: %s" % vcsLog) + test.verify("Executing in " + targetDir + ":" in vcsLog, + "Searching for target directory in clone log") + test.verify(" ".join(["clone", "--progress", cloneUrl, cloneDir]) in vcsLog, + "Searching for git parameters in clone log") + test.verify(canceled == (" terminated abnormally" in vcsLog), + "Searching for result in clone log") + clickButton(waitForObject(":*Qt Creator.Clear_QToolButton")) + def verifyFiles(targetDir): for file in [".gitignore", "CMakeLists.txt", "jom.pro", os.path.join("bin", "ibjom.cmd"), @@ -122,4 +124,5 @@ def main(): test.fail("The checked out project was not being opened.", waitForObject(":Cannot Open Project_QTextEdit").plainText) clickButton(waitForObject(":Cannot Open Project.OK_QPushButton")) + verifyVersionControlView(targetDir, button == "Cancel immediately") invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_tools/tst_git_local/test.py b/tests/system/suite_tools/tst_git_local/test.py index 7b6099caa97..5650dd29dc6 100644 --- a/tests/system/suite_tools/tst_git_local/test.py +++ b/tests/system/suite_tools/tst_git_local/test.py @@ -35,7 +35,7 @@ projectName = "gitProject" # TODO: Make selecting changes possible def commit(commitMessage, expectedLogMessage): - ensureChecked(waitForObject(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton")) + openVcsLog() clickButton(waitForObject(":*Qt Creator.Clear_QToolButton")) invokeMenuItem("Tools", "Git", "Local Repository", "Commit...") replaceEditorContent(waitForObject(":Description.description_Utils::CompletingTextEdit"), commitMessage) @@ -136,10 +136,7 @@ def main(): if not startedWithoutPluginError(): return createProject_Qt_GUI(srcPath, projectName, addToVersionControl = "Git") - if not object.exists(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton"): - clickButton(waitForObject(":Qt Creator_Core::Internal::OutputPaneManageButton")) - activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Version Control")) - ensureChecked(waitForObject(":Qt Creator_VersionControl_Core::Internal::OutputPaneToggleButton")) + openVcsLog() vcsLog = waitForObject("{type='QPlainTextEdit' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}").plainText test.verify("Initialized empty Git repository in %s"