Bug 1272653 - Update tests to get property where appropriate; r=automatedtester a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 23 May 2016 12:37:00 +0100
changeset 333252 28dbd70650414cf92b6d21c0bdbfaba8dac8332d
parent 333251 83c3f083db414cfc5e095d14a766b7b25cc7f111
child 333253 ab782095ef4ab44dae4cc5f919858c5684837378
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester, test-only
bugs1272653
milestone48.0a2
Bug 1272653 - Update tests to get property where appropriate; r=automatedtester a=test-only MozReview-Commit-ID: Apd1fZLrnTU
testing/marionette/client/marionette_driver/selection.py
testing/marionette/harness/marionette/tests/unit/test_clearing.py
testing/marionette/harness/marionette/tests/unit/test_date_time_value.py
testing/marionette/harness/marionette/tests/unit/test_key_actions.py
testing/marionette/harness/marionette/tests/unit/test_mouse_action.py
testing/marionette/harness/marionette/tests/unit/test_text.py
testing/marionette/harness/marionette/tests/unit/test_typing.py
--- a/testing/marionette/client/marionette_driver/selection.py
+++ b/testing/marionette/client/marionette_driver/selection.py
@@ -115,17 +115,17 @@ class SelectionManager(object):
         '''
         range_count = self.range_count()
         first_rect_list = self.selection_rect_list(0)
         last_rect_list = self.selection_rect_list(range_count - 1)
         last_list_length = last_rect_list['length']
         first_rect, last_rect = first_rect_list['0'], last_rect_list[str(last_list_length - 1)]
         origin_x, origin_y = self.element.rect['x'], self.element.rect['y']
 
-        if self.element.get_attribute('dir') == 'rtl':  # such as Arabic
+        if self.element.get_property('dir') == 'rtl':  # such as Arabic
             start_pos, end_pos = 'right', 'left'
         else:
             start_pos, end_pos = 'left', 'right'
 
         # Calculate y offset according to different needs.
         if location_type == 'center':
             start_y_offset = first_rect['height'] / 2.0
             end_y_offset = last_rect['height'] / 2.0
@@ -208,17 +208,17 @@ class SelectionManager(object):
                   sel.addRange(range);'''
 
         self.element.marionette.execute_script(cmd, script_args=[self.element])
 
     @property
     def content(self):
         '''Return all the content of the element.'''
         if self._input_or_textarea():
-            return self.element.get_attribute('value')
+            return self.element.get_property('value')
         else:
             return self.element.text
 
     @property
     def selected_content(self):
         '''Return the selected portion of the content in the element.'''
         cmd = self.js_selection_cmd() +\
             '''return sel.toString();'''
--- a/testing/marionette/harness/marionette/tests/unit/test_clearing.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_clearing.py
@@ -8,34 +8,34 @@ from marionette_driver.by import By
 
 
 class TestClear(MarionetteTestCase):
     def testWriteableTextInputShouldClear(self):
         test_html = self.marionette.absolute_url("test_clearing.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID, "writableTextInput")
         element.clear()
-        self.assertEqual("", element.get_attribute("value"))
+        self.assertEqual("", element.get_property("value"))
 
     def testTextInputShouldNotClearWhenReadOnly(self):
         test_html = self.marionette.absolute_url("test_clearing.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID,"readOnlyTextInput")
         try:
             element.clear()
             self.fail("Should not have been able to clear")
         except InvalidElementStateException:
             pass
 
     def testWritableTextAreaShouldClear(self):
         test_html = self.marionette.absolute_url("test_clearing.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID,"writableTextArea")
         element.clear()
-        self.assertEqual("", element.get_attribute("value"))
+        self.assertEqual("", element.get_property("value"))
 
     def testTextAreaShouldNotClearWhenDisabled(self):
         test_html = self.marionette.absolute_url("test_clearing.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID,"textAreaNotenabled")
         try:
             element.clear()
             self.fail("Should not have been able to clear")
--- a/testing/marionette/harness/marionette/tests/unit/test_date_time_value.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_date_time_value.py
@@ -1,29 +1,29 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from datetime import datetime
+
 from marionette import MarionetteTestCase
-from datetime import datetime
 from marionette_driver.date_time_value import DateTimeValue
 from marionette_driver.by import By
 
 
 class TestDateTime(MarionetteTestCase):
-
     def test_set_date(self):
         test_html = self.marionette.absolute_url("datetimePage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "date-test")
         dt_value = DateTimeValue(element)
         dt_value.date = datetime(1998, 6, 2)
-        self.assertEqual(element.get_attribute("value"), "1998-06-02")
+        self.assertEqual("1998-06-02", element.get_property("value"))
 
     def test_set_time(self):
         test_html = self.marionette.absolute_url("datetimePage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "time-test")
         dt_value = DateTimeValue(element)
         dt_value.time = datetime(1998, 11, 19, 9, 8, 7)
-        self.assertEqual(element.get_attribute("value"), "09:08:07")
+        self.assertEqual("09:08:07", element.get_property("value"))
--- a/testing/marionette/harness/marionette/tests/unit/test_key_actions.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_key_actions.py
@@ -4,79 +4,78 @@
 
 from marionette import MarionetteTestCase, skip_if_b2g
 from marionette_driver.keys import Keys
 from marionette_driver.marionette import Actions
 from marionette_driver.by import By
 
 
 class TestKeyActions(MarionetteTestCase):
-
     def setUp(self):
         MarionetteTestCase.setUp(self)
-        if self.marionette.session_capabilities['platformName'] == 'Darwin':
+        if self.marionette.session_capabilities["platformName"] == "Darwin":
             self.mod_key = Keys.META
         else:
             self.mod_key = Keys.CONTROL
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         self.reporter_element = self.marionette.find_element(By.ID, "keyReporter")
         self.reporter_element.click()
         self.key_action = Actions(self.marionette)
 
     @property
     def key_reporter_value(self):
-        return self.reporter_element.get_attribute('value')
+        return self.reporter_element.get_property("value")
 
     def test_key_action_basic_input(self):
-        self.key_action.key_down('a').key_down('b').key_down('c').perform()
+        self.key_action.key_down("a").key_down("b").key_down("c").perform()
         self.assertEqual(self.key_reporter_value, "abc")
 
     def test_upcase_input(self):
         (self.key_action.key_down(Keys.SHIFT)
-                        .key_down('a')
+                        .key_down("a")
                         .key_up(Keys.SHIFT)
-                        .key_down('b')
-                        .key_down('c')
+                        .key_down("b")
+                        .key_down("c")
                         .perform())
         self.assertEqual(self.key_reporter_value, "Abc")
 
     def test_replace_input(self):
-        self.key_action.key_down('a').key_down('b').key_down('c').perform()
+        self.key_action.key_down("a").key_down("b").key_down("c").perform()
         self.assertEqual(self.key_reporter_value, "abc")
         (self.key_action.key_down(self.mod_key)
-                        .key_down('a')
+                        .key_down("a")
                         .key_up(self.mod_key)
-                        .key_down('x')
+                        .key_down("x")
                         .perform())
         self.assertEqual(self.key_reporter_value, "x")
 
     def test_clear_input(self):
-        self.key_action.key_down('a').key_down('b').key_down('c').perform()
+        self.key_action.key_down("a").key_down("b").key_down("c").perform()
         self.assertEqual(self.key_reporter_value, "abc")
         (self.key_action.key_down(self.mod_key)
-                        .key_down('a')
-                        .key_down('x')
+                        .key_down("a")
+                        .key_down("x")
                         .perform())
         self.assertEqual(self.key_reporter_value, "")
-        self.key_action.key_down('a').key_down('b').key_down('c').perform()
+        self.key_action.key_down("a").key_down("b").key_down("c").perform()
         self.assertEqual(self.key_reporter_value, "abc")
 
     def test_input_with_wait(self):
-        self.key_action.key_down('a').key_down('b').key_down('c').perform()
+        self.key_action.key_down("a").key_down("b").key_down("c").perform()
         (self.key_action.key_down(self.mod_key)
-                        .key_down('a')
+                        .key_down("a")
                         .wait(.5)
-                        .key_down('x')
+                        .key_down("x")
                         .perform())
         self.assertEqual(self.key_reporter_value, "")
 
     @skip_if_b2g
     def test_open_in_new_window_shortcut(self):
-        el = self.marionette.find_element(By.ID, 'updatediv')
+        el = self.marionette.find_element(By.ID, "updatediv")
         start_win = self.marionette.current_chrome_window_handle
         (self.key_action.key_down(Keys.SHIFT)
                         .press(el)
                         .release()
                         .key_up(Keys.SHIFT)
                         .perform())
         self.wait_for_condition(
             lambda mn: len(self.marionette.window_handles) == 2)
--- a/testing/marionette/harness/marionette/tests/unit/test_mouse_action.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_mouse_action.py
@@ -4,111 +4,110 @@
 
 from marionette import MarionetteTestCase
 from marionette_driver.marionette import Actions
 from marionette_driver.keys import Keys
 from marionette_driver.by import By
 
 
 class TestMouseAction(MarionetteTestCase):
-
     def setUp(self):
         MarionetteTestCase.setUp(self)
-        if self.marionette.session_capabilities['platformName'] == 'Darwin':
+        if self.marionette.session_capabilities["platformName"] == "Darwin":
             self.mod_key = Keys.META
         else:
             self.mod_key = Keys.CONTROL
         self.action = Actions(self.marionette)
 
     def test_click_action(self):
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
         link = self.marionette.find_element(By.ID, "mozLink")
         self.action.click(link).perform()
-        self.assertEqual("Clicked", self.marionette.execute_script("return document.getElementById('mozLink').innerHTML;"))
+        self.assertEqual("Clicked", self.marionette.execute_script(
+            "return document.getElementById('mozLink').innerHTML"))
 
     def test_clicking_element_out_of_view_succeeds(self):
-        # The action based click doesn't check for visibility.
-        test_html = self.marionette.absolute_url('hidden.html')
+        # The action based click doesn"t check for visibility.
+        test_html = self.marionette.absolute_url("hidden.html")
         self.marionette.navigate(test_html)
-        el = self.marionette.find_element(By.ID, 'child')
+        el = self.marionette.find_element(By.ID, "child")
         self.action.click(el).perform()
 
     def test_double_click_action(self):
         test_html = self.marionette.absolute_url("double_click.html")
         self.marionette.navigate(test_html)
-        el = self.marionette.find_element(By.ID, 'one-word-div')
+        el = self.marionette.find_element(By.ID, "one-word-div")
         self.action.double_click(el).perform()
-        el.send_keys(self.mod_key + 'c')
+        el.send_keys(self.mod_key + "c")
         rel = self.marionette.find_element(By.ID, "input-field")
-        rel.send_keys(self.mod_key + 'v')
-        self.assertEqual(rel.get_attribute('value'), 'zyxw')
+        rel.send_keys(self.mod_key + "v")
+        self.assertEqual("zyxw", rel.get_property("value"))
 
     def test_context_click_action(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
-        click_el = self.marionette.find_element(By.ID, 'resultContainer')
+        click_el = self.marionette.find_element(By.ID, "resultContainer")
 
         def context_menu_state():
-            with self.marionette.using_context('chrome'):
-                cm_el = self.marionette.find_element(By.ID, 'contentAreaContextMenu')
-                return cm_el.get_attribute('state')
+            with self.marionette.using_context("chrome"):
+                cm_el = self.marionette.find_element(By.ID, "contentAreaContextMenu")
+                return cm_el.get_attribute("state")
 
-        self.assertEqual('closed', context_menu_state())
+        self.assertEqual("closed", context_menu_state())
         self.action.context_click(click_el).perform()
-        self.wait_for_condition(lambda _: context_menu_state() == 'open')
+        self.wait_for_condition(lambda _: context_menu_state() == "open")
 
-        with self.marionette.using_context('chrome'):
-            (self.marionette.find_element(By.ID, 'main-window')
-                            .send_keys(Keys.ESCAPE))
-        self.wait_for_condition(lambda _: context_menu_state() == 'closed')
+        with self.marionette.using_context("chrome"):
+            self.marionette.find_element(By.ID, "main-window").send_keys(Keys.ESCAPE)
+        self.wait_for_condition(lambda _: context_menu_state() == "closed")
 
     def test_middle_click_action(self):
         test_html = self.marionette.absolute_url("clicks.html")
         self.marionette.navigate(test_html)
 
         self.marionette.find_element(By.ID, "addbuttonlistener").click()
 
         el = self.marionette.find_element(By.ID, "showbutton")
         self.action.middle_click(el).perform()
 
-        self.wait_for_condition(
-            lambda _: el.get_attribute('innerHTML') == '1')
+        self.wait_for_condition(lambda _: el.get_property("innerHTML") == "1")
 
     def test_chrome_click(self):
         self.marionette.navigate("about:blank")
         data_uri = "data:text/html,<html></html>"
-        with self.marionette.using_context('chrome'):
+        with self.marionette.using_context("chrome"):
             urlbar = self.marionette.find_element(By.ID, "urlbar")
             urlbar.send_keys(data_uri)
             go_button = self.marionette.find_element(By.ID, "urlbar-go-button")
             self.action.click(go_button).perform()
         self.wait_for_condition(lambda mn: mn.get_url() == data_uri)
 
     def test_chrome_double_click(self):
         self.marionette.navigate("about:blank")
         test_word = "quux"
-        with self.marionette.using_context('chrome'):
+
+        with self.marionette.using_context("chrome"):
             urlbar = self.marionette.find_element(By.ID, "urlbar")
-            self.assertEqual(urlbar.get_attribute('value'), '')
+            self.assertEqual("", urlbar.get_attribute("value"))
 
             urlbar.send_keys(test_word)
-            self.assertEqual(urlbar.get_attribute('value'), test_word)
+            self.assertEqual(urlbar.get_attribute("value"), test_word)
             (self.action.double_click(urlbar).perform()
                         .key_down(self.mod_key)
-                        .key_down('x').perform())
-            self.assertEqual(urlbar.get_attribute('value'), '')
+                        .key_down("x").perform())
+            self.assertEqual(urlbar.get_attribute("value"), "")
 
     def test_chrome_context_click_action(self):
-        self.marionette.set_context('chrome')
+        self.marionette.set_context("chrome")
         def context_menu_state():
-            cm_el = self.marionette.find_element(By.ID, 'tabContextMenu')
-            return cm_el.get_attribute('state')
+            cm_el = self.marionette.find_element(By.ID, "tabContextMenu")
+            return cm_el.get_attribute("state")
 
         currtab = self.marionette.execute_script("return gBrowser.selectedTab")
-        self.assertEqual('closed', context_menu_state())
+        self.assertEqual("closed", context_menu_state())
         self.action.context_click(currtab).perform()
-        self.wait_for_condition(lambda _: context_menu_state() == 'open')
+        self.wait_for_condition(lambda _: context_menu_state() == "open")
 
-        (self.marionette.find_element(By.ID, 'main-window')
+        (self.marionette.find_element(By.ID, "main-window")
                         .send_keys(Keys.ESCAPE))
 
-        self.wait_for_condition(lambda _: context_menu_state() == 'closed')
+        self.wait_for_condition(lambda _: context_menu_state() == "closed")
--- a/testing/marionette/harness/marionette/tests/unit/test_text.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_text.py
@@ -73,57 +73,57 @@ class TestText(MarionetteTestCase):
         self.assertTrue("up:" in result.text)
 
     def test_should_type_lowercase_characters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys("abc def")
 
-        self.assertEqual("abc def", key_reporter.get_attribute('value'))
+        self.assertEqual("abc def", key_reporter.get_property("value"))
 
     def test_should_type_uppercase_characters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys("ABC DEF")
 
-        self.assertEqual("ABC DEF", key_reporter.get_attribute('value'))
+        self.assertEqual("ABC DEF", key_reporter.get_property("value"))
 
     def test_should_type_a_quote_characters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys('"')
 
-        self.assertEqual('"', key_reporter.get_attribute('value'))
+        self.assertEqual('"', key_reporter.get_property("value"))
 
     def test_should_type_an_at_character(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys('@')
 
-        self.assertEqual('@', key_reporter.get_attribute('value'))
+        self.assertEqual("@", key_reporter.get_property("value"))
 
     def test_should_type_a_mix_of_upper_and_lower_case_character(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
-        key_reporter.send_keys('me@EXampLe.com')
+        key_reporter.send_keys("me@EXampLe.com")
 
-        self.assertEqual('me@EXampLe.com', key_reporter.get_attribute('value'))
+        self.assertEqual("me@EXampLe.com", key_reporter.get_property("value"))
 
     def test_arrow_keys_are_not_printable(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys(Keys.ARROW_LEFT)
 
-        self.assertEqual('', key_reporter.get_attribute('value'))
+        self.assertEqual("", key_reporter.get_property("value"))
 
     def test_will_simulate_a_key_up_when_entering_text_into_input_elements(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID, "keyUp")
         element.send_keys("I like cheese")
 
         result = self.marionette.find_element(By.ID, "result")
@@ -199,24 +199,24 @@ class TestText(MarionetteTestCase):
         self.assertTrue("down: 37" in result.text.strip())
         self.assertTrue("up: 37" in result.text.strip())
 
         element.send_keys(Keys.ARROW_RIGHT)
         self.assertTrue("down: 39" in result.text.strip())
         self.assertTrue("up: 39" in result.text.strip())
 
         #  And leave no rubbish/printable keys in the "keyReporter"
-        self.assertEqual(element.get_attribute("value"), "")
+        self.assertEqual("", element.get_property("value"))
 
     def testNumericNonShiftKeys(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID, "keyReporter")
         numericLineCharsNonShifted = "`1234567890-=[]\\,.'/42"
         element.send_keys(numericLineCharsNonShifted)
-        self.assertEqual(element.get_attribute("value"), numericLineCharsNonShifted)
+        self.assertEqual(numericLineCharsNonShifted, element.get_property("value"))
 
     def testShouldTypeAnInteger(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID, "keyReporter")
         element.send_keys(1234)
-        self.assertEqual(element.get_attribute("value"), "1234")
+        self.assertEqual("1234", element.get_property("value"))
--- a/testing/marionette/harness/marionette/tests/unit/test_typing.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_typing.py
@@ -41,89 +41,89 @@ class TestTyping(MarionetteTestCase):
         self.assertTrue("up:" in result.text)
 
     def testShouldTypeLowerCaseLetters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
         keyReporter.send_keys("abc def")
-        self.assertEqual(keyReporter.get_attribute("value"), "abc def")
+        self.assertEqual("abc def", keyReporter.get_property("value"))
 
     def testShouldBeAbleToTypeCapitalLetters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
         keyReporter.send_keys("ABC DEF")
-        self.assertEqual(keyReporter.get_attribute("value"), "ABC DEF")
+        self.assertEqual("ABC DEF", keyReporter.get_property("value"))
 
     @skip_if_b2g
     def testCutAndPasteShortcuts(self):
-        # Test that modifier keys work via copy/paste shortcuts.
-        if self.marionette.session_capabilities['platformName'] == 'Darwin':
+        # test that modifier keys work via copy/paste shortcuts
+        if self.marionette.session_capabilities["platformName"] == "Darwin":
             mod_key = Keys.META
         else:
             mod_key = Keys.CONTROL
 
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
-        self.assertEqual(keyReporter.get_attribute("value"), "")
+        self.assertEqual("", keyReporter.get_property("value"))
         keyReporter.send_keys("zyxwvutsr")
-        self.assertEqual(keyReporter.get_attribute("value"), "zyxwvutsr")
+        self.assertEqual("zyxwvutsr", keyReporter.get_property("value"))
 
-        # Select all and cut.
-        keyReporter.send_keys(mod_key, 'a')
-        keyReporter.send_keys(mod_key, 'x')
-        self.assertEqual(keyReporter.get_attribute("value"), "")
+        # select all and cut
+        keyReporter.send_keys(mod_key, "a")
+        keyReporter.send_keys(mod_key, "x")
+        self.assertEqual("", keyReporter.get_property("value"))
 
-        self.marionette.set_context("chrome")
-        url_bar = self.marionette.find_element(By.ID, "urlbar")
+        with self.marionette.using_context("chrome"):
+            url_bar = self.marionette.find_element(By.ID, "urlbar")
 
-        # Clear and paste.
-        url_bar.send_keys(mod_key, 'a')
-        url_bar.send_keys(Keys.BACK_SPACE)
+            # lear and paste
+            url_bar.send_keys(mod_key, "a")
+            url_bar.send_keys(Keys.BACK_SPACE)
 
-        self.assertEqual(url_bar.get_attribute("value"), "")
-        url_bar.send_keys(mod_key, 'v')
-        self.assertEqual(url_bar.get_attribute("value"), "zyxwvutsr")
+            self.assertEqual("", url_bar.get_attribute("value"))
+            url_bar.send_keys(mod_key, "v")
+            self.assertEqual("zyxwvutsr", url_bar.get_attribute("value"))
 
     def testShouldBeAbleToTypeQuoteMarks(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
         keyReporter.send_keys("\"")
-        self.assertEqual(keyReporter.get_attribute("value"), "\"")
+        self.assertEqual("\"", keyReporter.get_property("value"))
 
     def testShouldBeAbleToTypeTheAtCharacter(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
         keyReporter.send_keys("@")
-        self.assertEqual(keyReporter.get_attribute("value"), "@")
+        self.assertEqual("@", keyReporter.get_property("value"))
 
     def testShouldBeAbleToMixUpperAndLowerCaseLetters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
         keyReporter.send_keys("me@eXample.com")
-        self.assertEqual(keyReporter.get_attribute("value"), "me@eXample.com")
+        self.assertEqual("me@eXample.com", keyReporter.get_property("value"))
 
     def testArrowKeysShouldNotBePrintable(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
         keyReporter.send_keys(Keys.ARROW_LEFT)
-        self.assertEqual(keyReporter.get_attribute("value"), "")
+        self.assertEqual("", keyReporter.get_property("value"))
 
     def testWillSimulateAKeyUpWhenEnteringTextIntoInputElements(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "keyUp")
         element.send_keys("I like cheese")
         result = self.marionette.find_element(By.ID, "result")
@@ -153,17 +153,17 @@ class TestTyping(MarionetteTestCase):
 
     def testWillSimulateAKeyUpWhenEnteringTextIntoTextAreas(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "keyUpArea")
         element.send_keys("I like cheese")
         result = self.marionette.find_element(By.ID, "result")
-        self.assertEqual(result.text, "I like cheese")
+        self.assertEqual("I like cheese", result.text)
 
     def testWillSimulateAKeyDownWhenEnteringTextIntoTextAreas(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "keyDownArea")
         element.send_keys("I like cheese")
         result = self.marionette.find_element(By.ID, "result")
@@ -200,103 +200,103 @@ class TestTyping(MarionetteTestCase):
         self.assertTrue("down: 37" in result.text.strip())
         self.assertTrue("up: 37" in result.text.strip())
 
         element.send_keys(Keys.ARROW_RIGHT)
         self.assertTrue("down: 39" in result.text.strip())
         self.assertTrue("up: 39" in result.text.strip())
 
         #  And leave no rubbish/printable keys in the "keyReporter"
-        self.assertEqual(element.get_attribute("value"), "")
+        self.assertEqual("", element.get_property("value"))
 
-    ''' Disabled. Reenable in Bug 1068728
+    """Disabled. Reenable in Bug 1068728
     def testNumericShiftKeys(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         result = self.marionette.find_element(By.ID, "result")
         element = self.marionette.find_element(By.ID, "keyReporter")
         numericShiftsEtc = "~!@#$%^&*()_+{}:i\"<>?|END~"
         element.send_keys(numericShiftsEtc)
-        self.assertEqual(element.get_attribute("value"), numericShiftsEtc)
+        self.assertEqual(numericShiftsEtc, element.get_property("value"))
         self.assertTrue(" up: 16" in result.text.strip())
-    '''
+    """
 
     def testLowerCaseAlphaKeys(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "keyReporter")
         lowerAlphas = "abcdefghijklmnopqrstuvwxyz"
         element.send_keys(lowerAlphas)
-        self.assertEqual(element.get_attribute("value"), lowerAlphas)
+        self.assertEqual(lowerAlphas, element.get_property("value"))
 
-    ''' Disabled. Reenable in Bug 1068735
+    """Disabled. Reenable in Bug 1068735
     def testUppercaseAlphaKeys(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         result = self.marionette.find_element(By.ID, "result")
         element = self.marionette.find_element(By.ID, "keyReporter")
         upperAlphas = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
         element.send_keys(upperAlphas)
-        self.assertEqual(element.get_attribute("value"), upperAlphas)
+        self.assertEqual(upperAlphas, element.get_property("value"))
         self.assertTrue(" up: 16" in result.text.strip())
-    '''
+    """
 
-    ''' Disabled. Reenable in Bug 1068726
+    """Disabled. Reenable in Bug 1068726
     def testAllPrintableKeys(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         result = self.marionette.find_element(By.ID, "result")
         element = self.marionette.find_element(By.ID, "keyReporter")
         allPrintable = "!\"#$%&'()*+,-./0123456789:<=>?@ ABCDEFGHIJKLMNOPQRSTUVWXYZ [\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
         element.send_keys(allPrintable)
 
-        self.assertTrue(element.get_attribute("value"), allPrintable)
+        self.assertTrue(allPrintable, element.get_property("value"))
         self.assertTrue(" up: 16" in result.text.strip())
-    '''
+    """
 
-    ''' Disabled. Reenable in Bug 1068733
+    """Disabled. Reenable in Bug 1068733
     def testSpecialSpaceKeys(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "keyReporter")
         element.send_keys("abcd" + Keys.SPACE + "fgh" + Keys.SPACE + "ij")
-        self.assertEqual(element.get_attribute("value"), "abcd fgh ij")
-    '''
+        self.assertEqual("abcd fgh ij", element.get_property("value"))
+    """
 
     def testShouldTypeAnInteger(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         element = self.marionette.find_element(By.ID, "keyReporter")
         element.send_keys(1234)
-        self.assertEqual(element.get_attribute("value"), "1234")
+        self.assertEqual("1234", element.get_property("value"))
 
     def testShouldSendKeysToElementsWithoutTheValueAttribute(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         # If we don't get an error below we are good
-        self.marionette.find_element(By.TAG_NAME, 'body').send_keys('foo')
+        self.marionette.find_element(By.TAG_NAME, "body").send_keys("foo")
 
     def testShouldThrowElementNotVisibleWhenInputHidden(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
-        not_displayed = self.marionette.find_element(By.ID, 'notDisplayed')
-        self.assertRaises(ElementNotVisibleException, not_displayed.send_keys, 'foo')
+        not_displayed = self.marionette.find_element(By.ID, "notDisplayed")
+        self.assertRaises(ElementNotVisibleException, not_displayed.send_keys, "foo")
 
     def test_appends_to_input_text(self):
         self.marionette.navigate(inline("<input>"))
         el = self.marionette.find_element(By.TAG_NAME, "input")
         el.send_keys("foo")
         el.send_keys("bar")
-        self.assertEqual("foobar", el.get_attribute("value"))
+        self.assertEqual("foobar", el.get_property("value"))
 
     def test_appends_to_textarea(self):
         self.marionette.navigate(inline("<textarea></textarea>"))
         textarea = self.marionette.find_element(By.TAG_NAME, "textarea")
         textarea.send_keys("foo")
         textarea.send_keys("bar")
-        self.assertEqual("foobar", textarea.get_attribute("value"))
+        self.assertEqual("foobar", textarea.get_property("value"))