-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI job to run Playwright tests of main browser families against w…
…ebworker QUnit test page.
- Loading branch information
1 parent
da711fa
commit 02e57f2
Showing
5 changed files
with
66 additions
and
5 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,28 @@ | ||
// @ts-check | ||
|
||
import { defineConfig, devices } from "@playwright/test"; | ||
import { testPort, testUrl } from "./playwright.shared.mjs"; | ||
|
||
export default defineConfig({ | ||
"testDir": ".", | ||
"projects": [ | ||
{ | ||
"name": "Pixel 7 (chromium)", | ||
"use": { ...devices["Pixel 7"] } | ||
}, | ||
{ | ||
"name": "Desktop Firefox (firefox)", | ||
"use": { ...devices["Desktop Firefox"] } | ||
}, | ||
{ | ||
"name": "iPhone 13 (webkit)", | ||
"use": { ...devices["iPhone 13"] } | ||
} | ||
], | ||
"webServer": [ | ||
{ | ||
"command": `npm exec --yes -- serve --listen ${testPort}`, | ||
"url": testUrl | ||
} | ||
] | ||
}); |
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,5 @@ | ||
// @ts-check | ||
|
||
const domain = "localhost"; | ||
export const testPort = 3000; | ||
export const testUrl = `http://${domain}:${testPort}/`; |
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 @@ | ||
// @ts-check | ||
|
||
import { expect, test } from "@playwright/test"; | ||
import { testUrl } from "./playwright.shared.mjs"; | ||
|
||
const bannerId = "qunit-banner"; | ||
const failClass = "qunit-fail"; | ||
const passClass = "qunit-pass"; | ||
const failSelector = `#${bannerId}.${failClass}`; | ||
const passSelector = `#${bannerId}.${passClass}`; | ||
|
||
test("Test site QUnit", async ({ page }) => { | ||
await page.goto(testUrl); | ||
const bannerLocator = page.locator(`${passSelector}, ${failSelector}`); | ||
await bannerLocator.waitFor(); | ||
await expect(bannerLocator).toHaveClass(passClass, { "timeout": 1 }); | ||
}); |