Bug 1245064 - Lower specificationLevel to 0; r=automatedtester a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 04 Mar 2016 18:00:17 +0000
changeset 323387 4598a6110c4211d9a4d33a6d16558fd2bec03b85
parent 323386 a09a88275612bb12798c0f93b0c0063b1990be4e
child 323388 0da3648e25237a307a10b7362565950fbcd0ee28
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester, test-only
bugs1245064
milestone47.0a2
Bug 1245064 - Lower specificationLevel to 0; r=automatedtester a=test-only Marionette is not yet compatible with the WebDriver specification, and we indicate this by lowering the specificationLevel capability to 0. This lets us "gate" specification-compatible features, such as the new element interactability algorithm. The new interactability algorithm can be enabled by requesting the capability specificationLevel 1. MozReview-Commit-ID: 6wsEAsBtR6P
testing/marionette/driver.js
testing/marionette/harness/marionette/tests/unit/test_capabilities.py
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -133,17 +133,17 @@ this.GeckoDriver = function(appName, dev
   this.actions = new action.Chain();
 
   this.sessionCapabilities = {
     // mandated capabilities
     "browserName": Services.appinfo.name,
     "browserVersion": Services.appinfo.version,
     "platformName": Services.sysinfo.getProperty("name"),
     "platformVersion": Services.sysinfo.getProperty("version"),
-    "specificationLevel": "1",
+    "specificationLevel": 0,
 
     // supported features
     "raisesAccessibilityExceptions": false,
     "rotatable": this.appName == "B2G",
     "acceptSslCerts": false,
     "takesElementScreenshot": true,
     "takesScreenshot": true,
     "proxy": {},
--- a/testing/marionette/harness/marionette/tests/unit/test_capabilities.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_capabilities.py
@@ -29,16 +29,17 @@ class TestCapabilities(MarionetteTestCas
         self.assertIn("platformName", self.caps)
         self.assertIn("platformVersion", self.caps)
         self.assertIn("specificationLevel", self.caps)
 
         self.assertEqual(self.caps["browserName"], self.appinfo["name"])
         self.assertEqual(self.caps["browserVersion"], self.appinfo["version"])
         self.assertEqual(self.caps["platformName"], self.os_name)
         self.assertEqual(self.caps["platformVersion"], self.os_version)
+        self.assertEqual(self.caps["specificationLevel"], 0)
 
     def test_supported_features(self):
         self.assertIn("rotatable", self.caps)
         self.assertIn("acceptSslCerts", self.caps)
         self.assertIn("takesElementScreenshot", self.caps)
         self.assertIn("takesScreenshot", self.caps)
 
         self.assertEqual(self.caps["rotatable"], self.is_b2g)
@@ -62,16 +63,22 @@ class TestCapabilities(MarionetteTestCas
 
     def test_we_can_pass_in_capabilities_on_session_start(self):
         self.marionette.delete_session()
         capabilities = {"desiredCapabilities": {"somethingAwesome": "cake"}}
         self.marionette.start_session(capabilities)
         caps = self.marionette.session_capabilities
         self.assertIn("somethingAwesome", caps)
 
+    def test_set_specification_level(self):
+        self.marionette.delete_session()
+        self.marionette.start_session({"specificationLevel": 1})
+        caps = self.marionette.session_capabilities
+        self.assertEqual(1, caps["specificationLevel"])
+
     def test_we_dont_overwrite_server_capabilities(self):
         self.marionette.delete_session()
         capabilities = {"desiredCapabilities": {"browserName": "ChocolateCake"}}
         self.marionette.start_session(capabilities)
         caps = self.marionette.session_capabilities
         self.assertEqual(caps["browserName"], self.appinfo["name"],
                          "This should have appname not ChocolateCake")