new test framework #1
1 changed files with 20 additions and 0 deletions
20
src/tests_wordpress/test_wordpress_localization.py
Normal file
20
src/tests_wordpress/test_wordpress_localization.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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_wordpress(admin_session):
|
||||
context, page = admin_session
|
||||
with page.expect_popup() as info:
|
||||
page.get_by_role("link", name="Wordpress").click()
|
||||
|
||||
wordpress = info.value
|
||||
check_for(wordpress.locator("#wpcontent"))
|
||||
if CONFIG["locale"] == "de":
|
||||
check_for(wordpress.get_by_role("heading", name="Willkommen bei WordPress!"))
|
||||
context.tracing.stop(path=f"{RECORDS}/wordpress.zip")
|
||||
Loading…
Add table
Add a link
Reference in a new issue