Skip to content

Commit

Permalink
Initial selenium tests for workflow invocation export.
Browse files Browse the repository at this point in the history
Test STS link generation of RO crates and native model store format.
  • Loading branch information
jmchilton committed Dec 5, 2024
1 parent 66565db commit 252e9eb
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ Examples of RDM repositories include [Zenodo](https://zenodo.org/), [Invenio RDM
<BCard
v-for="plugin in exportPlugins"
:key="plugin.id"
:data-invocation-export-type="plugin.id"
class="wizard-selection-card"
:border-variant="exportData.exportPluginFormat === plugin.id ? 'primary' : 'default'"
@click="exportData.exportPluginFormat = plugin.id">
Expand All @@ -350,6 +351,7 @@ Examples of RDM repositories include [Zenodo](https://zenodo.org/), [Invenio RDM
<BCard
v-for="target in exportDestinationTargets"
:key="target.destination"
:data-invocation-export-destination="target.destination"
:border-variant="exportData.destination === target.destination ? 'primary' : 'default'"
:header-bg-variant="exportData.destination === target.destination ? 'primary' : 'default'"
:header-text-variant="exportData.destination === target.destination ? 'white' : 'default'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function cancelWorkflowSchedulingLocal() {
</template>
<InvocationReport v-if="invocationStateSuccess" :invocation-id="invocation.id" />
</BTab>
<BTab title="Export" lazy>
<BTab title="Export" title-item-class="invocation-export-tab" lazy>
<div v-if="invocationAndJobTerminal">
<WorkflowInvocationExportOptions :invocation-id="invocation.id" />
</div>
Expand Down
6 changes: 6 additions & 0 deletions client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy_test/base/populators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
85 changes: 85 additions & 0 deletions lib/galaxy_test/selenium/test_workflow_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,91 @@
class TestWorkflowRun(SeleniumTestCase, UsesHistoryItemAssertions, RunsWorkflows):
ensure_registered = True

@selenium_test
@managed_history
def test_workflow_export_file_ro_crate(self):
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)
invocation_0 = self.workflow_populator.history_invocations(history_id)[0]
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_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_download_options")
export_button.wait_for_and_click()
self.sleep_for(self.wait_types.UX_TRANSITION)
self.screenshot("invocation_export_preparing_download")
invocations.export_download_link.wait_for_present()
self.screenshot("invocation_export_download_ready")

@selenium_test
@managed_history
def test_workflow_export_file_ro_crate(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")

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]

@selenium_test
@managed_history
def test_simple_execution(self):
Expand Down

0 comments on commit 252e9eb

Please sign in to comment.