send_alert_text.py (745B)
1 from tests.support.asserts import assert_error 2 from tests.support.http_handlers.authentication import basic_authentication 3 4 5 def send_alert_text(session, text=None): 6 return session.transport.send( 7 "POST", 8 "session/{session_id}/alert/text".format(**vars(session)), 9 {"text": text}, 10 ) 11 12 13 def test_basic_auth_unsupported_operation(url, session): 14 """ 15 Basic auth dialogues are not included in HTML's definition of 16 'user prompts': those are limited to the 'simple dialogues' 17 such as window.alert(), window.prompt() et al. and the print 18 dialogue. 19 """ 20 session.url = basic_authentication(url) 21 response = send_alert_text(session, "Federer") 22 assert_error(response, "unsupported operation")