From 6febfc802ec035487a4c612c97419f7dc611e472 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 29 Apr 2015 11:50:59 +0200 Subject: [PATCH] Squish: Test showing Creator's first commit Change-Id: Ibbd7a2ed6ac7c54a304fec057a61357fed3b4274 Task-number: QTCREATORBUG-14322 Reviewed-by: Tobias Hunger Reviewed-by: Christian Stenger --- tests/system/objects.map | 5 ++ tests/system/suite_tools/suite.conf | 2 +- .../suite_tools/tst_git_first_commit/test.py | 69 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 tests/system/suite_tools/tst_git_first_commit/test.py diff --git a/tests/system/objects.map b/tests/system/objects.map index 431ce20e569..c8121124572 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -195,6 +195,11 @@ :Save Changes.Do not Save_QPushButton {text='Do not Save' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'} :Save Changes.Save All_QPushButton {text='Save All' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'} :Save Changes_Core::Internal::SaveItemsDialog {name='Core__Internal__SaveItemsDialog' type='Core::Internal::SaveItemsDialog' visible='1' windowTitle='Save Changes'} +:Select a Git Commit.Show_QPushButton {name='showButton' text='Show' type='QPushButton' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'} +:Select a Git Commit.changeNumberEdit_Utils::CompletingLineEdit {name='changeNumberEdit' type='Utils::CompletingLineEdit' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'} +:Select a Git Commit.detailsText_QPlainTextEdit {name='detailsText' type='QPlainTextEdit' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'} +:Select a Git Commit.workingDirectoryEdit_QLineEdit {name='workingDirectoryEdit' type='QLineEdit' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'} +:Select a Git Commit_Git::Internal::ChangeSelectionDialog {name='Git__Internal__ChangeSelectionDialog' type='Git::Internal::ChangeSelectionDialog' visible='1' windowTitle='Select a Git Commit'} :Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'} :Send to Codepaster.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.Description:_QLabel {name='descriptionLabel' text='Description:' type='QLabel' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} diff --git a/tests/system/suite_tools/suite.conf b/tests/system/suite_tools/suite.conf index b7b89ef0cc9..f49b0691dfd 100644 --- a/tests/system/suite_tools/suite.conf +++ b/tests/system/suite_tools/suite.conf @@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAP=../objects.map -TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_edit tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_local +TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_edit tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_first_commit tst_git_local VERSION=2 WRAPPERS=Qt diff --git a/tests/system/suite_tools/tst_git_first_commit/test.py b/tests/system/suite_tools/tst_git_first_commit/test.py new file mode 100644 index 00000000000..9ee29aa351f --- /dev/null +++ b/tests/system/suite_tools/tst_git_first_commit/test.py @@ -0,0 +1,69 @@ +############################################################################# +## +## Copyright (C) 2015 The Qt Company Ltd. +## Contact: http://www.qt.io/licensing +## +## This file is part of Qt Creator. +## +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms and +## conditions see http://www.qt.io/terms-conditions. For further information +## use the contact form at http://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, The Qt Company gives you certain additional +## rights. These rights are described in The Qt Company LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +############################################################################# + +source("../../shared/qtcreator.py") + +def main(): + pathReadme = srcPath + "/creator/README" + if not neededFilePresent(pathReadme): + return + + startApplication("qtcreator" + SettingsPath) + if not startedWithoutPluginError(): + return + + invokeMenuItem("File", "Open File or Project...") + selectFromFileDialog(pathReadme) + invokeMenuItem("Tools", "Git", "Actions on Commits...") + pathEdit = waitForObject(":Select a Git Commit.workingDirectoryEdit_QLineEdit") + revEdit = waitForObject(":Select a Git Commit.changeNumberEdit_Utils::CompletingLineEdit") + test.compare(str(pathEdit.displayText), os.path.join(srcPath, "creator").replace("\\", "/")) + test.compare(str(revEdit.displayText), "HEAD") + replaceEditorContent(revEdit, "05c35356abc31549c5db6eba31fb608c0365c2a0") # Initial import + detailsEdit = waitForObject(":Select a Git Commit.detailsText_QPlainTextEdit") + test.verify(detailsEdit.readOnly, "Details view is read only?") + waitFor("str(detailsEdit.plainText) != 'Fetching commit data...'") + commitDetails = str(detailsEdit.plainText) + test.verify("commit 05c35356abc31549c5db6eba31fb608c0365c2a0\n" \ + "Author: con " in commitDetails, + "Information header in details view?") + test.verify("Initial import" in commitDetails, "Commit message in details view?") + test.verify("src/plugins/debugger/gdbengine.cpp | 4035 ++++++++++++++++++++" + in commitDetails, "Text file in details view?") + test.verify("src/plugins/find/images/expand.png | Bin 0 -> 931 bytes" + in commitDetails, "Binary file in details view?") + test.verify("1675 files changed, 229938 insertions(+)" in commitDetails, + "Summary in details view?") + clickButton(waitForObject(":Select a Git Commit.Show_QPushButton")) + changedEdit = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget") + waitFor("len(str(changedEdit.plainText)) > 0 and " + "str(changedEdit.plainText) != 'Waiting for data...'", 20000) + test.xverify(str(changedEdit.plainText) != "No difference", "Does Creator show actual changes?") + invokeMenuItem("File", "Exit")