diff options
author | Christian Stenger <christian.stenger@digia.com> | 2014-03-26 09:47:32 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@digia.com> | 2014-03-26 21:20:06 +0100 |
commit | e0aa74dc1a91408ea4dae12160328bd79fd2f8c8 (patch) | |
tree | 01f40ab169a8e1aebd57e6e32dd951e8d707b096 | |
parent | fcb8e6c2834f1df1f3031d2dcefc3df1752c9f2a (diff) | |
download | qt-creator-e0aa74dc1a91408ea4dae12160328bd79fd2f8c8.tar.gz |
Squish: Improve workaround for tst_QMLS04
Change-Id: I2be9ac44e02287362e7aeab4927645fbbcf38c64
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r-- | tests/system/shared/workarounds.py | 22 | ||||
-rw-r--r-- | tests/system/suite_QMLS/tst_QMLS04/test.py | 15 |
2 files changed, 28 insertions, 9 deletions
diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 7c8d2ddc75..26441bf418 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -301,8 +301,26 @@ class JIRA: "visible='1' window=%s}" % dlg)) except: pass - # known issue with running inside Squish - setWindowState(waitForObject(":Qt Creator_Core::Internal::MainWindow"), WindowState.Normal) + try: + openItemContextMenu(navigator, "%s.Resources.qml\.qrc" % pName, 5, 5, 0) + except: + treeElement = addBranchWildcardToRoot("%s.Resources.qml\.qrc" % pName) + openItemContextMenu(navigator, treeElement, 5, 5, 0) + if platform.system() == 'Darwin': + waitFor("macHackActivateContextMenuItem('Open in Editor')", 6000) + else: + activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Folder_QMenu", + "Open in Editor")) + resourceEditorView = waitForObject("{type='ResourceEditor::Internal::ResourceView' " + "unnamed='1' visible='1'}") + fileName = os.path.basename(fPath) + doubleClick(waitForObjectItem(resourceEditorView, "/.qml/%s" + % fileName.replace(".", "\\.").replace("_", "\\_"))) + mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow") + if not waitFor("fileName in str(mainWindow.windowTitle)", 3000): + raise JIRA.Exception("Could not open %s." % fileName) + else: + test.passes("%s has been added to the qrc file." % fileName) except: test.fatal("Failed to perform workaround for QTCREATORBUG-11548") raise JIRA.JiraException("Failed to perform workaround for QTCREATORBUG-11548") diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 123da338d8..59011f90c1 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -74,13 +74,14 @@ def main(): invokeMenuItem("File", "Save All") invokeMenuItem("File", "Exit") return - test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") - # open MyComponent.qml file for verification - if not openDocument(myCompTE): - test.fatal("Could not open MyComponent.qml.") - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") - return +# following section is done by the workaround for 11548 already - uncomment when removing workaround +# test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") +# # open MyComponent.qml file for verification +# if not openDocument(myCompTE): +# test.fatal("Could not open MyComponent.qml.") +# invokeMenuItem("File", "Save All") +# invokeMenuItem("File", "Exit") +# return editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") codeText = str(editorArea.plainText) # there should be Text item in new file |