Skip to content

Commit

Permalink
fixup! [FIX COMMIT MSG] Implement WebDriver executor for wptrunner
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Aug 28, 2018
1 parent 86582c6 commit 81995b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion tools/wptrunner/wptrunner/browsers/edge_webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from . import edge

from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
WebDriverRefTestExecutor) # noqa: F401

Expand Down
1 change: 0 additions & 1 deletion tools/wptrunner/wptrunner/browsers/safari_webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from . import safari

from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
WebDriverRefTestExecutor) # noqa: F401

Expand Down
11 changes: 9 additions & 2 deletions tools/wptrunner/wptrunner/executors/executorwebdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def set_timeout(self, timeout):
except client.WebDriverException:
# workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2057
body = {"type": "script", "ms": timeout * 1000}
self.webdriver.session.send_session_command("POST", "timeouts", body)
self.webdriver.send_session_command("POST", "timeouts", body)

@property
def current_window(self):
Expand Down Expand Up @@ -135,7 +135,14 @@ def setup(self):
self.webdriver = self.parent.webdriver

def send_keys(self, element, keys):
return element.send_keys(keys)
try:
return element.send_keys(keys)
except client.UnknownErrorException as e:
# workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=1999
if (e.http_status != 500 or
e.status_code != "unknown error"):
raise
return element.send_element_command("POST", "value", {"value": list(keys)})


class WebDriverTestDriverProtocolPart(TestDriverProtocolPart):
Expand Down

0 comments on commit 81995b8

Please sign in to comment.