tests: the login list not open before the click on #user ends, or before the press on #pass, is a broken control, not a finding about ours
This commit is contained in:
1 parent
7ee01460c3
commit
674ba82359
1 file changed
+7
-2
@@ -19,7 +19,7 @@ from typing import Any, Iterator, List, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _stock_twin import MARIONETTE_ARGS, Chrome
|
||||
from _stock_twin import MARIONETTE_ARGS, BrokenControl, Chrome
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case, observe, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
@@ -97,11 +97,16 @@ def test_a_click_on_the_password_field_under_the_login_list_reaches_the_page(fir
|
||||
with _session(firefox_binary, monkeypatch, case) as (page, context, chrome, _sites):
|
||||
page.mouse.click(*USER_CENTRE)
|
||||
opened = wait_for(page, lambda: _list_state(chrome) == "open", DEADLINE_S)
|
||||
assert opened, "a click on #user did not open the login autocomplete list (state %r, signon.rememberSignons %r): the case would pass for nothing" % (_list_state(chrome), chrome.script(PREF_JS)["rememberSignons"])
|
||||
if not opened:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: a click on #user did not open the login autocomplete list (state %r, signon.rememberSignons %r): the case would pass for nothing"
|
||||
% (_list_state(chrome), chrome.script(PREF_JS)["rememberSignons"]))
|
||||
# The release of the first click is heard by the page after the click returned: wait for it, then start from an empty record.
|
||||
assert wait_for(page, lambda: ["click", "user"] in page.evaluate("() => window.__read()")["events"], DEADLINE_S), "the page never heard the click on #user"
|
||||
page.evaluate("() => window.__reset()")
|
||||
pages_before = len(context.pages)
|
||||
if _list_state(chrome) != "open":
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: the login autocomplete list is not open right before the press on #pass (state %r, signon.rememberSignons %r)"
|
||||
% (_list_state(chrome), chrome.script(PREF_JS)["rememberSignons"]))
|
||||
|
||||
page.mouse.click(*PASS_CENTRE)
|
||||
|
||||
|
||||
Reference in new issue
Block a user