-
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.
- Loading branch information
1 parent
3dfe6e1
commit 9547c7f
Showing
1 changed file
with
10 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
from playwright.sync_api import sync_playwright | ||
import pytest | ||
from playwright.async_api import async_playwright | ||
|
||
def test_firstload(browser_type): | ||
with sync_playwright() as p: | ||
browser = getattr(p, browser_type).launch(headless=False) | ||
page = browser.new_page() | ||
page.goto("https://joshuamae.com") | ||
title = page.title() | ||
assert title == "Joshua Mae", f"Title was '{title}', but expected 'Joshua Mae'" | ||
browser.close() | ||
|
||
def main(): | ||
browsers = ["chromium", "firefox", "webkit"] | ||
for browser_type in browsers: | ||
print(f"Testing on {browser_type}...") | ||
test_example(browser_type) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
@pytest.mark.parametrize("browser_name", ["chromium", "firefox", "webkit"]) | ||
async def test_firstload(browser_name, browser_type, context): | ||
browser = await browser_type.launch() | ||
page = await context.new_page() | ||
await page.goto("https://joshuamae.com") | ||
title = await page.title() | ||
assert title == "Joshua Mae", f"Title was '{title}', but expected 'Joshua Mae'" | ||
await browser.close() |