Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2640e2

Browse files
authored
Add Playwright configuration and visual regression tests (#2170)
1 parent9cd5327 commita2640e2

File tree

6 files changed

+498
-2
lines changed

6 files changed

+498
-2
lines changed

‎.changeset/cold-months-sing.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
---
4+
5+
Add Playwright configuration and visual regression tests

‎.github/workflows/playwright.yml‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name:Playwright Tests
2+
3+
on:
4+
push:
5+
branches:
6+
-dev
7+
pull_request:
8+
paths:
9+
-'preview/**'
10+
-'core/**'
11+
12+
env:
13+
NODE:20
14+
15+
permissions:
16+
contents:read
17+
18+
jobs:
19+
test:
20+
timeout-minutes:60
21+
runs-on:ubuntu-latest
22+
steps:
23+
-name:Clone repository
24+
uses:actions/checkout@v4
25+
26+
-name:Cache turbo build setup
27+
uses:actions/cache@v4
28+
with:
29+
path:.turbo
30+
key:${{ runner.os }}-turbo-${{ github.sha }}
31+
restore-keys:|
32+
${{ runner.os }}-turbo-
33+
34+
-name:Set up Node.js
35+
uses:actions/setup-node@v4
36+
with:
37+
node-version:"${{ env.NODE }}"
38+
39+
-name:Install PNPM
40+
uses:pnpm/action-setup@v4
41+
42+
-name:Install pnpm dependencies
43+
run:pnpm install
44+
45+
-name:Install Playwright Browsers
46+
run:pnpm exec playwright install
47+
48+
-name:Run Playwright tests
49+
run:pnpm run playwright
50+
51+
-uses:actions/upload-artifact@v4
52+
if:${{ !cancelled() }}
53+
with:
54+
name:playwright-report
55+
path:playwright-report/
56+
retention-days:30

‎package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@
99
"bundlewatch":"turbo bundlewatch",
1010
"version":"changeset version",
1111
"publish":"changeset publish",
12+
"playwright":"pnpm run build && pnpm run vt",
13+
"vt":"playwright test tests",
14+
"vt-update":"playwright test tests --update-snapshots",
1215
"reformat-mdx":"node build/reformat-mdx.mjs",
1316
"start":"pnpm dev"
1417
},
1518
"packageManager":"pnpm@9.15.4",
1619
"devDependencies": {
20+
"@argos-ci/playwright":"^4.1.0",
1721
"@changesets/changelog-github":"^0.5.0",
1822
"@changesets/cli":"^2.27.12",
23+
"@playwright/test":"^1.50.1",
1924
"@rollup/plugin-babel":"^6.0.4",
2025
"@rollup/plugin-commonjs":"^28.0.2",
2126
"@rollup/plugin-node-resolve":"^16.0.0",

‎playwright.config.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import{defineConfig,devices}from"@playwright/test"
2+
3+
exportdefaultdefineConfig({
4+
testDir:"./tests",
5+
timeout:10000,
6+
fullyParallel:true,
7+
projects:[
8+
{
9+
name:"chromium",
10+
use:{ ...devices["Desktop Chrome"]},
11+
},
12+
],
13+
use:{
14+
trace:"on-first-retry",
15+
screenshot:"only-on-failure",
16+
},
17+
reporter:[
18+
process.env.CI ?["dot"] :["list"],
19+
["@argos-ci/playwright/reporter",{uploadToArgos:!!process.env.CI}],
20+
],
21+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp