Bug 1387470 - Allow geckodriver to use the webdriver conforming click. draft
authorHenrik Skupin <mail@hskupin.info>
Fri, 01 Sep 2017 17:21:50 +0200
changeset 659308 3dcc3c19e01e6ad669a1aedf8f1daec491fbe19b
parent 659307 9cd5da1c42b33859353b9b9c567ef117d1e819d1
child 729967 e5080f3abc34a9ddeeb66f22859ad47a1563257c
push id78105
push userbmo:hskupin@gmail.com
push dateTue, 05 Sep 2017 22:13:58 +0000
bugs1387470
milestone57.0a1
Bug 1387470 - Allow geckodriver to use the webdriver conforming click. 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() {