Updated gui test

This commit is contained in:
Veronica K. B. Olsen
2019-05-17 09:39:33 +02:00
parent bc39ec7886
commit d79c774aea
2 changed files with 43 additions and 3 deletions
+11 -1
View File
@@ -1,5 +1,15 @@
# Hello World!
## With a Subtitle
### An Even Subier Title
#### Basically Not a Title at All
% How about a comment?
@keyword: value
This is a paragraph of dummy text.
This is another paragraph of much longer dummy text. It is in fact very very dum dummy text! We can also try replacing “quotes”, even singles quotes are replaced. We can hyphen-ate, make dashes and even longer dashes — if we want. Ellipsis? Not a problem either …
This is another paragraph of much longer dummy text. It is in fact very very dumb dummy text! We can also try replacing “quotes”, even singles quotes are replaced. We can hyphen-ate, make dashes and even longer dashes — if we want. Ellipsis? Not a problem either …
+32 -2
View File
@@ -8,7 +8,7 @@ from os import path, unlink
from PyQt5.QtCore import Qt
keyDelay = 10
stepDelay = 100
stepDelay = 50
testDir = path.dirname(__file__)
testRef = path.join(testDir,"reference")
@@ -53,11 +53,36 @@ def testMainWindows(qtbot, tmpdir):
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "## With a Subtitle":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "### An Even Subier Title":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "#### Basically Not a Title at All":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "% How about a comment?":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "@keyword: value":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "This is a paragraph of dummy text.":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
for c in "This is another paragraph of much longer dummy text. It is in fact very very dum dummy text! ":
for c in "This is another paragraph of much longer dummy text. It is in fact very very dumb dummy text! ":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
for c in "We can also try replacing \"quotes\", even single's quotes are replaced. ":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
@@ -65,7 +90,12 @@ def testMainWindows(qtbot, tmpdir):
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
for c in "Ellipsis? Not a problem either ... ":
qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay)
qtbot.wait(stepDelay)
nwGUI.docEditor._runCounter()
qtbot.wait(1000)
# Save the document
assert nwGUI.docEditor.docChanged