Bug 1387470 - Allow geckodriver to use the webdriver conforming click. r=ato
authorHenrik Skupin <mail@hskupin.info>
Fri, 01 Sep 2017 17:21:50 +0200
changeset 428639 40fa31e34c5da039a0aef3ffecbc0715c4f47e86
parent 428638 8f6b800cfeeed7f8283ec925bf36f7ddf7a7d544
child 428640 9a9286001f8ad6eef9e5415d640ad819017192de
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1387470
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1387470 - Allow geckodriver to use the webdriver conforming click. r=ato To allow the selection of the new webdriver spec conforming "clickElement" method over the old legacy Selenium one, the "moz:webdriverClick" capability can be used. Setting it's value to true will enable the conforming click. MozReview-Commit-ID: HMvFFEJDvpG
testing/geckodriver/src/capabilities.rs
--- a/testing/geckodriver/src/capabilities.rs
+++ b/testing/geckodriver/src/capabilities.rs
@@ -154,16 +154,23 @@ impl<'a> BrowserCapabilities for Firefox
         Ok(true)
     }
 
     fn validate_custom(&self, name: &str,  value: &Json) -> WebDriverResult<()> {
         if !name.starts_with("moz:") {
             return Ok(())
         }
         match name {
+            "moz:webdriverClick" => {
+                if !value.is_boolean() {
+                    return Err(WebDriverError::new(
+                        ErrorStatus::InvalidArgument,
+                        "moz:webdriverClick is not a boolean"));
+                }
+            }
             "moz:firefoxOptions" => {
                 let data = try_opt!(value.as_object(),
                                     ErrorStatus::InvalidArgument,
                                     "moz:firefoxOptions is not an object");
                 for (key, value) in data.iter() {
                     match &**key {
                         "binary" => {
                             if !value.is_string() {