From 14839e8acc9f4e827fba9ac1c5e4ac7b17edf87d Mon Sep 17 00:00:00 2001
From: Robert Loehning <robert.loehning@digia.com>
Date: Thu, 31 Jan 2013 12:27:24 +0100
Subject: [PATCH] Squish: Fixed suite_CSUP

Change-Id: Iab9acd6124c70397a3eff0a697fc8df4b663cc1a
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
---
 tests/system/suite_CSUP/tst_CSUP01/test.py | 7 ++++---
 tests/system/suite_CSUP/tst_CSUP02/test.py | 7 ++++---
 tests/system/suite_CSUP/tst_CSUP04/test.py | 8 ++++----
 tests/system/suite_CSUP/tst_CSUP05/test.py | 7 ++++---
 4 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/tests/system/suite_CSUP/tst_CSUP01/test.py b/tests/system/suite_CSUP/tst_CSUP01/test.py
index 78962ce23a9..b3ca9bdeced 100644
--- a/tests/system/suite_CSUP/tst_CSUP01/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP01/test.py
@@ -8,10 +8,11 @@ def main():
 # Step 1: Open test .pro project.
     createNewQtQuickApplication(tempDir(), "SampleApp")
     waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
-    test.verify(waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", "SampleApp"),
-                "Step 1: Verifying if: Project is opened.")
 # Step 2: Open .cpp file in Edit mode.
-    openDocument("SampleApp.Sources.main\\.cpp")
+    if not openDocument("SampleApp.Sources.main\\.cpp"):
+        test.fatal("Could not open main.cpp")
+        invokeMenuItem("File", "Exit")
+        return
     test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
                 "Step 2: Verifying if: .cpp file is opened in Edit mode.")
 # Step 3: Insert text "re" to new line in Editor mode and press Ctrl+Space.
diff --git a/tests/system/suite_CSUP/tst_CSUP02/test.py b/tests/system/suite_CSUP/tst_CSUP02/test.py
index 804ea8caeaa..c235574b0e1 100644
--- a/tests/system/suite_CSUP/tst_CSUP02/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP02/test.py
@@ -8,10 +8,11 @@ def main():
 # Step 1: Open test .pro project.
     createNewQtQuickApplication(tempDir(), "SampleApp")
     waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
-    test.verify(waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", "SampleApp"),
-                "Step 1: Verifying if: Project is opened.")
 # Step 2: Open .cpp file in Edit mode.
-    openDocument("SampleApp.Sources.main\\.cpp")
+    if not openDocument("SampleApp.Sources.main\\.cpp"):
+        test.fatal("Could not open main.cpp")
+        invokeMenuItem("File", "Exit")
+        return
     test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
                 "Step 2: Verifying if: .cpp file is opened in Edit mode.")
 # Steps 3&4: Insert text "class" to new line in Editor mode and press Ctrl+Space.
diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py
index c591a3425b2..e60c2ba3624 100644
--- a/tests/system/suite_CSUP/tst_CSUP04/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP04/test.py
@@ -18,11 +18,11 @@ def main():
     installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__")
     # wait for parsing to complete
     waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
-    # open test .pro project.
-    test.verify(waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", "propertyanimation"),
-                "Verifying if: Project is opened.")
     # open .cpp file in editor
-    openDocument("propertyanimation.Sources.main\\.cpp")
+    if not openDocument("propertyanimation.Sources.main\\.cpp"):
+        test.fatal("Could not open main.cpp")
+        invokeMenuItem("File", "Exit")
+        return
     test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
                 "Verifying if: .cpp file is opened in Edit mode.")
     # place cursor on line "QmlApplicationViewer viewer;"
diff --git a/tests/system/suite_CSUP/tst_CSUP05/test.py b/tests/system/suite_CSUP/tst_CSUP05/test.py
index 4a947079d47..9db59aec2e9 100644
--- a/tests/system/suite_CSUP/tst_CSUP05/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP05/test.py
@@ -16,10 +16,11 @@ def main():
     openQmakeProject(examplePath)
     # wait for parsing to complete
     waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
-    test.verify(waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", "propertyanimation"),
-                "Verifying if: Project is opened.")
     # open .cpp file in editor
-    openDocument("propertyanimation.Sources.main\\.cpp")
+    if not openDocument("propertyanimation.Sources.main\\.cpp"):
+        test.fatal("Could not open main.cpp")
+        invokeMenuItem("File", "Exit")
+        return
     test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
                 "Verifying if: .cpp file is opened in Edit mode.")
     # select some word for example "viewer" and press Ctrl+F.
-- 
GitLab