Skip to content

[py] complete test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert #15559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 16, 2025
12 changes: 9 additions & 3 deletions py/test/selenium/webdriver/common/alerts_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,15 @@ def test_should_allow_users_to_accept_an_alert_in_anested_frame(driver, pages):
assert "Testing Alerts" == driver.title


def test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert():
pass
# //TODO(David) Complete this test
@pytest.mark.xfail_safari
def test_should_throw_an_exception_if_an_alert_has_not_been_dealt_with_and_dismiss_the_alert(driver, pages):
pages.load("alerts.html")
driver.find_element(By.ID, "alert").click()
WebDriverWait(driver, 5).until(EC.alert_is_present())

with pytest.raises(UnexpectedAlertPresentException):
driver.find_element(By.ID, "select").click()
# Alert would be dismissed automatically


def test_prompt_should_use_default_value_if_no_keys_sent(driver, pages):
Expand Down
Loading