diff --git a/lib/galaxy/selenium/has_driver.py b/lib/galaxy/selenium/has_driver.py index 6529146c2bf..0bdf77547a6 100644 --- a/lib/galaxy/selenium/has_driver.py +++ b/lib/galaxy/selenium/has_driver.py @@ -106,14 +106,6 @@ class HasDriver(object): ) return element - def wait_for_id_clickable(self, id, **kwds): - element = self._wait_on( - ec.element_to_be_clickable((By.ID, id)), - "ID [%s] to become clickable" % id, - **kwds - ) - return element - def wait_for_clickable(self, selector_template, **kwds): element = self._wait_on( ec.element_to_be_clickable(selector_template.element_locator), diff --git a/lib/galaxy/selenium/navigation.yml b/lib/galaxy/selenium/navigation.yml index 5d5d9a1fcf0..16f0b271b9a 100644 --- a/lib/galaxy/selenium/navigation.yml +++ b/lib/galaxy/selenium/navigation.yml @@ -165,6 +165,8 @@ tool_panel: selectors: tool_link: 'a[href$$="tool_runner?tool_id=${tool_id}"]' outer_tool_link: '.toolTitleNoSection a[href$$="tool_runner?tool_id=${tool_id}"]' + search: '.tool-search-query' + workflow_names: '#internal-workflows .toolTitle' multi_history_view: @@ -252,6 +254,7 @@ workflows: selectors: new_button: '#workflow-create' import_button: '#workflow-import' + save_button: '#workflow-save-button' workflow_run: diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index 194ad719d57..864c295437d 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -335,13 +335,23 @@ steps: @selenium_test def test_workflow_bookmarking(self): + @retry_assertion_during_transitions + def assert_workflow_bookmarked_status(target_status): + name_matches = [c.text == new_workflow_name for c in self.components.tool_panel.workflow_names.all()] + status = any(name_matches) + self.assertTrue(status == target_status) + new_workflow_name = self.workflow_create_new(clear_placeholder=True) - self.wait_for_id_clickable("workflow-save-button") + # Assert workflow not initially bookmarked. + assert_workflow_bookmarked_status(False) + + save_button = self.components.workflows.save_button + save_button.wait_for_clickable() # element is clickable, but still might be behind the modal self.wait_for_selector_absent_or_hidden(self.modal_body_selector()) - self.driver.find_element_by_id("workflow-save-button").click() + save_button.wait_for_and_click() # wait for saving self.wait_for_selector_absent_or_hidden(self.modal_body_selector()) @@ -358,13 +368,8 @@ steps: self.sleep_for(self.wait_types.UX_TRANSITION) # search for bookmark in tools menu - tools_search_input = self.driver.find_element_by_name("query") - tools_search_input.send_keys(new_workflow_name) - internal_workflows = self.driver.find_element_by_id("internal-workflows") - worksflows = internal_workflows.find_elements_by_class_name("toolTitle") - - # check if bookmark exists - self.assertTrue(any(workflow.text == new_workflow_name for workflow in worksflows)) + self.components.tool_panel.search.wait_for_and_send_keys(new_workflow_name) + assert_workflow_bookmarked_status(True) def workflow_editor_maximize_center_pane(self, collapse_left=True, collapse_right=True): if collapse_left: