From 07ed0e2523c9af352561fa3f9178b3530476e9b9 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Wed, 22 May 2019 21:39:08 +0200 Subject: [PATCH] Update the gui test to cover more of the project editor. --- tests/reference/gui/2_nwProject.nwx | 4 ++-- tests/test_gui.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/reference/gui/2_nwProject.nwx b/tests/reference/gui/2_nwProject.nwx index 1e41ce6e..02f3c384 100644 --- a/tests/reference/gui/2_nwProject.nwx +++ b/tests/reference/gui/2_nwProject.nwx @@ -1,5 +1,5 @@ - + Project Name Project Title @@ -13,8 +13,8 @@ New Note - Draft Finished + Final New diff --git a/tests/test_gui.py b/tests/test_gui.py index cf3593fe..ac47fdd2 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -148,8 +148,21 @@ def testProjectEditor(qtbot, nwTempGUI, nwRef): for c in "John Doh": qtbot.keyClick(projEdit.tabMain.editAuthors, c, delay=keyDelay) + #Test Status Tab + projEdit.tabWidget.setCurrentWidget(projEdit.tabStatus) + projEdit.tabStatus.listBox.item(2).setSelected(True) + qtbot.mouseClick(projEdit.tabStatus.delButton, Qt.LeftButton) + qtbot.mouseClick(projEdit.tabStatus.newButton, Qt.LeftButton) + projEdit.tabStatus.listBox.item(3).setSelected(True) + for n in range(8): + qtbot.keyClick(projEdit.tabStatus.editName, Qt.Key_Backspace, delay=keyDelay) + for c in "Final": + qtbot.keyClick(projEdit.tabStatus.editName, c, delay=keyDelay) + qtbot.mouseClick(projEdit.tabStatus.saveButton, Qt.LeftButton) + projEdit._doSave() + # Open again, and check project settings projEdit = GuiProjectEditor(nwGUI, nwGUI.theProject) qtbot.addWidget(projEdit) assert projEdit.tabMain.editName.text() == "Project Name"