test_text.py (1021B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 from marionette_driver.by import By 6 from marionette_harness import MarionetteTestCase 7 8 9 class TestText(MarionetteTestCase): 10 def test_get_text(self): 11 test_html = self.marionette.absolute_url("test.html") 12 self.marionette.navigate(test_html) 13 l = self.marionette.find_element(By.ID, "mozLink") 14 self.assertEqual("Click me!", l.text) 15 16 def test_clear_text(self): 17 test_html = self.marionette.absolute_url("test.html") 18 self.marionette.navigate(test_html) 19 l = self.marionette.find_element(By.NAME, "myInput") 20 self.assertEqual( 21 "asdf", self.marionette.execute_script("return arguments[0].value;", [l]) 22 ) 23 l.clear() 24 self.assertEqual( 25 "", self.marionette.execute_script("return arguments[0].value;", [l]) 26 )