Skip to content

Commit 80037a2

Browse files
committed
Merge remote-tracking branch 'origin/claude/add-visual-regression-and-linter-fixes-011CV49AGiBFQddYG4cXHTFd'
# Conflicts: # package-lock.json # package.json
2 parents cf7a7ab + 7efd70f commit 80037a2

File tree

8 files changed

+1034
-16
lines changed

8 files changed

+1034
-16
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Initialize Visual Regression Baselines
2+
3+
# This workflow generates initial baseline screenshots
4+
# Run this manually after setting up visual regression testing
5+
6+
on:
7+
workflow_dispatch:
8+
9+
jobs:
10+
generate-baselines:
11+
timeout-minutes: 60
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20.x
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Install Playwright Browsers
30+
run: npx playwright install --with-deps chromium
31+
32+
- name: Build application
33+
run: npm run build
34+
env:
35+
NODE_ENV: production
36+
37+
- name: Generate baseline screenshots
38+
run: npm run test:e2e:update
39+
env:
40+
CI: true
41+
42+
- name: Create Pull Request with baselines
43+
uses: peter-evans/create-pull-request@v7
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
commit-message: 'chore: add initial visual regression baselines'
47+
title: 'Add Visual Regression Test Baselines'
48+
body: |
49+
## Visual Regression Test Baselines
50+
51+
This PR adds the initial baseline screenshots for visual regression testing.
52+
53+
### Generated Screenshots:
54+
- Homepage (light & dark)
55+
- Presets section (light & dark)
56+
- General section (light & dark)
57+
- Compute section (light & dark)
58+
- Storage section (light & dark)
59+
- Results display (light & dark)
60+
- Theme toggle (light & dark)
61+
62+
### Review Checklist:
63+
- [ ] Screenshots look correct in light mode
64+
- [ ] Screenshots look correct in dark mode
65+
- [ ] No sensitive information visible
66+
- [ ] All key UI components are captured
67+
68+
**Note:** These baselines will be used to detect visual regressions in future changes.
69+
branch: visual-regression-baselines
70+
delete-branch: true
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Visual Regression Tests
2+
3+
on:
4+
push:
5+
branches: [main, master, develop]
6+
pull_request:
7+
branches: [main, master, develop]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
timeout-minutes: 60
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
node-version: [20.x]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Install Playwright Browsers
32+
run: npx playwright install --with-deps chromium
33+
34+
- name: Build application
35+
run: npm run build
36+
env:
37+
NODE_ENV: production
38+
39+
- name: Run Playwright tests
40+
run: npm run test:e2e
41+
env:
42+
CI: true
43+
44+
- name: Upload test results
45+
if: always()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: playwright-report
49+
path: playwright-report/
50+
retention-days: 30
51+
52+
- name: Upload screenshots
53+
if: failure()
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: playwright-screenshots
57+
path: test-results/
58+
retention-days: 30
59+
60+
- name: Upload baseline screenshots (on main branch)
61+
if: github.ref == 'refs/heads/main' && success()
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: baseline-screenshots
65+
path: e2e/**/*-snapshots/
66+
retention-days: 90
67+
68+
update-baselines:
69+
# This job runs only when manually triggered and updates baseline screenshots
70+
if: github.event_name == 'workflow_dispatch'
71+
timeout-minutes: 60
72+
runs-on: ubuntu-latest
73+
permissions:
74+
contents: write
75+
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v4
79+
80+
- name: Setup Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: 20.x
84+
cache: 'npm'
85+
86+
- name: Install dependencies
87+
run: npm ci
88+
89+
- name: Install Playwright Browsers
90+
run: npx playwright install --with-deps chromium
91+
92+
- name: Build application
93+
run: npm run build
94+
env:
95+
NODE_ENV: production
96+
97+
- name: Update baseline screenshots
98+
run: npm run test:e2e:update
99+
env:
100+
CI: true
101+
102+
- name: Commit and push updated baselines
103+
run: |
104+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
105+
git config --local user.name "github-actions[bot]"
106+
git add e2e/**/*-snapshots/
107+
git diff --staged --quiet || git commit -m "chore: update visual regression baselines"
108+
git push

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
# testing
77
/coverage
8+
/test-results/
9+
/playwright-report/
10+
/playwright/.cache/
811

912
# next.js
1013
/.next/

0 commit comments

Comments
 (0)