Files
galaxy/lib/galaxy_test/selenium/test_workflow_run_inputs.py
John ChiltonandClaude Opus 5 f2edee8c72 Run the invocation grid and sample sheet tests under Playwright
Both were marked selenium_only with the blanket "not yet migrated" reason
rather than a diagnosed failure. Neither uses a gesture the Playwright
backend lacks, and both pass under it unchanged.

Dropping selenium_only cannot affect the Selenium backend - the decorator
only skips under Playwright.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 12:02:42 -04:00

84 lines
3.3 KiB
Python

"""Selenium tests for workflow run input selection and filtering."""
from .framework import (
managed_history,
selenium_test,
SeleniumTestCase,
)
INPUT_LABEL = "input1"
class TestWorkflowRunInputs(SeleniumTestCase):
"""Tests for workflow run input collection filtering."""
ensure_registered = True
@selenium_test
@managed_history
def test_sample_sheet_from_existing_filters_on_collection_type(self):
"""Verify collection selection dialog only shows compatible types."""
workflow_run = self.components.workflow_run
sample_sheet = workflow_run.input.sample_sheet
# 1. Create fixtures - for each test one that matches the filter and one that does.
history_id = self.current_history_id()
flat_list_id = self.dataset_collection_populator.create_list_in_history(
history_id, name="flat_list", wait=True
).json()["output_collections"][0]["id"]
paired_list_id = self.dataset_collection_populator.create_list_of_pairs_in_history(
history_id, name="paired_list", wait=True
).json()["output_collections"][0]["id"]
# 2. Navigate home to see complete collections
self.home()
# 3. Setup workflow with sample_sheet:paired input
id = self._setup_sample_sheet_paired_workflow()
self.workflow_run_with_id(id)
self._open_collection_selection_dialog()
# 5. Assert compatible collection IS present
sample_sheet.collection_selection(id=paired_list_id).wait_for_present()
# 6. Assert incompatible collection is NOT present
sample_sheet.collection_selection(id=flat_list_id).assert_absent()
# 7. Repeat with inverted checks for flat sample_sheet
id = self._setup_sample_sheet_flat_workflow()
self.workflow_run_with_id(id)
self._open_collection_selection_dialog()
sample_sheet.collection_selection(id=flat_list_id).wait_for_present()
sample_sheet.collection_selection(id=paired_list_id).assert_absent()
def _open_collection_selection_dialog(self):
"""Open collection selection dialog for given input."""
workflow_run = self.components.workflow_run
input = workflow_run.input._(label=INPUT_LABEL)
input.upload.wait_for_and_click()
sample_sheet = workflow_run.input.sample_sheet
sample_sheet._.wait_for_present()
sample_sheet.data_import_source_from(source="collection").wait_for_and_click()
sample_sheet.wizard_next_button.wait_for_and_click()
return sample_sheet
def _setup_sample_sheet_paired_workflow(self):
"""Create minimal workflow with sample_sheet:paired input."""
return self._setup_single_input_workflow(collection_type="sample_sheet:paired")
def _setup_sample_sheet_flat_workflow(self):
"""Create minimal workflow with sample_sheet (flat) input."""
return self._setup_single_input_workflow(collection_type="sample_sheet")
def _setup_single_input_workflow(self, collection_type: str):
workflow_content = f"""
class: GalaxyWorkflow
inputs:
{INPUT_LABEL}:
type: collection
collection_type: {collection_type}
steps: []
"""
workflow_id = self.workflow_populator.upload_yaml_workflow(workflow_content)
return workflow_id