forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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")
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user