forked from fangci221/library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test_example.py for testing
- Loading branch information
Showing
3 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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() |