From 79a073ed2cc6540be692e6de3d38477fe5bea6b7 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 5 Dec 2024 12:40:44 -0500 Subject: [PATCH 1/2] Initial selenium tests for workflow invocation export. Test STS link generation of RO crates and native model store format. --- .../Export/InvocationExportWizard.vue | 2 + .../WorkflowInvocationState.vue | 2 +- client/src/utils/navigation/navigation.yml | 6 ++ lib/galaxy_test/base/populators.py | 2 + lib/galaxy_test/selenium/test_workflow_run.py | 56 +++++++++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) diff --git a/client/src/components/Workflow/Invocation/Export/InvocationExportWizard.vue b/client/src/components/Workflow/Invocation/Export/InvocationExportWizard.vue index dcfa04e4f770..23c6d1d0c8dd 100644 --- a/client/src/components/Workflow/Invocation/Export/InvocationExportWizard.vue +++ b/client/src/components/Workflow/Invocation/Export/InvocationExportWizard.vue @@ -327,6 +327,7 @@ Examples of RDM repositories include [Zenodo](https://zenodo.org/), [Invenio RDM @@ -350,6 +351,7 @@ Examples of RDM repositories include [Zenodo](https://zenodo.org/), [Invenio RDM - +
diff --git a/client/src/utils/navigation/navigation.yml b/client/src/utils/navigation/navigation.yml index 0612bdf75aff..7ff7c4d409f3 100644 --- a/client/src/utils/navigation/navigation.yml +++ b/client/src/utils/navigation/navigation.yml @@ -886,6 +886,12 @@ invocations: step_job_details: '[data-step="${order_index}"] .invocation-step-job-details' step_job_information: '[data-step="${order_index}"] .invocation-step-job-details .info_data_table' step_job_information_tool_id: '[data-step="${order_index}"] .invocation-step-job-details .info_data_table #galaxy-tool-id' + export_tab: '.invocation-export-tab' + export_output_format: '[data-invocation-export-type="${type}"] .card-body' + export_destination: '[data-invocation-export-destination="${destination}"] .card-body' + wizard_next_button: '.wizard-actions .go-next-btn' + wizard_export_button: '.wizard-actions .go-next-btn.btn-primary' + export_download_link: '.download-link' tour: popover: diff --git a/lib/galaxy_test/base/populators.py b/lib/galaxy_test/base/populators.py index 4f6ecfcff025..97444421a1c1 100644 --- a/lib/galaxy_test/base/populators.py +++ b/lib/galaxy_test/base/populators.py @@ -1904,6 +1904,8 @@ def invocation_count(): invocations = self.history_invocations(history_id) if len(invocations) == expected_invocation_count: return True + elif len(invocations) > expected_invocation_count: + raise AssertionError("More than the expect number of invocations found in workflow") wait_on(invocation_count, f"{expected_invocation_count} history invocations") for invocation in self.history_invocations(history_id): diff --git a/lib/galaxy_test/selenium/test_workflow_run.py b/lib/galaxy_test/selenium/test_workflow_run.py index 5405545ce2e1..b9cd5210b0c2 100644 --- a/lib/galaxy_test/selenium/test_workflow_run.py +++ b/lib/galaxy_test/selenium/test_workflow_run.py @@ -32,6 +32,52 @@ class TestWorkflowRun(SeleniumTestCase, UsesHistoryItemAssertions, RunsWorkflows): ensure_registered = True + @selenium_test + @managed_history + def test_workflow_export_file_native(self): + self._setup_simple_invocation_for_export_testing() + invocations = self.components.invocations + invocations.export_tab.wait_for_and_click() + self.screenshot("invocation_export_formats") + invocations.export_output_format(type="ro-crate").wait_for_and_click() + invocations.wizard_next_button.wait_for_and_click() + download_option = invocations.export_destination(destination="download") + download_option.wait_for_present() + self.screenshot("invocation_export_rocrate_destinations") + download_option.wait_for_and_click() + invocations.wizard_next_button.wait_for_and_click() + export_button = invocations.wizard_export_button + export_button.wait_for_present() + self.screenshot("invocation_export_rocrate_download_options") + export_button.wait_for_and_click() + self.sleep_for(self.wait_types.UX_TRANSITION) + self.screenshot("invocation_export_crate_preparing_download") + invocations.export_download_link.wait_for_present() + self.screenshot("invocation_export_crate_download_ready") + + @selenium_test + @managed_history + def test_workflow_export_file_native(self): + self._setup_simple_invocation_for_export_testing() + invocations = self.components.invocations + invocations.export_tab.wait_for_and_click() + self.screenshot("invocation_export_formats") + invocations.export_output_format(type="default-file").wait_for_and_click() + invocations.wizard_next_button.wait_for_and_click() + download_option = invocations.export_destination(destination="download") + download_option.wait_for_present() + self.screenshot("invocation_export_native_destinations") + download_option.wait_for_and_click() + invocations.wizard_next_button.wait_for_and_click() + export_button = invocations.wizard_export_button + export_button.wait_for_present() + self.screenshot("invocation_export_native_download_options") + export_button.wait_for_and_click() + self.sleep_for(self.wait_types.UX_TRANSITION) + self.screenshot("invocation_export_native_preparing_download") + invocations.export_download_link.wait_for_present() + self.screenshot("invocation_export_native_download_ready") + @selenium_test @managed_history def test_simple_execution(self): @@ -376,3 +422,13 @@ def _set_replacement_parameter(self, element_id, value): assert initial_value == "", initial_value input_element.clear() input_element.send_keys(value) + + def _setup_simple_invocation_for_export_testing(self): + # precondition: refresh history + self.perform_upload(self.get_filename("1.fasta")) + self.wait_for_history() + self.workflow_run_open_workflow(WORKFLOW_SIMPLE_CAT_TWICE) + self.workflow_run_submit() + history_id = self.current_history_id() + self.workflow_populator.wait_for_history_workflows(history_id, expected_invocation_count=1) + return self.workflow_populator.history_invocations(history_id)[0] From abf08fadcc6f194596003e551be12af124444e4b Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 6 Dec 2024 10:02:08 -0500 Subject: [PATCH 2/2] Update lib/galaxy_test/selenium/test_workflow_run.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David López <46503462+davelopez@users.noreply.github.com> --- lib/galaxy_test/selenium/test_workflow_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy_test/selenium/test_workflow_run.py b/lib/galaxy_test/selenium/test_workflow_run.py index b9cd5210b0c2..c47b835f47c3 100644 --- a/lib/galaxy_test/selenium/test_workflow_run.py +++ b/lib/galaxy_test/selenium/test_workflow_run.py @@ -34,7 +34,7 @@ class TestWorkflowRun(SeleniumTestCase, UsesHistoryItemAssertions, RunsWorkflows @selenium_test @managed_history - def test_workflow_export_file_native(self): + def test_workflow_export_file_rocrate(self): self._setup_simple_invocation_for_export_testing() invocations = self.components.invocations invocations.export_tab.wait_for_and_click()