From d8aa29f656dc08a4dd9e09057f458f25bc01e110 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Tue, 8 Sep 2020 22:10:08 +0200 Subject: [PATCH] Added test coverage of navigation buttons and class --- tests/test_gui.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_gui.py b/tests/test_gui.py index bdb684ff..524e74c9 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -1163,6 +1163,22 @@ def testDocAction(qtbot, nwLipsum, nwTemp): "nunc lacus, imperdiet nec posuere ac, interdum non lectus." ) + # Navigation History + assert nwGUI.viewDocument("04468803b92e1") + assert nwGUI.docViewer.theHandle == "04468803b92e1" + assert nwGUI.docViewer.docHeader.backButton.isEnabled() + assert not nwGUI.docViewer.docHeader.forwardButton.isEnabled() + + qtbot.mouseClick(nwGUI.docViewer.docHeader.backButton, Qt.LeftButton) + assert nwGUI.docViewer.theHandle == "4c4f28287af27" + assert not nwGUI.docViewer.docHeader.backButton.isEnabled() + assert nwGUI.docViewer.docHeader.forwardButton.isEnabled() + + qtbot.mouseClick(nwGUI.docViewer.docHeader.forwardButton, Qt.LeftButton) + assert nwGUI.docViewer.theHandle == "04468803b92e1" + assert nwGUI.docViewer.docHeader.backButton.isEnabled() + assert not nwGUI.docViewer.docHeader.forwardButton.isEnabled() + # qtbot.stopForInteraction() nwGUI.closeMain()