Exemplo n.º 1
0
 def tearDown(self):
     if Alert().exists():
         # We need to call .accept() instead of .dismiss() here to work
         # around ChromeDriver bug 764:
         # https://code.google.com/p/chromedriver/issues/detail?id=764
         Alert().accept()
     super(AlertAT, self).tearDown()
Exemplo n.º 2
0
 def test_alert_dismiss(self):
     Alert().dismiss()
     self._expect_result(self.get_expected_alert_dismissed_result())
Exemplo n.º 3
0
 def test_alert_accept(self):
     Alert().accept()
     self._expect_result(self.get_expected_alert_accepted_result())
Exemplo n.º 4
0
 def test_alert_text(self):
     self.assertEqual(self.get_expected_alert_text(), Alert().text)
Exemplo n.º 5
0
 def test_alert_text_not_exists(self):
     self.assertFalse(Alert('Wrong text').exists())
Exemplo n.º 6
0
 def test_alert_text_exists(self):
     self.assertTrue(Alert(self.get_expected_alert_text()).exists())
Exemplo n.º 7
0
 def test_alert_exists(self):
     self.assertTrue(Alert().exists())
Exemplo n.º 8
0
 def setUp(self):
     super(AlertAT, self).setUp()
     click(self.get_link_to_open_alert())
     wait_until(Alert().exists)
Exemplo n.º 9
0
 def test_write_into_non_existent_alert(self):
     with TemporaryAttrValue(Config, 'implicit_wait_secs', 1):
         with self.assertRaises(LookupError):
             write("8", into=Alert("Non-existent"))
Exemplo n.º 10
0
 def test_write_into_labelled_alert(self):
     write("8", into=Alert(self.get_expected_alert_text()))
     Alert().accept()
     self._expect_result("Value entered: 8")
Exemplo n.º 11
0
 def test_write_into_alert(self):
     write("7", into=Alert())
     Alert().accept()
     self._expect_result("Value entered: 7")
Exemplo n.º 12
0
 def test_write_value(self):
     write("1")
     Alert().accept()
     self._expect_result('Value entered: 1')