Skip to content

Commit ffde2b5

Browse files
committed
Fix test_rft_export_plugin
1 parent 692a8d4 commit ffde2b5

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

tests/ert/ui_tests/gui/conftest.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
from ert.gui.simulation.run_dialog import RunDialog
2626
from ert.gui.simulation.view import RealizationWidget
2727
from ert.gui.tools.load_results.load_results_panel import LoadResultsPanel
28-
from ert.gui.tools.manage_experiments.manage_experiments_tool import (
29-
ManageExperimentsTool,
30-
)
28+
from ert.gui.tools.manage_experiments import ManageExperimentsPanel
3129
from ert.gui.tools.manage_experiments.storage_widget import AddWidget, StorageWidget
3230
from ert.plugins import ErtPluginContext
3331
from ert.run_models import EnsembleExperiment, MultipleDataAssimilation
@@ -249,7 +247,9 @@ def handle_dialog():
249247
# The Run dialog opens, click show details and wait until done appears
250248
# then click it
251249
run_dialog = wait_for_child(gui, qtbot, RunDialog, timeout=10000)
252-
qtbot.waitUntil(lambda: not run_dialog.done_button.isHidden(), timeout=200000)
250+
qtbot.waitUntil(
251+
lambda: not run_dialog.done_button.isHidden(), timeout=200000
252+
)
253253
qtbot.waitUntil(lambda: run_dialog._tab_widget.currentWidget() is not None)
254254

255255
# Assert that the number of boxes in the detailed view is
@@ -338,18 +338,16 @@ def handle_popup_dialog():
338338
dialog.close()
339339

340340
QTimer.singleShot(1000, handle_load_results_dialog)
341-
load_results_tool = gui.tools["Load results manually"]
342-
load_results_tool.trigger()
341+
gui.load_results_tool.trigger()
343342

344343

345344
def add_experiment_manually(
346345
qtbot, gui, experiment_name="My_experiment", ensemble_name="default"
347346
):
348-
manage_tool = gui.tools["Manage experiments"]
349-
manage_tool.trigger()
350-
351-
assert isinstance(manage_tool, ManageExperimentsTool)
352-
experiments_panel = manage_tool._manage_experiments_panel
347+
button_manage_experiments = gui.findChild(QPushButton, "button_Manage_experiments")
348+
assert button_manage_experiments
349+
qtbot.mouseClick(button_manage_experiments, Qt.LeftButton)
350+
experiments_panel = gui.findChild(ManageExperimentsPanel)
353351

354352
# Open the create new experiment tab
355353
experiments_panel.setCurrentIndex(0)

tests/ert/ui_tests/gui/test_rft_export_plugin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def handle_rft_plugin_dialog():
108108
drop_constant.setChecked(True)
109109
qtbot.mouseClick(dialog.ok_button, Qt.LeftButton)
110110

111-
plugin_tool = gui.tools["Plugins"]
112-
plugin_actions = plugin_tool.getAction().menu().actions()
111+
plugin_tool = gui.plugins_tool
112+
plugin_actions = plugin_tool.menu.actions()
113113
rft_plugin = next(
114114
a for a in plugin_actions if a.text() == "GEN_DATA RFT CSV Export"
115115
)

0 commit comments

Comments
 (0)