Commit 0369e2a1 authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Remove workaround



QTCREATORBUG-11548 has a quick fix now.

Change-Id: Ia9f38f58bf5d11d5ece4779fd7527fbf8ae65fb1
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 5d76b433
......@@ -260,7 +260,6 @@ class JIRA:
def __initBugDict__(self):
self.__bugs__= {
'QTCREATORBUG-6853':self._workaroundCreator6853_,
'QTCREATORBUG-11548':self._workaroundCreator11548_
}
# helper function - will be called if no workaround for the requested bug is deposited
def _exitFatal_(self, bugType, number):
......@@ -271,56 +270,3 @@ class JIRA:
def _workaroundCreator6853_(self, *args):
if "Release" in args[0] and platform.system() == "Linux":
snooze(2)
def _workaroundCreator11548_(self, *args):
if len(args) != 3:
test.fatal("Need 3 arguments (project directory, project name, path to the file to "
"be added to the qrc file) to perform workaround.")
raise JIRA.JiraException("Wrong invocation of _workaroundCreator11548_().")
(pDir, pName, fPath) = args
try:
selectFromCombo(":Qt Creator_Core::Internal::NavComboBox", "Projects")
navigator = waitForObject(":Qt Creator_Utils::NavigationTreeView")
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('Add Existing Files...')", 6000)
else:
activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Folder_QMenu",
"Add Existing Files..."))
selectFromFileDialog(fPath)
# handle version control if necessary
try:
dlg = ("{name='Core__Internal__AddToVcsDialog' type='Core::Internal::AddToVcsDialog' "
"visible='1' windowTitle='Add to Version Control'}")
waitForObject(dlg, 3000)
clickButton(waitForObject("{text='No' type='QPushButton' unnamed='1' "
"visible='1' window=%s}" % dlg))
except:
pass
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")
......@@ -57,7 +57,6 @@ def main():
else:
test.fail("Refactoring of Text to MyComponent failed in source file. Content of editor:\n%s" % codeText)
myCompTE = "SampleApp.Resources.qml\\.qrc./.qml/MyComponent\\.qml"
filePath = os.path.join(projectDir, "SampleApp", "qml", "MyComponent.qml")
# there should be new QML file generated with name "MyComponent.qml"
try:
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 3000)
......@@ -65,23 +64,18 @@ def main():
try:
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000)
except:
test.xverify(False, "Refactoring failed - file MyComponent.qml was not generated "
"properly in project explorer (QTCREATORBUG-11548")
try:
JIRA.performWorkaroundForBug(11548, JIRA.Bug.CREATOR, projectDir, "SampleApp", filePath)
except JIRA.JiraException:
#save and exit
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
test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer")
#save and exit
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
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
codeText = str(editorArea.plainText)
# there should be Text item in new file
......@@ -92,6 +86,6 @@ def main():
#save and exit
invokeMenuItem("File", "Save All")
# check if new file was created in file system
test.verify(os.path.exists(filePath),
test.verify(os.path.exists(os.path.join(projectDir, "SampleApp", "qml", "MyComponent.qml")),
"Verifying if MyComponent.qml exists in file system after save")
invokeMenuItem("File", "Exit")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment