From c40649b22d65efe5978e5cf3e98463eafdfeb11c Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 25 May 2019 19:40:31 +0200 Subject: [PATCH] Slight modification to main GUI test --- nw/gui/winmain.py | 2 +- tests/test_gui.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index 54738d59..bfe86601 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -458,7 +458,7 @@ class GuiMain(QMainWindow): vPos = [bPos[1],0] self.splitView.setSizes(vPos) self.docEditor.changeWidth() - return + return not self.docViewer.isVisible() ## # Internal Functions diff --git a/tests/test_gui.py b/tests/test_gui.py index 4abe812d..d3c6d431 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -76,7 +76,7 @@ def testMainWindows(qtbot, nwTempGUI, nwRef): assert nwGUI.treeView._getTreeItem("811786ad1ae74") is not None # Select the 'New Scene' file - nwGUI.treeView.setFocus() + nwGUI.setFocus(1) nwGUI.treeView._getTreeItem("73475cb40a568").setExpanded(True) nwGUI.treeView._getTreeItem("25fc0e7096fc6").setExpanded(True) nwGUI.treeView._getTreeItem("31489056e0916").setSelected(True) @@ -85,7 +85,7 @@ def testMainWindows(qtbot, nwTempGUI, nwRef): assert nwGUI.mainMenu._toggleSpellCheck() # Type something into the document - nwGUI.docEditor.setFocus() + nwGUI.setFocus(2) for c in "# Hello World!": qtbot.keyClick(nwGUI.docEditor, c, delay=keyDelay) qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay) @@ -142,10 +142,12 @@ def testMainWindows(qtbot, nwTempGUI, nwRef): qtbot.wait(stepDelay) # Open and view the edited document + nwGUI.setFocus(3) assert nwGUI.openDocument("31489056e0916") assert nwGUI.viewDocument("31489056e0916") qtbot.wait(stepDelay) assert nwGUI.saveProject() + assert nwGUI.closeDocViewer() # Check the files projFile = path.join(nwTempGUI,"nwProject.nwx")