pywright-cucumber/pytests/test_example.py
Greg Gauthier 8749d7ab37
All checks were successful
Pylint / build (3.12) (push) Successful in 19s
initial commit
2024-07-24 21:25:00 +01:00

20 lines
574 B
Python

import re
from playwright.sync_api import Page, expect
def test_has_title(page: Page):
page.goto("https://playwright.dev/")
# Expect a title "to contain" a substring.
expect(page).to_have_title(re.compile("Playwright"))
def test_get_started_link(page: Page):
page.goto("https://playwright.dev/")
# Click the get started link.
page.get_by_role("link", name="Get started").click()
# Expects page to have a heading with the name of Installation.
expect(page.get_by_role("heading", name="Installation")).to_be_visible()