chore(tests): use new_page fixture in login one
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run

So to have the js console relayed in the terminal
This commit is contained in:
Yohan Boniface 2024-12-18 17:44:30 +01:00
parent 0eedc47079
commit 24511d796d

View file

@ -51,12 +51,12 @@ def page(new_page):
@pytest.fixture
def login(context, settings, live_server):
def do_login(user):
def login(new_page, settings, live_server):
def do_login(user, **kwargs):
# TODO use storage state to do login only once per session
# https://playwright.dev/python/docs/auth
settings.ENABLE_ACCOUNT_LOGIN = True
page = context.new_page()
page = new_page(**kwargs)
page.goto(f"{live_server.url}/en/")
page.locator(".login").click()
page.get_by_placeholder("Username").fill(user.username)