From 497eb16455ffba71989fd27e83ccfeb5cef983dd Mon Sep 17 00:00:00 2001
From: Robert Loehning <robert.loehning@digia.com>
Date: Thu, 28 Feb 2013 17:15:04 +0100
Subject: [PATCH] Squish: Make sure file was opened in tst_select_all

Change-Id: Iad2c590fd7cc87d8267ecdca515dbef48480e9ed
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
---
 tests/system/shared/utils.py                      | 5 ++++-
 tests/system/suite_editors/tst_select_all/test.py | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index b8601407652..cd15ffb070c 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -212,7 +212,7 @@ def getOutputFromCmdline(cmdline):
     versCall.stdout.close()
     return result
 
-def selectFromFileDialog(fileName):
+def selectFromFileDialog(fileName, waitForFile=False):
     if platform.system() == "Darwin":
         snooze(1)
         nativeType("<Command+Shift+g>")
@@ -233,6 +233,9 @@ def selectFromFileDialog(fileName):
         waitFor("str(pathLine.text)==''")
         replaceEditorContent(pathLine, fName)
         clickButton(findObject("{text='Open' type='QPushButton'}"))
+    if waitForFile:
+        fileCombo = waitForObject(":Qt Creator_FilenameQComboBox")
+        waitFor("str(fileCombo.currentText) in fileName", 5000)
 
 # add qt.qch from SDK path
 def addHelpDocumentationFromSDK():
diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py
index b1f29259e07..045adfe15bd 100644
--- a/tests/system/suite_editors/tst_select_all/test.py
+++ b/tests/system/suite_editors/tst_select_all/test.py
@@ -23,7 +23,7 @@ def main():
         test.log("Opening file %s" % currentFile)
         size = charactersInFile(currentFile)
         invokeMenuItem("File", "Open File or Project...")
-        selectFromFileDialog(currentFile)
+        selectFromFileDialog(currentFile, True)
         editor = getEditorForFileSuffix(currentFile)
         if editor == None:
             test.fatal("Could not get the editor for '%s'" % currentFile,
-- 
GitLab