20 lines
912 B
Python
20 lines
912 B
Python
|
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()
|