-
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 screenshot tests with playwright
- Loading branch information
Showing
70 changed files
with
401 additions
and
44 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
lib/tests/__screenshots__/blob/blob-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/particles/particles-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/particles/particles-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/particles/particles-firefox.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/bloom/bloom-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/bloom/bloom-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/gradient/gradient-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer-move/pointer-move-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/bloom/bloom-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/particles/particles-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer/pointer-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer/pointer-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/blob/blob-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/bloom/bloom-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/circle/circle-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/gradient/gradient-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/gradient/gradient-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer-move/pointer-move-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer/pointer-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer/pointer-firefox.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/texture/texture-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/gradient/gradient-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/texture/texture-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/texture/texture-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/blob/blob-firefox.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/bloom/bloom-firefox.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/circle/circle-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer-move/pointer-move-firefox.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/texture/texture-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/blob/blob-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/circle/circle-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/circle/circle-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer-move/pointer-move-chromium.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer/pointer-Mobile-Safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/blob/blob-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/circle/circle-firefox.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/gradient/gradient-firefox.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/particles/particles-safari.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/pointer-move/pointer-move-Mobile-Chrome.png filter=lfs diff=lfs merge=lfs -text | ||
lib/tests/__screenshots__/texture/texture-firefox.png filter=lfs diff=lfs merge=lfs -text |
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,5 @@ | ||
node_modules/ | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ |
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,7 @@ | ||
import { readdirSync } from "node:fs"; | ||
|
||
const files = readdirSync("playground/src/pages"); | ||
|
||
export const routes = files | ||
.map((file) => file.replace(".astro", "")) | ||
.filter((route) => route !== "index"); |
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
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,65 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
const desktopViewport = { width: 800, height: 400 }; | ||
const mobileViewport = { width: 360, height: 640 }; | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
testDir: "./tests", | ||
/* Run tests in files in parallel */ | ||
fullyParallel: true, | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: !!process.env.CI, | ||
/* Retry on CI only */ | ||
retries: process.env.CI ? 2 : 0, | ||
/* Opt out of parallel tests on CI. */ | ||
workers: process.env.CI ? 1 : undefined, | ||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
reporter: "html", | ||
use: { | ||
trace: "on-first-retry", | ||
}, | ||
snapshotPathTemplate: "{testDir}/__screenshots__/{testName}/{testName}-{projectName}{ext}", | ||
expect: { | ||
toMatchSnapshot: { | ||
maxDiffPixelRatio: 0.01, | ||
}, | ||
}, | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: { | ||
...devices["Desktop Chrome"], | ||
viewport: desktopViewport, | ||
launchOptions: { | ||
args: ["--use-gl=egl", "--ignore-gpu-blocklist", "--use-gl=angle"], | ||
}, | ||
}, | ||
}, | ||
|
||
{ | ||
name: "firefox", | ||
use: { ...devices["Desktop Firefox"], viewport: desktopViewport }, | ||
}, | ||
|
||
{ | ||
name: "safari", | ||
use: { ...devices["Desktop Safari"], viewport: desktopViewport }, | ||
}, | ||
{ | ||
name: "android", | ||
use: { ...devices["Pixel 5"], viewport: mobileViewport }, | ||
}, | ||
{ | ||
name: "iphone", | ||
use: { ...devices["iPhone 12"], viewport: mobileViewport }, | ||
}, | ||
], | ||
webServer: { | ||
command: "pnpm dev", | ||
url: "http://localhost:4321", | ||
reuseExistingServer: !process.env.CI, | ||
}, | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.