Skip to content

Commit

Permalink
fixed flake8, added explicit scroll to elements before move+click in …
Browse files Browse the repository at this point in the history
…safe_click functions
  • Loading branch information
zenmonkeykstop committed Nov 24, 2018
1 parent 6c8ae75 commit f0b66a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion securedrop/tests/functional/functional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,10 @@ def safe_click_by_id(self, id):
el.is_displayed,
timeout=self.sleep_time)

el.location_once_scrolled_into_view
actions = ActionChains(self.driver)
actions.move_to_element(el).perform()
actions.move_to_element(el)
actions.perform()

el.click()

Expand All @@ -403,6 +405,7 @@ def safe_click_by_css_selector(self, selector):
el.is_displayed,
timeout=self.sleep_time)

el.location_once_scrolled_into_view
actions = ActionChains(self.driver)
actions.move_to_element(el).perform()

Expand Down
8 changes: 6 additions & 2 deletions securedrop/tests/functional/journalist_navigation_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,10 +817,14 @@ def _admin_visits_reset_2fa_hotp(self):
'#reset-two-factor-hotp')[0]
assert ('/admin/reset-2fa-hotp' in
hotp_reset_button.get_attribute('action'))
self.wait_for(lambda: hotp_reset_button.is_enabled(),
self.wait_for(lambda: hotp_reset_button.is_enabled(),
timeout=self.sleep_time)

hotp_reset_button.location_once_scrolled_into_view
actions = ActionChains(self.driver)
actions.move_to_element(hotp_reset_button)
actions.perform()
hotp_reset_button.click()


def _admin_accepts_2fa_js_alert(self):
self._alert_wait()
Expand Down

0 comments on commit f0b66a0

Please sign in to comment.