Skip to content

Commit 94aec15

Browse files
authored
[py] Add missing test (SeleniumHQ#15559)
Adds test for: test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert
1 parent 70dd7d4 commit 94aec15

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

py/test/selenium/webdriver/common/alerts_tests.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,15 @@ def test_should_allow_users_to_accept_an_alert_in_anested_frame(driver, pages):
185185
assert "Testing Alerts" == driver.title
186186

187187

188-
def test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert():
189-
pass
190-
# //TODO(David) Complete this test
188+
@pytest.mark.xfail_safari
189+
def test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert(driver, pages):
190+
pages.load("alerts.html")
191+
driver.find_element(By.ID, "alert").click()
192+
WebDriverWait(driver, 5).until(EC.alert_is_present())
193+
194+
with pytest.raises(UnexpectedAlertPresentException):
195+
driver.find_element(By.ID, "select").click()
196+
# Alert would be dismissed automatically
191197

192198

193199
def test_prompt_should_use_default_value_if_no_keys_sent(driver, pages):

0 commit comments

Comments
 (0)