Skip to content

Commit

Permalink
Fix Firefox to be more reliable on versions over 45
Browse files Browse the repository at this point in the history
* Firefox behaves differently between an ActionChains click and a "real"
  click. The ActionChains click does not try to wait for page navigation
  as such, navigations often fail because the page is changed from under
  it.
* We now use a "real" click if a navigation has been requested. This now
  also initiates a sleep for 1s immediately after we instruct marionette
  to click. This is then enough time for any CSS animations to finish up
  before we continue running any more selenium methods to check for page
  objects to be displayed.
  • Loading branch information
psav committed Jul 4, 2018
1 parent f9f952a commit 2b2c026
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/widgetastic/browser.py
Expand Up @@ -354,7 +354,11 @@ def click(self, locator, *args, **kwargs):
el = self.move_to_element(locator, *args, **kwargs)
self.plugin.before_click(el)
# and then click on current mouse position
self.perform_click()
if nav_click and self.browser_type.lower() == 'firefox' and self.browser_version > 52:
el.click()
time.sleep(1)
else:
self.perform_click()
if not ignore_ajax:
try:
self.plugin.ensure_page_safe()
Expand Down

0 comments on commit 2b2c026

Please sign in to comment.