test_implicit_waits.py (1107B)
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_driver.errors import NoSuchElementException 7 8 from marionette_harness import MarionetteTestCase 9 10 11 class TestImplicitWaits(MarionetteTestCase): 12 def test_implicitly_wait_for_single_element(self): 13 test_html = self.marionette.absolute_url("test_dynamic.html") 14 self.marionette.navigate(test_html) 15 add = self.marionette.find_element(By.ID, "adder") 16 self.marionette.timeout.implicit = 30 17 add.click() 18 # all is well if this does not throw 19 self.marionette.find_element(By.ID, "box0") 20 21 def test_implicit_wait_reaches_timeout(self): 22 test_html = self.marionette.absolute_url("test_dynamic.html") 23 self.marionette.navigate(test_html) 24 self.marionette.timeout.implicit = 3 25 with self.assertRaises(NoSuchElementException): 26 self.marionette.find_element(By.ID, "box0")