Bug 1274550 - Simplify test case for get_active_element; r?automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 26 May 2016 13:05:03 +0100
changeset 371441 b447cff08ee2bfcc7fcc7c9b48376311a63549c8
parent 371440 904b31633be86bb27e9a1142ee523bad0655e5bc
child 371442 c039130ca365d8d2b4b0a7cb0fc942a6bb63f903
push id19329
push userbmo:ato@mozilla.com
push dateThu, 26 May 2016 16:33:07 +0000
reviewersautomatedtester
bugs1274550
milestone49.0a1
Bug 1274550 - Simplify test case for get_active_element; r?automatedtester MozReview-Commit-ID: 7UYUFccdLV5
testing/marionette/harness/marionette/tests/unit/test_findelement.py
--- a/testing/marionette/harness/marionette/tests/unit/test_findelement.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_findelement.py
@@ -144,19 +144,18 @@ class TestElements(MarionetteTestCase):
 
     def test_css_selector_scope_doesnt_start_at_rootnode(self):
         el = self.marionette.find_element(By.ID, "mozLink")
         nav_el = self.marionette.find_element(By.ID, "testDiv")
         found_els = nav_el.find_elements(By.CSS_SELECTOR, "a")
         self.assertFalse(el.id in [found_el.id for found_el in found_els])
 
     def test_finding_active_element_returns_element(self):
-        fbody = self.marionette.find_element(By.TAG_NAME, 'body')
-        abody = self.marionette.get_active_element()
-        self.assertEqual(fbody, abody)
+        body = self.marionette.find_element(By.TAG_NAME, "body")
+        self.assertEqual(body, self.marionette.get_active_element())
 
     def test_unknown_selector(self):
         with self.assertRaises(InvalidSelectorException):
             self.marionette.find_element("foo", "bar")
 
     def test_element_id_is_valid_uuid(self):
         el = self.marionette.find_element(By.TAG_NAME, "body")
         uuid_regex = re.compile('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$')