Bug 1130979 - Added ANON constant to By class and changed hard-coded values in test file; r=maja_zf a=test-only
authorKim Brown <kbmoz1515@gmail.com>
Sat, 12 Mar 2016 13:32:46 -0500
changeset 325409 5551dd9e51fabd19a8dd96b96901b39cca84d1cd
parent 325408 dc69f49862f490c74f9b2953b86fadb77744ee4e
child 325410 895867bacac6d037c22258984c59750aa17b1576
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1130979
milestone47.0a2
Bug 1130979 - Added ANON constant to By class and changed hard-coded values in test file; r=maja_zf a=test-only MozReview-Commit-ID: AOsb6l9UpVR
testing/marionette/client/marionette_driver/by.py
testing/marionette/harness/marionette/tests/unit/test_anonymous_content.py
--- a/testing/marionette/client/marionette_driver/by.py
+++ b/testing/marionette/client/marionette_driver/by.py
@@ -19,8 +19,9 @@ class By(object):
     XPATH = "xpath"
     LINK_TEXT = "link text"
     PARTIAL_LINK_TEXT = "partial link text"
     NAME = "name"
     TAG_NAME = "tag name"
     CLASS_NAME = "class name"
     CSS_SELECTOR = "css selector"
     ANON_ATTRIBUTE = "anon attribute"
+    ANON = "anon"
--- a/testing/marionette/harness/marionette/tests/unit/test_anonymous_content.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_anonymous_content.py
@@ -51,15 +51,15 @@ class TestAnonymousContent(MarionetteTes
         self.assertEquals(1, len(el.find_elements(By.ANON_ATTRIBUTE, {"anonid": "buttons"})))
 
         with self.assertRaises(NoSuchElementException):
             el.find_element(By.ANON_ATTRIBUTE, {"anonid": "nonexistent"})
         self.assertEquals([], el.find_elements(By.ANON_ATTRIBUTE, {"anonid": "nonexistent"}))
 
     def test_find_anonymous_children(self):
         el = Wait(self.marionette).until(element_present(By.ID, "dia"))
-        self.assertEquals(HTMLElement, type(el.find_element("anon", None)))
-        self.assertEquals(2, len(el.find_elements("anon", None)))
+        self.assertEquals(HTMLElement, type(el.find_element(By.ANON, None)))
+        self.assertEquals(2, len(el.find_elements(By.ANON, None)))
 
         el = self.marionette.find_element(By.ID, "framebox")
         with self.assertRaises(NoSuchElementException):
-            el.find_element("anon", None)
-        self.assertEquals([], el.find_elements("anon", None))
+            el.find_element(By.ANON, None)
+        self.assertEquals([], el.find_elements(By.ANON, None))