|
1 | 1 | from galaxy_test.base.workflow_fixtures import ( |
2 | 2 | WORKFLOW_KEEP_SUCCESSFUL_DATASETS, |
3 | 3 | WORKFLOW_KEEP_SUCCESSFUL_DATASETS_TEST_DATA, |
| 4 | + WORKFLOW_SIMPLE_CAT_TWICE, |
4 | 5 | WORKFLOW_WITH_OUTPUT_COLLECTION, |
5 | 6 | ) |
6 | 7 | from .framework import ( |
@@ -140,3 +141,59 @@ def assert_has_row(): |
140 | 141 |
|
141 | 142 | # close invocations panel |
142 | 143 | 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