Вот приспособление, которое я хочу использовать с идентификатором пользователя и паролем пользователя моими переменными в conftest.py файл:
Код: Выделить всё
@pytest.fixture(scope="session")
def role_user(set_up,useridentifier,userpassword):
page = set_up
page.get_by_test_id("identifier").fill(useridentifier)
page.get_by_test_id("password").fill(userpassword)
page.get_by_test_id("submit").click()
yield page
Код: Выделить всё
def test_login(role_user,"username","password") -> None:
page = role_user
expect(page.get_by_role("cell", name="Identifier")).to_be_visible()
Подробнее здесь: https://stackoverflow.com/questions/792 ... -test-file