Squish: Update tst_rename_file

Creator only selects the filename now, the
extension will be left unchanged by default.

Task-number: QTCREATORBUG-20057
Change-Id: I66bbbb5b95e1d487c2087efa596a87a240721e44
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2018-03-13 23:03:33 +01:00
parent 454c7f83ff
commit fad75a3d56

View File

@@ -101,8 +101,12 @@ def renameFile(projectDir, proFile, branch, oldname, newname):
else: else:
menu = ":Qt Creator.Project.Menu.File_QMenu" menu = ":Qt Creator.Project.Menu.File_QMenu"
activateItem(waitForObjectItem(menu, "Rename...")) activateItem(waitForObjectItem(menu, "Rename..."))
type(waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit"), newname) replaceEdit = waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit")
type(waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit"), "<Return>") if not (oldname.lower().endswith(".qrc") and JIRA.isBugStillOpen(20057)):
test.compare(replaceEdit.selectedText, oldname.rsplit(".", 1)[0],
"Only the filename without the extension is selected?")
replaceEditorContent(replaceEdit, newname)
type(replaceEdit, "<Return>")
test.verify(waitFor("os.path.exists(newFilePath)", 1000), test.verify(waitFor("os.path.exists(newFilePath)", 1000),
"Verify that file with new name exists: %s" % newFilePath) "Verify that file with new name exists: %s" % newFilePath)
test.compare(readFile(newFilePath), oldFileText, test.compare(readFile(newFilePath), oldFileText,