The GUI test now run on a local virtualbox, testing on Travis

This commit is contained in:
Veronica K. B. Olsen
2019-05-17 10:13:57 +02:00
parent c13e140e37
commit 1c35b54a3d
3 changed files with 16 additions and 10 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
dist: xenial dist: xenial
# services: services:
# - xvfb - xvfb
language: python language: python
sudo: required sudo: required
addons: addons:
@@ -11,12 +11,12 @@ python:
- "3.7" - "3.7"
install: install:
- pip install -r requirements.txt - pip install -r requirements.txt
# - pip install pytest-faulthandler - pip install pytest-faulthandler
- pip install pytest-cov - pip install pytest-cov
# - pip install pytest-qt - pip install pytest-qt
- pip install codecov - pip install codecov
script: script:
# - xvfb-run -a python -m pytest --cov=nw -m "project|core|gui" -v -s - xvfb-run -a python -m pytest --cov=nw -m "project|core|gui" -v -s
- python -m pytest --cov=nw -m "project|core" -v # - python -m pytest --cov=nw -m "project|core" -v
after_success: after_success:
- codecov - codecov
+6
View File
@@ -0,0 +1,6 @@
[pytest]
markers =
project: Project classes tests
core: Core functionality tests
gui: Qt5 GUI tests
serial
+4 -4
View File
@@ -14,8 +14,8 @@ testRef = path.join(testDir,"reference")
@pytest.mark.gui @pytest.mark.gui
def testMainWindows(qtbot, tmpdir): def testMainWindows(qtbot, tmpdir):
confDir = tmpdir.mkdir("conf") confDir = str(tmpdir.mkdir("conf"))
projDir = tmpdir.mkdir("project") projDir = str(tmpdir.mkdir("project"))
nwGUI = nw.main(["--testmode","--config=%s" % confDir]) nwGUI = nw.main(["--testmode","--config=%s" % confDir])
qtbot.addWidget(nwGUI) qtbot.addWidget(nwGUI)
nwGUI.show() nwGUI.show()
@@ -103,9 +103,9 @@ def testMainWindows(qtbot, tmpdir):
qtbot.wait(stepDelay) qtbot.wait(stepDelay)
# Check the files # Check the files
projFile = projDir.join("nwProject.nwx") projFile = str(projDir.join("nwProject.nwx"))
assert cmpFiles(projFile, path.join(testRef,"gui_nwProject.nwx"), [2]) assert cmpFiles(projFile, path.join(testRef,"gui_nwProject.nwx"), [2])
sceneFile = projDir.join("data_3","1489056e0916_main.nwd") sceneFile = str(projDir.join("data_3","1489056e0916_main.nwd"))
assert cmpFiles(sceneFile, path.join(testRef,"gui_1489056e0916_main.nwd")) assert cmpFiles(sceneFile, path.join(testRef,"gui_1489056e0916_main.nwd"))
# qtbot.stopForInteraction() # qtbot.stopForInteraction()