Playwright_Python/PWjohnmediaPY/playvright/codegen_test_tutorial/test_rozmery.py

20 lines
912 B
Python
Raw Normal View History

2023-08-15 16:39:40 +00:00
from playwright.sync_api import Page, expect
@pytest.fixture(scope="session")
def browser_context_args(browser_context_args, playwright):
return {"viewport": {"width":763,"height":481}}
def test_example(page: Page) -> None:
page.goto("https://www.saucedemo.com/")
page.locator("[data-test=\"username\"]").click()
page.locator("[data-test=\"username\"]").fill("standard_user")
page.locator("[data-test=\"password\"]").click()
page.locator("[data-test=\"password\"]").fill("secret_user")
page.locator("[data-test=\"login-button\"]").click()
page.get_by_text("Epic sadface: Username and password do not match any user in this serviceLoginAc").click()
page.locator("[data-test=\"password\"]").click()
page.locator("[data-test=\"password\"]").click()
page.locator("[data-test=\"password\"]").fill("secret_sauce")
page.locator("[data-test=\"login-button\"]").click()