Cleanup workflow bookmark test.

- Use component abstraction (for atomic retry, establishing an abstract description of interface selectors, etc..)
- Augment the test to pre-check the workflow isn't bookmarked initially.
- More retry during transitions.
This commit is contained in:
John Chilton
2020-01-22 12:08:09 -05:00
parent af54fde59d
commit 5bf73d739a
3 changed files with 17 additions and 17 deletions
-8
View File
@@ -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),
+3
View File
@@ -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:
@@ -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: