--- a/testing/web-platform/meta/webdriver/tests/get_title/user_prompts.py.ini
+++ b/testing/web-platform/meta/webdriver/tests/get_title/user_prompts.py.ini
@@ -1,20 +1,20 @@
[user_prompts.py]
disabled:
if webrender: bug 1425588
- [test_title_handle_prompt_accept[capabilities0-alert\]]
+ [test_handle_prompt_accept[capabilities0-alert\]]
expected: FAIL
- [test_title_handle_prompt_accept[capabilities0-confirm\]]
+ [test_handle_prompt_accept[capabilities0-confirm\]]
expected: FAIL
- [test_title_handle_prompt_accept[capabilities0-prompt\]]
+ [test_handle_prompt_accept[capabilities0-prompt\]]
expected: FAIL
- [test_title_handle_prompt_dismiss[capabilities0-alert\]]
+ [test_handle_prompt_dismiss[capabilities0-alert\]]
expected: FAIL
- [test_title_handle_prompt_dismiss[capabilities0-confirm\]]
+ [test_handle_prompt_dismiss[capabilities0-confirm\]]
expected: FAIL
- [test_title_handle_prompt_dismiss[capabilities0-prompt\]]
+ [test_handle_prompt_dismiss[capabilities0-prompt\]]
expected: FAIL
--- a/testing/web-platform/meta/webdriver/tests/is_element_selected/user_prompts.py.ini
+++ b/testing/web-platform/meta/webdriver/tests/is_element_selected/user_prompts.py.ini
@@ -6,8 +6,13 @@
expected: FAIL
[test_handle_prompt_dismiss[capabilities0-prompt\]]
expected: FAIL
[test_handle_prompt_accept[capabilities0-alert\]]
expected: FAIL
+ [test_handle_prompt_accept[capabilities0-confirm\]]
+ expected: FAIL
+
+ [test_handle_prompt_accept[capabilities0-prompt\]]
+ expected: FAIL
--- a/testing/web-platform/tests/webdriver/tests/close_window/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/close_window/user_prompts.py
@@ -3,28 +3,16 @@ import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def close(session):
return session.transport.send(
"DELETE", "session/{session_id}/window".format(**vars(session)))
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, create_window, dialog_type):
original_handle = session.window_handle
session.window_handle = create_window()
create_dialog(dialog_type, text="dialog")
@@ -32,18 +20,34 @@ def test_handle_prompt_accept(session, c
assert_success(response)
# Asserting that the dialog was handled requires valid top-level browsing
# context, so we must switch to the original window.
session.window_handle = original_handle
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, create_window, dialog_type):
+def test_handle_prompt_default(session, create_dialog, create_window, dialog_type):
session.window_handle = create_window()
create_dialog(dialog_type, text="dialog")
response = close(session)
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/delete_cookie/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/delete_cookie/user_prompts.py
@@ -2,39 +2,43 @@ import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def delete_cookie(session, name):
return session.transport.send("DELETE", "/session/%s/cookie/%s" % (session.session_id, name))
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = delete_cookie(session, "foo")
assert_success(response)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = delete_cookie(session, "foo")
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/element_send_keys/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/element_send_keys/user_prompts.py
@@ -7,44 +7,48 @@ from tests.support.inline import inline
def element_send_keys(session, element, text):
return session.transport.send(
"POST", "/session/{session_id}/element/{element_id}/value".format(
session_id=session.session_id,
element_id=element.id),
{"text": text})
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
session.url = inline("<input>")
element = session.find.css("input", all=False)
create_dialog(dialog_type, text="dialog")
response = element_send_keys(session, element, "foo")
assert_success(response)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
session.url = inline("<input>")
element = session.find.css("input", all=False)
create_dialog(dialog_type, text="dialog")
response = element_send_keys(session, element, "foo")
assert_error(response, "unexpected alert open")
--- a/testing/web-platform/tests/webdriver/tests/execute_async_script/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/execute_async_script/user_prompts.py
@@ -22,16 +22,27 @@ def test_handle_prompt_accept(session):
response = execute_async_script(session, "window.alert('Hello');")
assert_success(response, None)
session.title
with pytest.raises(error.NoSuchAlertException):
session.alert.accept()
+@pytest.mark.capabilities({"unhandledPromptBehavior": "accept and notify"})
+def test_handle_prompt_accept_and_notify(session):
+ response = execute_async_script(session, "window.alert('Hello');")
+ assert_success(response, None)
+
+ with pytest.raises(error.UnexpectedAlertOpenException):
+ session.title
+ with pytest.raises(error.NoSuchAlertException):
+ session.alert.accept()
+
+
@pytest.mark.capabilities({"unhandledPromptBehavior": "dismiss"})
def test_handle_prompt_dismiss(session):
response = execute_async_script(session, "window.alert('Hello');")
assert_success(response, None)
session.title
with pytest.raises(error.NoSuchAlertException):
session.alert.dismiss()
@@ -43,27 +54,16 @@ def test_handle_prompt_dismiss_and_notif
assert_success(response, None)
with pytest.raises(error.UnexpectedAlertOpenException):
session.title
with pytest.raises(error.NoSuchAlertException):
session.alert.dismiss()
-@pytest.mark.capabilities({"unhandledPromptBehavior": "accept and notify"})
-def test_handle_prompt_accept_and_notify(session):
- response = execute_async_script(session, "window.alert('Hello');")
- assert_success(response, None)
-
- with pytest.raises(error.UnexpectedAlertOpenException):
- session.title
- with pytest.raises(error.NoSuchAlertException):
- session.alert.accept()
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "ignore"})
def test_handle_prompt_ignore(session):
response = execute_async_script(session, "window.alert('Hello');")
assert_success(response, None)
with pytest.raises(error.UnexpectedAlertOpenException):
session.title
session.alert.dismiss()
--- a/testing/web-platform/tests/webdriver/tests/execute_script/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/execute_script/user_prompts.py
@@ -23,16 +23,27 @@ def test_handle_prompt_accept(session):
response = execute_script(session, "window.alert('Hello');")
assert_success(response, None)
session.title
with pytest.raises(error.NoSuchAlertException):
session.alert.accept()
+@pytest.mark.capabilities({"unhandledPromptBehavior": "accept and notify"})
+def test_handle_prompt_accept_and_notify(session):
+ response = execute_script(session, "window.alert('Hello');")
+ assert_success(response, None)
+
+ with pytest.raises(error.UnexpectedAlertOpenException):
+ session.title
+ with pytest.raises(error.NoSuchAlertException):
+ session.alert.accept()
+
+
@pytest.mark.capabilities({"unhandledPromptBehavior": "dismiss"})
def test_handle_prompt_dismiss(session):
response = execute_script(session, "window.alert('Hello');")
assert_success(response, None)
session.title
with pytest.raises(error.NoSuchAlertException):
session.alert.dismiss()
@@ -44,27 +55,16 @@ def test_handle_prompt_dismiss_and_notif
assert_success(response, None)
with pytest.raises(error.UnexpectedAlertOpenException):
session.title
with pytest.raises(error.NoSuchAlertException):
session.alert.dismiss()
-@pytest.mark.capabilities({"unhandledPromptBehavior": "accept and notify"})
-def test_handle_prompt_accept_and_notify(session):
- response = execute_script(session, "window.alert('Hello');")
- assert_success(response, None)
-
- with pytest.raises(error.UnexpectedAlertOpenException):
- session.title
- with pytest.raises(error.NoSuchAlertException):
- session.alert.accept()
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "ignore"})
def test_handle_prompt_ignore(session):
response = execute_script(session, "window.alert('Hello');")
assert_success(response, None)
with pytest.raises(error.UnexpectedAlertOpenException):
session.title
session.alert.dismiss()
--- a/testing/web-platform/tests/webdriver/tests/fullscreen_window/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/fullscreen_window/user_prompts.py
@@ -2,39 +2,43 @@ import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def fullscreen(session):
return session.transport.send("POST", "session/%s/window/fullscreen" % session.session_id)
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = fullscreen(session)
assert_success(response)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = fullscreen(session)
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/get_current_url/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/get_current_url/user_prompts.py
@@ -3,44 +3,48 @@ import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
from tests.support.inline import inline
def get_current_url(session):
return session.transport.send("GET", "session/%s/url" % session.session_id)
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
session.url = inline("<title>WD doc title</title>")
expected_url = session.url
create_dialog(dialog_type, text="dialog")
response = get_current_url(session)
assert_success(response, expected_url)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
session.url = inline("<title>WD doc title</title>")
create_dialog(dialog_type, text="dialog")
response = get_current_url(session)
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/get_element_property/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/get_element_property/user_prompts.py
@@ -5,46 +5,58 @@ from tests.support.inline import inline
def get_property(session, element_id, name):
return session.transport.send(
"GET", "session/{session_id}/element/{element_id}/property/{name}".format(
session_id=session.session_id, element_id=element_id, name=name))
+@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
+@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
+def test_handle_prompt_accept(session, create_dialog, dialog_type):
+ session.url = inline("<input id=foo>")
+ element = session.find.css("#foo", all=False)
+
+ create_dialog(dialog_type, text="dialog")
+
+ response = get_property(session, element.id, "id")
+ assert_success(response, "foo")
+
+ assert_dialog_handled(session, expected_text="dialog")
+
+
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
@pytest.mark.capabilities({"unhandledPromptBehavior": "dismiss"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_dismiss(session, create_dialog, dialog_type):
session.url = inline("<input id=foo>")
element = session.find.css("#foo", all=False)
create_dialog(dialog_type, text="dialog")
response = get_property(session, element.id, "id")
assert_success(response, "foo")
assert_dialog_handled(session, expected_text="dialog")
-@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
-@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_accept(session, create_dialog, dialog_type):
- session.url = inline("<input id=foo>")
- element = session.find.css("#foo", all=False)
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
- create_dialog(dialog_type, text="dialog")
- response = get_property(session, element.id, "id")
- assert_success(response, "foo")
-
- assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_ignore():
+ """TODO"""
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
session.url = inline("<input id=foo>")
element = session.find.css("#foo", all=False)
create_dialog(dialog_type, text="dialog")
response = get_property(session, element.id, "id")
assert_error(response, "unexpected alert open")
--- a/testing/web-platform/tests/webdriver/tests/get_element_tag_name/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/get_element_tag_name/user_prompts.py
@@ -4,46 +4,58 @@ from tests.support.asserts import assert
from tests.support.inline import inline
def get_tag_name(session, element_id):
return session.transport.send("GET", "session/{session_id}/element/{element_id}/name".format(
session_id=session.session_id, element_id=element_id))
+@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
+@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
+def test_handle_prompt_accept(session, create_dialog, dialog_type):
+ session.url = inline("<input id=foo>")
+ element = session.find.css("#foo", all=False)
+
+ create_dialog(dialog_type, text="dialog")
+
+ response = get_tag_name(session, element.id)
+ assert_success(response, "input")
+
+ assert_dialog_handled(session, expected_text="dialog")
+
+
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
@pytest.mark.capabilities({"unhandledPromptBehavior": "dismiss"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_dismiss(session, create_dialog, dialog_type):
session.url = inline("<input id=foo>")
element = session.find.css("#foo", all=False)
create_dialog(dialog_type, text="dialog")
response = get_tag_name(session, element.id)
assert_success(response, "input")
assert_dialog_handled(session, expected_text="dialog")
-@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
-@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_accept(session, create_dialog, dialog_type):
- session.url = inline("<input id=foo>")
- element = session.find.css("#foo", all=False)
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
- create_dialog(dialog_type, text="dialog")
- response = get_tag_name(session, element.id)
- assert_success(response, "input")
-
- assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_ignore():
+ """TODO"""
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
session.url = inline("<input id=foo>")
element = session.find.css("#foo", all=False)
create_dialog(dialog_type, text="dialog")
response = get_tag_name(session, element.id)
assert_error(response, "unexpected alert open")
--- a/testing/web-platform/tests/webdriver/tests/get_title/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/get_title/user_prompts.py
@@ -4,46 +4,58 @@ from tests.support.asserts import assert
from tests.support.inline import inline
def get_title(session):
return session.transport.send(
"GET", "session/{session_id}/title".format(**vars(session)))
-@pytest.mark.capabilities({"unhandledPromptBehavior": "dismiss"})
+@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_title_handle_prompt_dismiss(session, create_dialog, dialog_type):
+def test_handle_prompt_accept(session, create_dialog, dialog_type):
session.url = inline("<title>WD doc title</title>")
expected_title = session.title
create_dialog(dialog_type, text="dialog")
response = get_title(session)
assert_success(response, expected_title)
assert_dialog_handled(session, expected_text="dialog")
-@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+@pytest.mark.capabilities({"unhandledPromptBehavior": "dismiss"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_title_handle_prompt_accept(session, create_dialog, dialog_type):
+def test_handle_prompt_dismiss(session, create_dialog, dialog_type):
session.url = inline("<title>WD doc title</title>")
expected_title = session.title
create_dialog(dialog_type, text="dialog")
response = get_title(session)
assert_success(response, expected_title)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_title_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
session.url = inline("<title>WD doc title</title>")
create_dialog(dialog_type, text="dialog")
response = get_title(session)
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/get_window_rect/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/get_window_rect/user_prompts.py
@@ -3,39 +3,43 @@ import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def get_window_rect(session):
return session.transport.send(
"GET", "session/{session_id}/window/rect".format(**vars(session)))
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = get_window_rect(session)
assert_success(response)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = get_window_rect(session)
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/is_element_selected/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/is_element_selected/user_prompts.py
@@ -6,46 +6,58 @@ from tests.support.inline import inline
def is_element_selected(session, element_id):
return session.transport.send(
"GET", "session/{session_id}/element/{element_id}/selected".format(
session_id=session.session_id,
element_id=element_id))
+@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
+@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
+def test_handle_prompt_accept(session, create_dialog, dialog_type):
+ session.url = inline("<input id=foo>")
+ element = session.find.css("#foo", all=False)
+
+ create_dialog(dialog_type, text="dialog")
+
+ response = is_element_selected(session, element.id)
+ assert_success(response, False)
+
+ assert_dialog_handled(session, expected_text="dialog")
+
+
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
@pytest.mark.capabilities({"unhandledPromptBehavior": "dismiss"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_dismiss(session, create_dialog, dialog_type):
session.url = inline("<input id=foo>")
element = session.find.css("#foo", all=False)
create_dialog(dialog_type, text="dialog")
response = is_element_selected(session, element.id)
assert_success(response, False)
assert_dialog_handled(session, expected_text="dialog")
-@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
-@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_accept(session, create_dialog, dialog_type):
- session.url = inline("<input id=foo>")
- element = session.find.css("#foo", all=False)
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
- create_dialog(dialog_type, text="dialog")
- response = is_element_selected(session, element.id)
- assert_success(response, False)
-
- assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_ignore():
+ """TODO"""
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
session.url = inline("<input id=foo>")
element = session.find.css("#foo", all=False)
create_dialog(dialog_type, text="dialog")
response = is_element_selected(session, element.id)
assert_error(response, "unexpected alert open")
--- a/testing/web-platform/tests/webdriver/tests/maximize_window/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/maximize_window/user_prompts.py
@@ -3,39 +3,43 @@ import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def maximize(session):
return session.transport.send(
"POST", "session/{session_id}/window/maximize".format(**vars(session)))
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = maximize(session)
assert_success(response)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = maximize(session)
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/minimize_window/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/minimize_window/user_prompts.py
@@ -3,39 +3,43 @@ import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def minimize(session):
return session.transport.send(
"POST", "session/{session_id}/window/minimize".format(**vars(session)))
-def test_handle_prompt_dismiss_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_accept_and_notify():
- """TODO"""
-
-
-def test_handle_prompt_ignore():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = minimize(session)
assert_success(response)
assert_dialog_handled(session, expected_text="dialog")
+def test_handle_prompt_accept_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
+ """TODO"""
+
+
+def test_handle_prompt_ignore():
+ """TODO"""
+
+
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
create_dialog(dialog_type, text="dialog")
response = minimize(session)
assert_error(response, "unexpected alert open")
assert_dialog_handled(session, expected_text="dialog")
--- a/testing/web-platform/tests/webdriver/tests/set_window_rect/user_prompts.py
+++ b/testing/web-platform/tests/webdriver/tests/set_window_rect/user_prompts.py
@@ -4,47 +4,47 @@ from tests.support.asserts import assert
def set_window_rect(session, rect):
return session.transport.send(
"POST", "session/{session_id}/window/rect".format(**vars(session)),
rect)
-def test_handle_prompt_dismiss():
- """TODO"""
-
-
@pytest.mark.capabilities({"unhandledPromptBehavior": "accept"})
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
def test_handle_prompt_accept(session, create_dialog, dialog_type):
original = session.window.rect
create_dialog(dialog_type, text="dialog")
response = set_window_rect(session, {"x": original["x"], "y": original["y"]})
assert_success(response)
assert_dialog_handled(session, expected_text="dialog")
-def test_handle_prompt_dismiss_and_notify():
+def test_handle_prompt_accept_and_notify():
"""TODO"""
-def test_handle_prompt_accept_and_notify():
+def test_handle_prompt_dismiss():
+ """TODO"""
+
+
+def test_handle_prompt_dismiss_and_notify():
"""TODO"""
def test_handle_prompt_ignore():
"""TODO"""
@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"])
-def test_handle_prompt_missing_value(session, create_dialog, dialog_type):
+def test_handle_prompt_default(session, create_dialog, dialog_type):
original = session.window.rect
create_dialog(dialog_type, text="dialog")
response = set_window_rect(session, {"x": original["x"],
"y": original["y"]})
assert_error(response, "unexpected alert open")