Added test coverage for autoreplace
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="0.1.4" fileVersion="1.0" timeStamp="2019-06-08 20:48:32">
|
||||
<novelWriterXML appVersion="0.1.4" fileVersion="1.0" timeStamp="2019-06-08 21:05:51">
|
||||
<project>
|
||||
<name>Project Name</name>
|
||||
<title>Project Title</title>
|
||||
@@ -11,7 +11,9 @@
|
||||
<lastEdited>None</lastEdited>
|
||||
<lastViewed>None</lastViewed>
|
||||
<lastWordCount>0</lastWordCount>
|
||||
<autoReplace/>
|
||||
<autoReplace>
|
||||
<This>With This Stuff </This>
|
||||
</autoReplace>
|
||||
<status>
|
||||
<entry blue="100" green="100" red="100">New</entry>
|
||||
<entry blue="0" green="50" red="200">Note</entry>
|
||||
|
||||
+18
-1
@@ -301,7 +301,7 @@ def testProjectEditor(qtbot, nwTempGUI, nwRef):
|
||||
for c in "John Doh":
|
||||
qtbot.keyClick(projEdit.tabMain.editAuthors, c, delay=keyDelay)
|
||||
|
||||
#Test Status Tab
|
||||
# Test Status Tab
|
||||
projEdit.tabWidget.setCurrentWidget(projEdit.tabStatus)
|
||||
projEdit.tabStatus.listBox.item(2).setSelected(True)
|
||||
qtbot.mouseClick(projEdit.tabStatus.delButton, Qt.LeftButton)
|
||||
@@ -313,6 +313,23 @@ def testProjectEditor(qtbot, nwTempGUI, nwRef):
|
||||
qtbot.keyClick(projEdit.tabStatus.editName, c, delay=keyDelay)
|
||||
qtbot.mouseClick(projEdit.tabStatus.saveButton, Qt.LeftButton)
|
||||
|
||||
# Auto-Replace Tab
|
||||
projEdit.tabWidget.setCurrentWidget(projEdit.tabReplace)
|
||||
for c in "Th is ":
|
||||
qtbot.keyClick(projEdit.tabReplace.editKey, c, delay=keyDelay)
|
||||
for c in "With This Stuff ":
|
||||
qtbot.keyClick(projEdit.tabReplace.editValue, c, delay=keyDelay)
|
||||
qtbot.mouseClick(projEdit.tabReplace.addButton, Qt.LeftButton)
|
||||
|
||||
for c in "Delete":
|
||||
qtbot.keyClick(projEdit.tabReplace.editKey, c, delay=keyDelay)
|
||||
for c in "This Stuff":
|
||||
qtbot.keyClick(projEdit.tabReplace.editValue, c, delay=keyDelay)
|
||||
qtbot.mouseClick(projEdit.tabReplace.addButton, Qt.LeftButton)
|
||||
|
||||
projEdit.tabReplace.listBox.topLevelItem(1).setSelected(True)
|
||||
qtbot.mouseClick(projEdit.tabReplace.delButton, Qt.LeftButton)
|
||||
|
||||
projEdit._doSave()
|
||||
|
||||
# Open again, and check project settings
|
||||
|
||||
Reference in New Issue
Block a user