diff --git a/tests/unit_tests/gui/test_rft_export_plugin.py b/tests/unit_tests/gui/test_rft_export_plugin.py index 577364fd707..4ff001d9041 100644 --- a/tests/unit_tests/gui/test_rft_export_plugin.py +++ b/tests/unit_tests/gui/test_rft_export_plugin.py @@ -94,6 +94,16 @@ def test_rft_csv_export_plugin_exports_rft_data( load_results_manually(qtbot, gui) + def handle_finished_box(): + """ + Click on the plugin finished dialog once it pops up + """ + qtbot.waitUntil(lambda: isinstance(gui.findChild(QMessageBox), QMessageBox)) + finished_message = gui.findChild(QMessageBox) + assert isinstance(finished_message, QMessageBox) + assert "completed" in finished_message.text() + qtbot.mouseClick(finished_message.button(QMessageBox.Ok), Qt.LeftButton) + def handle_rft_plugin_dialog(): qtbot.waitUntil(lambda: gui.findChild(CustomDialog) is not None) dialog = gui.findChild(CustomDialog) @@ -105,23 +115,13 @@ def handle_rft_plugin_dialog(): assert isinstance(list_field, ListEditBox) list_field._list_edit_line.setText("default") dialog.accept() - - def handle_finished_box(): - """ - Click on the plugin finished dialog once it pops up - """ - qtbot.waitUntil(lambda: isinstance(gui.findChild(QMessageBox), QMessageBox)) - finished_message = gui.findChild(QMessageBox) - assert isinstance(finished_message, QMessageBox) - assert "completed" in finished_message.text() - qtbot.mouseClick(finished_message.button(QMessageBox.Ok), Qt.LeftButton) + QTimer.singleShot(3001, handle_finished_box) plugin_actions = gui.tools["Plugins"].getAction().menu().actions() rft_plugin = [ a for a in plugin_actions if a.iconText() == "GEN_DATA RFT CSV Export" ][0] - QTimer.singleShot(500, handle_rft_plugin_dialog) - QTimer.singleShot(2000, handle_finished_box) + QTimer.singleShot(1000, handle_rft_plugin_dialog) rft_plugin.trigger() qtbot.waitUntil(output_file.exists, timeout=20000) qtbot.waitUntil(