mirror of
https://github.com/umap-project/umap.git
synced 2025-05-02 04:52:22 +02:00
18 lines
607 B
Python
18 lines
607 B
Python
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def login(context, settings, live_server):
|
|
def do_login(user):
|
|
# 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.goto(f"{live_server.url}/en/")
|
|
page.locator(".login").click()
|
|
page.get_by_placeholder("Username").fill(user.username)
|
|
page.get_by_placeholder("Password").fill("123123")
|
|
page.locator('#login_form input[type="submit"]').click()
|
|
return page
|
|
|
|
return do_login
|