Added test for the about box
This commit is contained in:
+35
-18
@@ -8,10 +8,10 @@ from nwtools import *
|
|||||||
from os import path, unlink
|
from os import path, unlink
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
from nw.gui.dialogs.projectsettings import GuiProjectSettings
|
from nw.gui import (
|
||||||
from nw.gui.dialogs.itemeditor import GuiItemEditor
|
GuiProjectSettings, GuiItemEditor, GuiAbout, GuiBuildNovel,
|
||||||
from nw.gui.build import GuiBuildNovel
|
GuiDocMerge
|
||||||
|
)
|
||||||
from nw.constants import *
|
from nw.constants import *
|
||||||
|
|
||||||
keyDelay = 5
|
keyDelay = 5
|
||||||
@@ -236,16 +236,16 @@ def testMainWindows(qtbot, nwTempGUI, nwRef, nwTemp):
|
|||||||
qtbot.wait(stepDelay)
|
qtbot.wait(stepDelay)
|
||||||
|
|
||||||
# Check the files
|
# Check the files
|
||||||
refFile = path.join(nwTempGUI,"nwProject.nwx")
|
refFile = path.join(nwTempGUI, "nwProject.nwx")
|
||||||
assert cmpFiles(refFile, path.join(nwRef,"gui","1_nwProject.nwx"), [2])
|
assert cmpFiles(refFile, path.join(nwRef, "gui", "1_nwProject.nwx"), [2])
|
||||||
refFile = path.join(nwTempGUI,"content","0e17daca5f3e1.nwd")
|
refFile = path.join(nwTempGUI, "content", "0e17daca5f3e1.nwd")
|
||||||
assert cmpFiles(refFile, path.join(nwRef,"gui","1_0e17daca5f3e1.nwd"))
|
assert cmpFiles(refFile, path.join(nwRef, "gui", "1_0e17daca5f3e1.nwd"))
|
||||||
refFile = path.join(nwTempGUI,"content","98010bd9270f9.nwd")
|
refFile = path.join(nwTempGUI, "content", "98010bd9270f9.nwd")
|
||||||
assert cmpFiles(refFile, path.join(nwRef,"gui","1_98010bd9270f9.nwd"))
|
assert cmpFiles(refFile, path.join(nwRef, "gui", "1_98010bd9270f9.nwd"))
|
||||||
refFile = path.join(nwTempGUI,"content","31489056e0916.nwd")
|
refFile = path.join(nwTempGUI, "content", "31489056e0916.nwd")
|
||||||
assert cmpFiles(refFile, path.join(nwRef,"gui","1_31489056e0916.nwd"))
|
assert cmpFiles(refFile, path.join(nwRef, "gui", "1_31489056e0916.nwd"))
|
||||||
refFile = path.join(nwTempGUI,"content","1a6562590ef19.nwd")
|
refFile = path.join(nwTempGUI, "content", "1a6562590ef19.nwd")
|
||||||
assert cmpFiles(refFile, path.join(nwRef,"gui","1_1a6562590ef19.nwd"))
|
assert cmpFiles(refFile, path.join(nwRef, "gui", "1_1a6562590ef19.nwd"))
|
||||||
|
|
||||||
nwGUI.closeMain()
|
nwGUI.closeMain()
|
||||||
# qtbot.stopForInteraction()
|
# qtbot.stopForInteraction()
|
||||||
@@ -333,7 +333,7 @@ def testProjectEditor(qtbot, nwTempGUI, nwRef, nwTemp):
|
|||||||
|
|
||||||
# Check the files
|
# Check the files
|
||||||
projFile = path.join(nwTempGUI,"nwProject.nwx")
|
projFile = path.join(nwTempGUI,"nwProject.nwx")
|
||||||
assert cmpFiles(projFile, path.join(nwRef,"gui","2_nwProject.nwx"), [2])
|
assert cmpFiles(projFile, path.join(nwRef, "gui", "2_nwProject.nwx"), [2])
|
||||||
|
|
||||||
nwGUI.closeMain()
|
nwGUI.closeMain()
|
||||||
# qtbot.stopForInteraction()
|
# qtbot.stopForInteraction()
|
||||||
@@ -382,11 +382,28 @@ def testItemEditor(qtbot, nwTempGUI, nwRef, nwTemp):
|
|||||||
|
|
||||||
# Check the files
|
# Check the files
|
||||||
projFile = path.join(nwTempGUI,"nwProject.nwx")
|
projFile = path.join(nwTempGUI,"nwProject.nwx")
|
||||||
assert cmpFiles(projFile, path.join(nwRef,"gui","3_nwProject.nwx"), [2])
|
assert cmpFiles(projFile, path.join(nwRef, "gui", "3_nwProject.nwx"), [2])
|
||||||
|
|
||||||
nwGUI.closeMain()
|
nwGUI.closeMain()
|
||||||
# qtbot.stopForInteraction()
|
# qtbot.stopForInteraction()
|
||||||
|
|
||||||
|
@pytest.mark.gui
|
||||||
|
def testAboutBox(qtbot, nwTempGUI, nwRef, nwTemp):
|
||||||
|
nwGUI = nw.main(["--testmode","--config=%s" % nwTempGUI, "--data=%s" % nwTemp])
|
||||||
|
qtbot.addWidget(nwGUI)
|
||||||
|
nwGUI.show()
|
||||||
|
qtbot.waitForWindowShown(nwGUI)
|
||||||
|
qtbot.wait(stepDelay)
|
||||||
|
|
||||||
|
msgAbout = GuiAbout(nwGUI)
|
||||||
|
assert msgAbout.pageAbout.document().characterCount() > 100
|
||||||
|
assert msgAbout.pageLicense.document().characterCount() > 100
|
||||||
|
|
||||||
|
# qtbot.stopForInteraction()
|
||||||
|
|
||||||
|
msgAbout._doClose()
|
||||||
|
nwGUI.closeMain()
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
def testBuildTool(qtbot, nwTempBuild, nwLipsum, nwRef, nwTemp):
|
def testBuildTool(qtbot, nwTempBuild, nwLipsum, nwRef, nwTemp):
|
||||||
|
|
||||||
@@ -472,6 +489,6 @@ def testBuildTool(qtbot, nwTempBuild, nwLipsum, nwRef, nwTemp):
|
|||||||
refFile = path.join(nwTempBuild, "Lorem Ipsum.htm")
|
refFile = path.join(nwTempBuild, "Lorem Ipsum.htm")
|
||||||
assert cmpFiles(refFile, path.join(nwRef, "build", "3_LoremIpsum.htm"), [])
|
assert cmpFiles(refFile, path.join(nwRef, "build", "3_LoremIpsum.htm"), [])
|
||||||
|
|
||||||
nwBuild._doClose()
|
|
||||||
|
|
||||||
# qtbot.stopForInteraction()
|
# qtbot.stopForInteraction()
|
||||||
|
nwBuild._doClose()
|
||||||
|
nwGUI.closeMain()
|
||||||
|
|||||||
Reference in New Issue
Block a user