Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Work around bug in Selenium 3.4.3 + Chrome 60 #4614

Merged
merged 1 commit into from
Sep 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions gratipay/testing/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import time

from splinter.browser import _DRIVERS
from splinter.driver.webdriver import WebDriverElement
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.keys import Keys

from gratipay.security import user

Expand All @@ -22,6 +25,17 @@ class NeverLeft(Exception): pass
class NeverShowedUp(Exception): pass


# Monkey-patch .click to work around stackoverflow.com/q/11908249
def monkey_click(self):
try:
self._element.click() # Firefox 55
except WebDriverException as exc:
if not exc.msg.startswith('unknown error: Element is not clickable'):
raise
self._element.send_keys(Keys.RETURN) # Chrome 60
WebDriverElement.click = monkey_click


class BrowserHarness(Harness):
"""This is a harness for through-the-web (TTW) testing. It passes
everything through to an underlying `Splinter`_ browser, with the following
Expand Down