Skip to content

Commit

Permalink
Updates workflow editor license selection
Browse files Browse the repository at this point in the history
Refactors license selection logic in the workflow editor
Simplifies selectors and improves interaction handling
Enhances test assertions for license value verification
  • Loading branch information
itisAliRH committed Nov 17, 2024
1 parent d2ee04e commit 8bb73a3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
13 changes: 4 additions & 9 deletions client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -747,15 +747,10 @@ workflow_editor:
canvas_body: '#workflow-canvas'
edit_annotation: '#workflow-annotation'
edit_name: '#workflow-name'
license_selector:
selector: 'license selector'
type: data-description
edit_license_link:
selector: 'edit license link'
type: data-description
license_select:
selector: 'license select'
type: data-description
license_selector: '[data-description="license select"]'
license_current_value: '[data-description="license select"] .multiselect__single'
license_selector_input: '[data-description="license select"] input.multiselect__input'
license_selector_option: '[data-description="license select"] .multiselect__element'
license_save:
selector: 'license save'
type: data-description
Expand Down
11 changes: 6 additions & 5 deletions lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,11 +1204,12 @@ def rule_builder_enter_source_text(self, json):
text_area_elem.send_keys(json)

def workflow_editor_set_license(self, license: str) -> None:
editor = self.components.workflow_editor
editor.edit_license_link.wait_for_and_click()
select = editor.license_select.wait_for_select()
select.select_by_value(license)
editor.license_save.wait_for_and_click()
license_selector = self.components.workflow_editor.license_selector
license_selector.wait_for_and_click()
license_selector.wait_for_and_send_keys(license)

license_selector_option = self.components.workflow_editor.license_selector_option
license_selector_option.wait_for_and_click()

def workflow_editor_click_option(self, option_label):
self.workflow_editor_click_options()
Expand Down
5 changes: 2 additions & 3 deletions lib/galaxy_test/selenium/test_workflow_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ def test_edit_license(self):
name = self.workflow_create_new()
editor.canvas_body.wait_for_visible()
editor.license_selector.wait_for_visible()
editor.license_selector.assert_no_axe_violations_with_impact_of_at_least("serious")
editor.license_selector.assert_data_value("license", "null")
assert "Do not specify" in editor.license_current_value.wait_for_text()

self.workflow_editor_set_license("MIT")
self.workflow_editor_click_save()

self.workflow_index_open_with_name(name)
editor.license_selector.wait_for_visible()
editor.license_selector.assert_data_value("license", "MIT")
assert "MIT" in editor.license_current_value.wait_for_text()

@selenium_test
def test_optional_select_data_field(self):
Expand Down

0 comments on commit 8bb73a3

Please sign in to comment.