-
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 Playwright tests for browser functionality
- Loading branch information
Showing
6 changed files
with
41 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./core"; | ||
export * from "./core"; |
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,23 @@ | ||
import { expect, test } from "@playwright/test"; | ||
test.describe("Playwright Browser Testing", () => { | ||
test("should navigate to a page and check title", async ({ page }) => { | ||
await page.goto("https://example.com"); | ||
const title = await page.title(); | ||
expect(title).toBe("Example Domain"); | ||
}); | ||
|
||
// test('should find an element and check its text', async ({ page }) => { | ||
// await page.goto('https://example.com'); | ||
// const text = await page.locator('h1').innerText(); | ||
// expect(text).toBe('Example Domain'); | ||
// }); | ||
// | ||
// test('should take a screenshot', async ({ page }) => { | ||
// await page.goto('https://example.com'); | ||
// await page.screenshot({ path: 'screenshot.png' }); | ||
// // Optionally check the file existence | ||
// const fs = await import('fs/promises'); | ||
// const exists = await fs.access('screenshot.png').then(() => true).catch(() => false); | ||
// expect(exists).toBe(true); | ||
// }); | ||
}); |
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 @@ | ||
https://playwright.dev/docs/running-tests |
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