Use the same wizard dialog for all four tests
This commit is contained in:
+14
-13
@@ -760,21 +760,19 @@ def testNewProjectWizard(qtbot, monkeypatch, yesToAll, nwMinimal, nwTemp):
|
|||||||
monkeypatch.setattr(GuiProjectWizard, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiProjectWizard, "exec_", lambda *args: None)
|
||||||
nwGUI.mainConf.lastPath = " "
|
nwGUI.mainConf.lastPath = " "
|
||||||
|
|
||||||
|
nwGUI.closeProject()
|
||||||
|
nwGUI.showNewProjectDialog()
|
||||||
|
qtbot.waitUntil(lambda: getGuiItem("GuiProjectWizard") is not None, timeout=1000)
|
||||||
|
|
||||||
|
nwWiz = getGuiItem("GuiProjectWizard")
|
||||||
|
assert isinstance(nwWiz, GuiProjectWizard)
|
||||||
|
nwWiz.show()
|
||||||
|
qtbot.wait(stepDelay)
|
||||||
|
|
||||||
for wStep in range(4):
|
for wStep in range(4):
|
||||||
# This does not actually create the project, it just generates the
|
# This does not actually create the project, it just generates the
|
||||||
# dictionary that defines it.
|
# dictionary that defines it.
|
||||||
|
|
||||||
# The Wizard
|
|
||||||
nwGUI.closeProject()
|
|
||||||
nwGUI.showNewProjectDialog()
|
|
||||||
qtbot.waitUntil(lambda: getGuiItem("GuiProjectWizard") is not None, timeout=1000)
|
|
||||||
|
|
||||||
nwWiz = getGuiItem("GuiProjectWizard")
|
|
||||||
assert isinstance(nwWiz, GuiProjectWizard)
|
|
||||||
nwWiz.show()
|
|
||||||
nwWiz.setObjectName("Dummy%d" % wStep) # Hack to prevent returning the same object twice
|
|
||||||
qtbot.wait(stepDelay)
|
|
||||||
|
|
||||||
# Intro Page
|
# Intro Page
|
||||||
introPage = nwWiz.currentPage()
|
introPage = nwWiz.currentPage()
|
||||||
assert isinstance(introPage, ProjWizardIntroPage)
|
assert isinstance(introPage, ProjWizardIntroPage)
|
||||||
@@ -900,8 +898,11 @@ def testNewProjectWizard(qtbot, monkeypatch, yesToAll, nwMinimal, nwTemp):
|
|||||||
assert projData["numScenes"] == 0
|
assert projData["numScenes"] == 0
|
||||||
assert not projData["chFolders"]
|
assert not projData["chFolders"]
|
||||||
|
|
||||||
nwWiz.reject()
|
# Restart the wizard for next iteration
|
||||||
nwWiz.close()
|
nwWiz.restart()
|
||||||
|
|
||||||
|
nwWiz.reject()
|
||||||
|
nwWiz.close()
|
||||||
|
|
||||||
# qtbot.stopForInteraction()
|
# qtbot.stopForInteraction()
|
||||||
nwGUI.closeMain()
|
nwGUI.closeMain()
|
||||||
|
|||||||
Reference in New Issue
Block a user