Skip to content

Commit

Permalink
bug 1600078: webdriver: make test_alert_unsupported_operation Gecko s…
Browse files Browse the repository at this point in the history
…pecific; r=webdriver-reviewers,jgraham

Basic auth dialogues are not included in HTML's definition of
'user prompts': those are limited to the 'simple dialogues' such
as window.alert(), window.prompt() et al. and the print dialogue.

Since we don't want to regress this behaviour in geckodriver, this
patch removes test_alert_unsupported_operation from WPT and makes
it Mozilla-specific.

The patch doesn't remove the basic auth framework code from WPT
because it's assumed we will need that in WPT in the very near future.

Thanks-to: Carlos Garcia Campos <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D55134

--HG--
extra : moz-landing-system : lando
  • Loading branch information
andreastt committed Dec 1, 2019
1 parent 2e8639b commit 54d2893
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
20 changes: 20 additions & 0 deletions testing/web-platform/mozilla/tests/webdriver/send_alert_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from tests.support.asserts import assert_error
from tests.support.authentication import basic_authentication


def send_alert_text(session, text=None):
return session.transport.send(
"POST", "session/{session_id}/alert/text".format(**vars(session)),
{"text": text})


def test_basic_auth_unsupported_operation(session):
"""
Basic auth dialogues are not included in HTML's definition of
'user prompts': those are limited to the 'simple dialogues'
such as window.alert(), window.prompt() et al. and the print
dialogue.
"""
session.url = basic_authentication()
response = send_alert_text(session, "Federer")
assert_error(response, "unsupported operation")
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from webdriver.transport import Response

from tests.support.asserts import assert_error, assert_success
from tests.support.authentication import basic_authentication
from tests.support.inline import inline
from tests.support.sync import Poll

Expand Down Expand Up @@ -58,13 +57,6 @@ def test_alert_element_not_interactable(session, dialog_type):
assert_error(response, "element not interactable")


def test_alert_unsupported_operation(session):
session.url = basic_authentication()

response = send_alert_text(session, "Federer")
assert_error(response, "unsupported operation")


@pytest.mark.parametrize("text", ["", "Federer", " Fed erer ", "Fed\terer"])
def test_send_alert_text(session, page, text):
send_response = send_alert_text(session, text)
Expand Down

0 comments on commit 54d2893

Please sign in to comment.