Skip to content

Commit c4343a3

Browse files
committed
[py] complete test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert
1 parent bea8f71 commit c4343a3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: py/test/selenium/webdriver/common/alerts_tests.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,16 @@ def test_should_allow_users_to_accept_an_alert_in_anested_frame(driver, pages):
184184

185185
assert "Testing Alerts" == driver.title
186186

187+
@pytest.mark.xfail_safari
188+
def test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert(driver, pages):
189+
pages.load("alerts.html")
190+
driver.find_element(By.ID, "alert").click()
191+
WebDriverWait(driver, 5).until(EC.alert_is_present())
187192

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
193+
with pytest.raises(UnexpectedAlertPresentException):
194+
driver.find_element(By.ID, "select").click()
195+
alert = _wait_for_alert(driver)
196+
alert.dismiss()
191197

192198

193199
def test_prompt_should_use_default_value_if_no_keys_sent(driver, pages):

0 commit comments

Comments
 (0)