forked from qt-creator/qt-creator
Squish: Improve workaround for tst_QMLS04
Change-Id: I2be9ac44e02287362e7aeab4927645fbbcf38c64 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user