Skip to content

Commit 331e5c0

Browse files
committed
Add Playwright/Selenium test for workflow invocation tags
- Add test_invocation_tags test to verify tags can be viewed and edited on workflow invocation detail pages - Add navigation selectors for invocation tags section (tags_section, tags_toggle, tags_input, tags_display)
1 parent 58e44c4 commit 331e5c0

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

client/src/utils/navigation/navigation.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,10 @@ invocations:
10771077
wizard_next_button: '.wizard-actions .go-next-btn'
10781078
wizard_export_button: '.wizard-actions .go-next-btn.btn-primary'
10791079
export_download_link: '.download-link'
1080+
tags_section: '.invocation-tags-section'
1081+
tags_toggle: '.invocation-tags-section .stateless-tags .toggle-button'
1082+
tags_input: '.invocation-tags-section .stateless-tags .headless-multiselect input'
1083+
tags_display: '.invocation-tags-section .stateless-tags .tag'
10801084

10811085
tour:
10821086
popover:

lib/galaxy_test/selenium/test_workflow_invocation_details.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from galaxy_test.base.workflow_fixtures import (
22
WORKFLOW_KEEP_SUCCESSFUL_DATASETS,
33
WORKFLOW_KEEP_SUCCESSFUL_DATASETS_TEST_DATA,
4+
WORKFLOW_SIMPLE_CAT_TWICE,
45
WORKFLOW_WITH_OUTPUT_COLLECTION,
56
)
67
from .framework import (
@@ -140,3 +141,59 @@ def assert_has_row():
140141

141142
# close invocations panel
142143
self.components.invocations.activity.wait_for_and_click()
144+
145+
@selenium_test
146+
@managed_history
147+
def test_invocation_tags(self):
148+
"""Test that workflow invocation tags can be viewed and edited.
149+
150+
This test verifies:
151+
- Tags section is displayed on the invocation panel view
152+
- Tags can be added to an invocation
153+
- Added tags are displayed correctly
154+
"""
155+
gx_selenium_context = self
156+
history_id = gx_selenium_context.current_history_id()
157+
158+
# Run a simple workflow
159+
gx_selenium_context.workflow_populator.run_workflow(
160+
WORKFLOW_SIMPLE_CAT_TWICE,
161+
test_data={"input1": "hello world"},
162+
history_id=history_id,
163+
assert_ok=True,
164+
wait=True,
165+
)
166+
167+
# Open the invocation via the invocations panel
168+
self.invocation_open_latest()
169+
invocations = self.components.invocations
170+
171+
# Verify tags section is present
172+
invocations.tags_section.wait_for_visible()
173+
self.screenshot("invocation_tags_section_visible")
174+
175+
# Click the tags toggle button to add tags
176+
invocations.tags_toggle.wait_for_and_click()
177+
self.sleep_for(self.wait_types.UX_RENDER)
178+
179+
# Add a tag using the tags input
180+
from selenium.webdriver.common.keys import Keys
181+
182+
invocations.tags_input.wait_for_visible()
183+
invocations.tags_input.wait_for_and_send_keys("selenium-test-tag")
184+
self.sleep_for(self.wait_types.UX_TRANSITION)
185+
186+
# Press enter to confirm the tag
187+
invocations.tags_input.wait_for_visible().send_keys(Keys.ENTER)
188+
self.sleep_for(self.wait_types.UX_RENDER)
189+
190+
# Verify the tag appears
191+
@retry_assertion_during_transitions
192+
def assert_tag_visible():
193+
tags = invocations.tags_display.all()
194+
assert len(tags) > 0
195+
tag_texts = [tag.text for tag in tags]
196+
assert any("selenium-test-tag" in text for text in tag_texts)
197+
198+
assert_tag_visible()
199+
self.screenshot("invocation_tag_added")

0 commit comments

Comments
 (0)