Skip to content

Commit

Permalink
adjust seleniums for changes in JobStep and invocations in general
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Oct 18, 2024
1 parent 7b5616a commit 4c4720b
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 44 deletions.
14 changes: 13 additions & 1 deletion client/src/components/History/SwitchToHistoryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,20 @@ const actionText = computed(() => {
return "View in new tab";
});
const linkTitle = computed(() => {
if (historyStore.currentHistoryId === props.historyId) {
return "This is your current history";
} else {
return `<b>${actionText.value}</b><br>${history.value?.name}`;
}
});
async function onClick(event: MouseEvent, history: HistorySummary) {
const eventStore = useEventStore();
const ctrlKey = eventStore.isMac ? event.metaKey : event.ctrlKey;
if (!ctrlKey && historyStore.currentHistoryId === history.id) {
return;
}
if (!ctrlKey && canSwitch.value) {
if (props.filters) {
historyStore.applyFilters(history.id, props.filters);
Expand Down Expand Up @@ -78,9 +89,10 @@ function viewHistoryInNewTab(history: HistorySummary) {
<div v-else class="history-link">
<BLink
v-b-tooltip.hover.top.noninteractive.html
data-description="switch to history link"
class="truncate"
href="#"
:title="`<b>${actionText}</b><br>${history.name}`"
:title="linkTitle"
@click.stop="onClick($event, history)">
{{ history.name }}
</BLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { RouterLink } from "vue-router";
import { isRegisteredUser } from "@/api";
import type { InvocationJobsSummary, InvocationStep, WorkflowInvocationElementView } from "@/api/invocations";
import { useWorkflowInstance } from "@/composables/useWorkflowInstance";
import { useHistoryStore } from "@/stores/historyStore";
import { useUserStore } from "@/stores/userStore";
import type { Workflow } from "@/stores/workflowStore";
import localize from "@/utils/localization";
Expand Down Expand Up @@ -173,8 +174,9 @@ const jobStatesStr = computed(() => {
<FontAwesomeIcon :icon="faHdd" />History:
<SwitchToHistoryLink :history-id="props.invocation.history_id" />
<BBadge
v-if="props.newHistoryTarget"
v-if="props.newHistoryTarget && useHistoryStore().currentHistoryId !== props.newHistoryTarget"
v-b-tooltip.hover.noninteractive
data-description="new history badge"
role="button"
variant="info"
title="Results generated in a new history. Click on history name to switch to that history.">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function cancelWorkflowSchedulingLocal() {
</script>

<template>
<div v-if="invocation" class="d-flex flex-column w-100">
<div v-if="invocation" class="d-flex flex-column w-100" data-description="workflow invocation state">
<WorkflowInvocationHeader
:is-full-page="props.isFullPage"
:invocation="invocation"
Expand Down
21 changes: 10 additions & 11 deletions client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,8 @@ workflow_run:
validation_error: ".validation-error"
expand_form_link: '.workflow-expand-form-link'
expanded_form: '.workflow-expanded-form'
new_history_target_link: '.workflow-new-history-target-link'
new_history_badge: '[data-description="new history badge"]'
history_target_link: '[data-description="switch to history link"]'
runtime_setting_button: '.workflow-run-settings'
runtime_setting_target: '.workflow-run-settings-target'
simplified_input:
Expand Down Expand Up @@ -848,18 +849,18 @@ invocations:
activity_expand: ".activity-panel-footer"
invocations_table: '#invocations-grid .grid-table'
invocations_table_rows: '#invocations-grid .grid-table [data-description="grid item"]'
invocations_panel_list: '[data-description="Workflow Invocations"] .scroll-list'
invocations_panel_list_items: '[data-description="Workflow Invocations"] .scroll-list button.panel-item'
pager: '[data-description="grid pager"]'
pager_page: '[data-description="grid pager"] .gx-grid-pager-page [aria-posinset=${page}]'
pager_page_next: '[data-description="grid pager"] .gx-grid-pager-next button'
pager_page_last: '[data-description="grid pager"] .gx-grid-pager-last button'
pager_page_first: '[data-description="grid pager"] .gx-grid-pager-first button'
pager_page_previous: '[data-description="grid pager"] .gx-grid-pager-prev button'
pager_page_active: '[data-description="grid pager"] .gx-grid-pager-page.active button'
state_details: '.workflow-invocation-state-component'
toggle_invocation_details: '[data-description="toggle row details"]'
progress_steps_note: '.workflow-invocation-state-component .steps-progress .progressNote'
progress_jobs_note: '.workflow-invocation-state-component .jobs-progress .progressNote'
hide_invocation_graph: '.workflow-invocation-state-component [data-description="hide invocation graph"]'
state_details: '[data-description="workflow invocation state"]'
progress_steps_note: '[data-description="workflow invocation state"] .steps-progress .progress-note'
progress_jobs_note: '[data-description="workflow invocation state"] .jobs-progress .progress-note'
invocation_tab:
type: xpath
selector: '//a[text()="${label}"]'
Expand All @@ -871,16 +872,14 @@ invocations:
step_title: '[data-step="${order_index}"] .step-title'
step_details: '[data-step="${order_index}"] .portlet-operations'
step_output_collection: '[data-step="${order_index}"] .invocation-step-output-collection-details'
step_output_collection_toggle: '[data-step="${order_index}"] .invocation-step-output-collection-details .name'
step_output_collection_toggle: '[data-step="${order_index}"] .invocation-step-output-collection-details .content-title'
step_output_collection_element_identifier:
type: xpath
selector: '//span[contains(@class, "content-title name")][text()="${element_identifier}"]'
step_output_collection_element_datatype: '[data-step="${order_index}"] .invocation-step-output-collection-details .not-loading .datatype .value'
step_job_details: '[data-step="${order_index}"] .invocation-step-job-details'
step_job_table: '[data-step="${order_index}"] .invocation-step-job-details table'
step_job_table_rows: '[data-step="${order_index}"] .invocation-step-job-details table tbody tr'
step_job_information: '[data-step="${order_index}"] .invocation-step-job-details table tbody .b-table-details .info_data_table'
step_job_information_tool_id: '[data-step="${order_index}"] .invocation-step-job-details table tbody .b-table-details .info_data_table #galaxy-tool-id'
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'

tour:
popover:
Expand Down
9 changes: 4 additions & 5 deletions client/src/utils/navigation/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ interface Rootworkflow_run extends Component {
validation_error: SelectorTemplate;
expand_form_link: SelectorTemplate;
expanded_form: SelectorTemplate;
new_history_target_link: SelectorTemplate;
new_history_badge: SelectorTemplate;
history_target_link: SelectorTemplate;
runtime_setting_button: SelectorTemplate;
runtime_setting_target: SelectorTemplate;
input_select_field: SelectorTemplate;
Expand Down Expand Up @@ -479,6 +480,8 @@ interface Rootworkflow_show extends Component {
interface Rootinvocations extends Component {
invocations_table: SelectorTemplate;
invocations_table_rows: SelectorTemplate;
invocations_panel_list: SelectorTemplate;
invocations_panel_list_items: SelectorTemplate;
pager: SelectorTemplate;
pager_page: SelectorTemplate;
pager_page_next: SelectorTemplate;
Expand All @@ -487,10 +490,8 @@ interface Rootinvocations extends Component {
pager_page_previous: SelectorTemplate;
pager_page_active: SelectorTemplate;
state_details: SelectorTemplate;
toggle_invocation_details: SelectorTemplate;
progress_steps_note: SelectorTemplate;
progress_jobs_note: SelectorTemplate;
hide_invocation_graph: SelectorTemplate;
invocation_tab: SelectorTemplate;
invocation_details_tab: SelectorTemplate;
input_details_title: SelectorTemplate;
Expand All @@ -502,8 +503,6 @@ interface Rootinvocations extends Component {
step_output_collection_element_identifier: SelectorTemplate;
step_output_collection_element_datatype: SelectorTemplate;
step_job_details: SelectorTemplate;
step_job_table: SelectorTemplate;
step_job_table_rows: SelectorTemplate;
step_job_information: SelectorTemplate;
step_job_information_tool_id: SelectorTemplate;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ def navigate_to_user_preferences(self):
self.components.masthead.user.wait_for_and_click()
self.components.masthead.preferences.wait_for_and_click()

def navigate_to_invocations(self):
def navigate_to_invocations_grid(self):
self.home()
self.components.invocations.activity.wait_for_and_click()
self.components.invocations.activity_expand.wait_for_and_click()
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy_test/selenium/test_invocation_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_grid(self):
wait=True,
invocations=30,
)
gx_selenium_context.navigate_to_invocations()
gx_selenium_context.navigate_to_invocations_grid()
invocations = gx_selenium_context.components.invocations
invocations.invocations_table.wait_for_visible()

Expand Down
35 changes: 17 additions & 18 deletions lib/galaxy_test/selenium/test_workflow_invocation_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,31 @@ def test_job_details(self):
gx_selenium_context.workflow_populator.run_workflow(
WORKFLOW_WITH_OUTPUT_COLLECTION, history_id=history_id, assert_ok=True, wait=True
)
gx_selenium_context.navigate_to_invocations()

# open invocations panel
self.home()
gx_selenium_context.components.invocations.activity.wait_for_and_click()

invocations = gx_selenium_context.components.invocations
invocations.invocations_table.wait_for_visible()
invocations.invocations_panel_list.wait_for_visible()

@retry_assertion_during_transitions
def assert_has_row():
invocations.invocations_table_rows.wait_for_visible()
invocation_rows = invocations.invocations_table_rows.all()
invocations.invocations_panel_list_items.wait_for_visible()
invocation_rows = invocations.invocations_panel_list_items.all()
assert len(invocation_rows) > 0
return invocation_rows[0]

assert_has_row()

invocations.state_details.assert_absent()
invocations.toggle_invocation_details.wait_for_visible()
details = invocations.toggle_invocation_details.all()[0]
details = invocations.invocations_panel_list_items.all()[0]
details.click()
invocations.state_details.wait_for_visible()

# close invocations panel
gx_selenium_context.components.invocations.activity.wait_for_and_click()

@retry_assertion_during_transitions
def assert_progress_steps_note_contains(text):
assert text in invocations.progress_steps_note.wait_for_visible().text
Expand All @@ -46,31 +52,24 @@ def assert_progress_steps_note_contains(text):
invocations.input_details_title(label="text_input").wait_for_visible()
assert "Test_Dataset" in invocations.input_details_name(label="text_input").wait_for_visible().text

invocations.invocation_tab(label="Overview").wait_for_and_click()
invocations.hide_invocation_graph.wait_for_and_click()
invocations.invocation_tab(label="Steps").wait_for_and_click()
assert "Step 1: text_input" in invocations.step_title(order_index="0").wait_for_visible().text
assert "Step 2: split_up" in invocations.step_title(order_index="1").wait_for_visible().text
assert "Step 3: paired" in invocations.step_title(order_index="2").wait_for_visible().text

invocations.step_details(order_index="1").wait_for_and_click()
invocations.step_job_details(order_index="1").wait_for_and_click()
invocations.step_job_table(order_index="1").wait_for_visible()
invocations.step_job_table_rows(order_index="1").wait_for_visible()
job_rows = invocations.step_job_table_rows(order_index="1").all()
assert len(job_rows) == 1

invocations.step_job_information(order_index="1").assert_absent()
job_rows[0].click()
invocations.step_job_details(order_index="1").wait_for_visible()

self.sleep_for(self.wait_types.UX_RENDER)
self.screenshot("invocations_job_table")
self.screenshot("invocation_step_jobs")

invocations.step_job_information(order_index="1").wait_for_visible()
assert (
"collection_creates_pair"
in invocations.step_job_information_tool_id(order_index="1").wait_for_visible().text
)

invocations.step_output_collection(order_index="1").wait_for_and_click()
invocations.step_output_collection(order_index="1").wait_for_visible()
invocations.step_output_collection_toggle(order_index="1").wait_for_and_click()
invocations.step_output_collection_element_identifier(element_identifier="forward").wait_for_and_click()
datatype = invocations.step_output_collection_element_datatype(order_index="1").wait_for_text()
Expand Down
12 changes: 7 additions & 5 deletions test/integration_selenium/test_workflow_run_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ def test_execution_to_new_history(self):
workflow_run.expanded_form.wait_for_absent_or_hidden()
self.workflow_run_submit()
self.sleep_for(self.wait_types.UX_TRANSITION)
workflow_run.new_history_target_link.wait_for_and_click()
workflow_run.new_history_badge.wait_for_visible()
workflow_run.history_target_link.wait_for_and_click()
self.sleep_for(self.wait_types.UX_TRANSITION)
workflow_run.new_history_target_link.wait_for_absent_or_hidden()
workflow_run.new_history_badge.wait_for_absent_or_hidden()
self.workflow_run_wait_for_ok(hid=2, expand=True)
self.assert_item_summary_includes(2, "2 sequences")

Expand All @@ -63,7 +64,7 @@ def test_execution_in_current_history(self):
workflow_run.expanded_form.wait_for_absent_or_hidden()
self.workflow_run_submit()
self.sleep_for(self.wait_types.UX_TRANSITION)
workflow_run.new_history_target_link.wait_for_absent_or_hidden()
workflow_run.new_history_badge.wait_for_absent_or_hidden()
self.sleep_for(self.wait_types.UX_TRANSITION)
self.workflow_run_wait_for_ok(hid=2, expand=True)
self.assert_item_summary_includes(2, "2 sequences")
Expand Down Expand Up @@ -92,8 +93,9 @@ def test_execution_in_current_history(self):
workflow_run.runtime_setting_target.wait_for_absent_or_hidden()
self.workflow_run_submit()
self.sleep_for(self.wait_types.UX_TRANSITION)
workflow_run.new_history_target_link.wait_for_and_click()
workflow_run.new_history_badge.wait_for_visible()
workflow_run.history_target_link.wait_for_and_click()
self.sleep_for(self.wait_types.UX_TRANSITION)
workflow_run.new_history_target_link.wait_for_absent_or_hidden()
workflow_run.new_history_badge.wait_for_absent_or_hidden()
self.workflow_run_wait_for_ok(hid=2, expand=True)
self.assert_item_summary_includes(2, "2 sequences")

0 comments on commit 4c4720b

Please sign in to comment.