Skip to content

Commit 0d641fc

Browse files
committed
Update an example
1 parent 156ff2a commit 0d641fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/handle_alert_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def test_alerts(self):
77
self.open("about:blank")
88
self.execute_script('window.alert("ALERT!!!");')
99
self.sleep(1) # Not needed (Lets you see the alert pop up)
10+
self.assert_true(self.is_alert_present())
1011
self.accept_alert()
1112
self.sleep(1) # Not needed (Lets you see the alert go away)
1213
self.execute_script('window.prompt("My Prompt","defaultText");')
@@ -15,6 +16,7 @@ def test_alerts(self):
1516
self.assert_equal(alert.text, "My Prompt") # Not input field
1617
self.dismiss_alert()
1718
self.sleep(1) # Not needed (Lets you see the alert go away)
19+
self.assert_false(self.is_alert_present())
1820
if self.browser == "safari" and self._reuse_session:
1921
# Alerts can freeze Safari if reusing the browser session
2022
self.driver.quit()

0 commit comments

Comments
 (0)