Added test for the about box

This commit is contained in:
Veronica K. B. Olsen
2020-05-30 12:45:32 +02:00
parent f49e773782
commit 6bb8428ef1
+23 -6
View File
@@ -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
@@ -387,6 +387,23 @@ def testItemEditor(qtbot, nwTempGUI, nwRef, nwTemp):
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()