aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@digia.com>2014-06-03 10:19:33 +0200
committerChristian Stenger <christian.stenger@digia.com>2014-06-03 16:46:46 +0200
commitd455f5f6dcc1be1d2346bb5c112c96ddbfe47ce5 (patch)
tree0859956cc6acdaffa01b61945e92fa0f9c36b97c
parent88c1b4ecdbd5e1145e48652856187cdccf591548 (diff)
Squish: Stabilize tests using getEditorForFileSuffix()
This is especially useful when switching between files assigned to the same type of editor. (e.g. cpp header <-> cpp source) Change-Id: I0179e7086a6f25cb0ecc0b69da1f61adb21d8ac2 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r--tests/system/shared/editor_utils.py4
-rw-r--r--tests/system/suite_editors/tst_generic_highlighter/test.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index 4b3a279990..f296b9942b 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -263,6 +263,10 @@ def getEditorForFileSuffix(curFile):
glslEditorSuffixes= ["frag", "vert", "fsh", "vsh", "glsl", "shader", "gsh"]
pytEditorSuffixes = ["py", "pyw", "wsgi"]
suffix = __getFileSuffix__(curFile)
+ mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
+ if not waitFor("os.path.basename(curFile) in str(mainWindow.windowTitle)", 5000):
+ test.fatal("Window title (%s) did not switch to expected file (%s)."
+ % (str(mainWindow.windowTitle), os.path.basename(curFile)))
try:
if suffix in cppEditorSuffixes:
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
diff --git a/tests/system/suite_editors/tst_generic_highlighter/test.py b/tests/system/suite_editors/tst_generic_highlighter/test.py
index 5c4c235889..df2ab56eff 100644
--- a/tests/system/suite_editors/tst_generic_highlighter/test.py
+++ b/tests/system/suite_editors/tst_generic_highlighter/test.py
@@ -168,12 +168,9 @@ def main():
filesToTest = ["Main.lhs", "Main.hs"]
code = ['module Main where', '', 'main :: IO ()', '', 'main = putStrLn "Hello World!"']
- mainWindow = waitForObject(':Qt Creator_Core::Internal::MainWindow')
for current in filesToTest:
createFile(folder, current)
editor = getEditorForFileSuffix(current)
- test.verify(waitFor("current in str(mainWindow.windowTitle)", 5000),
- "Window title changed to current file.")
expectHint = hasSuffix(current, patterns)
mssg = "Verifying whether hint for missing highlight definition is present. (expected: %s)"
try: