diff options
author | Robert Loehning <robert.loehning@theqtcompany.com> | 2016-02-11 20:59:31 +0100 |
---|---|---|
committer | Robert Loehning <robert.loehning@theqtcompany.com> | 2016-02-15 10:44:47 +0000 |
commit | 692261564f2adf33b03ecb38ea6d061ae724e38f (patch) | |
tree | acb1ec56fa37b5699b2a8afc1916881a9b3903a7 | |
parent | 901d74121a616cda6a2d97c4c2284ef8f346e0fc (diff) | |
download | qt-creator-692261564f2adf33b03ecb38ea6d061ae724e38f.tar.gz |
Squish: Include binary editor in tests
Change-Id: I0b4fc4e0cb18dcbd569ebdba201bfb9e2596ba5b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r-- | tests/system/objects.map | 1 | ||||
-rw-r--r-- | tests/system/shared/editor_utils.py | 3 | ||||
-rw-r--r-- | tests/system/suite_editors/shared/testdata/files.tsv | 1 | ||||
-rw-r--r-- | tests/system/suite_editors/tst_delete_externally/test.py | 33 | ||||
-rw-r--r-- | tests/system/suite_editors/tst_edit_externally/test.py | 7 | ||||
-rw-r--r-- | tests/system/suite_editors/tst_select_all/test.py | 1 |
6 files changed, 28 insertions, 18 deletions
diff --git a/tests/system/objects.map b/tests/system/objects.map index 294d54ac57..afb317ead4 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -146,6 +146,7 @@ :Qt Creator.scrollArea_QScrollArea {type='ProjectExplorer::PanelsWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.splitter_QSplitter {name='splitter' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_BinEditor::BinEditorWidget {type='BinEditor::BinEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Bookmarks_TreeView {type='TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CloseButton {type='CloseButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton {occurrence='4' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 2a442d4214..1239611c3f 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -266,6 +266,7 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False): proEditorSuffixes = ["pro", "pri", "prf"] glslEditorSuffixes= ["frag", "vert", "fsh", "vsh", "glsl", "shader", "gsh"] pytEditorSuffixes = ["py", "pyw", "wsgi"] + binEditorSuffixes = ["bin"] suffix = __getFileSuffix__(curFile) expected = os.path.basename(curFile) if treeViewSyntax: @@ -281,6 +282,8 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False): editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") elif suffix in proEditorSuffixes or suffix in glslEditorSuffixes or suffix in pytEditorSuffixes: editor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget") + elif suffix in binEditorSuffixes: + editor = waitForObject(":Qt Creator_BinEditor::BinEditorWidget") else: test.log("Trying TextEditorWidget (file suffix: %s)" % suffix) try: diff --git a/tests/system/suite_editors/shared/testdata/files.tsv b/tests/system/suite_editors/shared/testdata/files.tsv index 8be0cd420b..1563394a6d 100644 --- a/tests/system/suite_editors/shared/testdata/files.tsv +++ b/tests/system/suite_editors/shared/testdata/files.tsv @@ -7,3 +7,4 @@ "creator/src/plugins/coreplugin/basefilewizard.cpp" "creator/src/plugins/coreplugin/basefilewizard.h" "creator/tests/system/suite_debugger/tst_simple_debug/test.py" +"creator/tests/system/suite_editors/shared/testdata/binary.bin" diff --git a/tests/system/suite_editors/tst_delete_externally/test.py b/tests/system/suite_editors/tst_delete_externally/test.py index fb17f6dc79..03a66c360c 100644 --- a/tests/system/suite_editors/tst_delete_externally/test.py +++ b/tests/system/suite_editors/tst_delete_externally/test.py @@ -48,22 +48,25 @@ def main(): continue contentBefore = readFile(currentFile) - popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?" os.remove(currentFile) - test.compare(waitForObject(":File has been removed_QMessageBox").text, - popupText % currentFile) - clickButton(waitForObject(":File has been removed.Save_QPushButton")) - waitFor("os.path.exists(currentFile)", 5000) - # avoids a lock-up on some Linux machines, purely empiric, might have different cause - waitFor("checkIfObjectExists(':File has been removed_QMessageBox', False, 0)", 5000) + if not currentFile.endswith(".bin"): + popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?" + test.compare(waitForObject(":File has been removed_QMessageBox").text, + popupText % currentFile) + clickButton(waitForObject(":File has been removed.Save_QPushButton")) + waitFor("os.path.exists(currentFile)", 5000) + # avoids a lock-up on some Linux machines, purely empiric, might have different cause + waitFor("checkIfObjectExists(':File has been removed_QMessageBox', False, 0)", 5000) - test.compare(readFile(currentFile), contentBefore, - "Verifying that file '%s' was restored correctly" % currentFile) + test.compare(readFile(currentFile), contentBefore, + "Verifying that file '%s' was restored correctly" % currentFile) - # Different warning because of QTCREATORBUG-8130 - popupText2 = "The file %s has been removed outside Qt Creator. Do you want to save it under a different name, or close the editor?" - os.remove(currentFile) - test.compare(waitForObject(":File has been removed_QMessageBox").text, - popupText2 % currentFile) - clickButton(waitForObject(":File has been removed.Close_QPushButton")) + # Different warning because of QTCREATORBUG-8130 + popupText2 = "The file %s has been removed outside Qt Creator. Do you want to save it under a different name, or close the editor?" + os.remove(currentFile) + test.compare(waitForObject(":File has been removed_QMessageBox").text, + popupText2 % currentFile) + clickButton(waitForObject(":File has been removed.Close_QPushButton")) + test.verify(checkIfObjectExists(objectMap.realName(editor), False), + "Was the editor closed after deleting the file?") invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_editors/tst_edit_externally/test.py b/tests/system/suite_editors/tst_edit_externally/test.py index 503cec645e..db42df0427 100644 --- a/tests/system/suite_editors/tst_edit_externally/test.py +++ b/tests/system/suite_editors/tst_edit_externally/test.py @@ -101,7 +101,8 @@ def main(): test.fatal("Failed to get editor - continuing...") continue # verify currentFile - waitFor("'addedLine' in str(editor.plainText)", 2500) - test.compare(editor.plainText, contentBefore + "addedLine\n", - "Verifying: file '%s' was reloaded modified." % currentFile) + if not currentFile.endswith(".bin"): + waitFor("'addedLine' in str(editor.plainText)", 2500) + test.compare(editor.plainText, contentBefore + "addedLine\n", + "Verifying: file '%s' was reloaded modified." % currentFile) invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py index 490c6f82a6..20a0829f32 100644 --- a/tests/system/suite_editors/tst_select_all/test.py +++ b/tests/system/suite_editors/tst_select_all/test.py @@ -35,6 +35,7 @@ source("../../shared/qtcreator.py") def main(): files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), testData.dataset("files.tsv")) + files = filter(lambda x: not x.endswith(".bin"), files) for currentFile in files: if not neededFilePresent(currentFile): return |