Fix toolbox filters integration tests.

This commit is contained in:
John Chilton
2020-11-12 20:48:29 -05:00
parent 24432c3e5f
commit b97155add3
2 changed files with 7 additions and 2 deletions
+3
View File
@@ -78,6 +78,9 @@ preferences:
toolbox_filters:
selectors:
input:
type: xpath
selector: "//span[contains(. ,'${description}')]/../div/div[@class=\"custom-control\"]"
submit: '#submit'
change_user_email:
@@ -31,11 +31,13 @@ class ToolboxFiltersSeleniumIntegrationTestCase(SeleniumIntegrationTestCase):
self.navigate_to_user_preferences()
self.components.preferences.toolbox_filters.wait_for_and_click()
self.sleep_for(self.wait_types.UX_RENDER)
self.screenshot("toolbox_filters_landing")
sibling_text = 'This tool filter will disable the Test Section section.'
# This is the least terrible way I've found to get the right element.
filter_upload = self.driver.find_element_by_xpath("//span[contains(. ,'%s')]/../div//label" % sibling_text)
component = self.components.toolbox_filters.input(description=sibling_text)
filter_upload = component.wait_for_visible()
self.action_chains().move_to_element(filter_upload).click().perform()
self.sleep_for(self.wait_types.UX_RENDER)
self.screenshot("toolbox_filters_swapped")
self.components.toolbox_filters.submit.wait_for_and_click()
self.sleep_for(self.wait_types.UX_RENDER)
self.home()