Playwright_Python/PWjohnmediaPY/playvright/codegen_test_tutorial/test_iphone.py

17 lines
581 B
Python
Raw Permalink Normal View History

2023-08-15 16:39:40 +00:00
import pytest
from playwright.sync_api import Page, expect
@pytest.fixture(scope="session")
def browser_context_args(browser_context_args, playwright):
return {**playwright.devices["iPhone 13"]}
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_sauce")
page.locator("[data-test=\"login-button\"]").click()