mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Add settings for playwright-pytest
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import re
|
||||
from playwright.sync_api import Page, expect
|
||||
|
||||
|
||||
def test_homepage_has_Playwright_in_title_and_get_started_link_linking_to_the_intro_page(page: Page):
|
||||
page.goto("https://playwright.dev/")
|
||||
|
||||
# Expect a title "to contain" a substring.
|
||||
expect(page).to_have_title(re.compile("Playwright"))
|
||||
|
||||
# create a locator
|
||||
get_started = page.get_by_role("link", name="Get started")
|
||||
|
||||
# Expect an attribute "to be strictly equal" to the value.
|
||||
expect(get_started).to_have_attribute("href", "/docs/intro")
|
||||
|
||||
# Click the get started link.
|
||||
get_started.click()
|
||||
|
||||
# Expects the URL to contain intro.
|
||||
expect(page).to_have_url(re.compile(".*intro"))
|
||||
Reference in New Issue
Block a user