mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 19:19:52 +03:00
Adds a label-triggered GitHub Actions workflow that automatically generates before/after screenshots when web UI changes are made in a PR. Uses smart dependency analysis to only screenshot pages affected by the changed files. Key components: - Reverse dependency analyzer: traces changed files through the import graph to find which +page.svelte routes are affected - Screenshot scenarios: Playwright tests using existing mock-network infrastructure (no Docker/backend needed) for fast, deterministic screenshots - Pixel comparison: generates diff images highlighting changed pixels - GitHub Actions workflow: triggered by 'visual-review' label, posts results as a PR comment with change percentages per page https://claude.ai/code/session_01XSTqDJXuR4jaLN7SGm3uES
28 lines
585 B
TypeScript
28 lines
585 B
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
const baseUrl = process.env.SCREENSHOT_BASE_URL ?? 'http://127.0.0.1:4173';
|
|
|
|
export default defineConfig({
|
|
testDir: './src/screenshots',
|
|
testMatch: /run-scenarios\.ts/,
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: 0,
|
|
reporter: 'list',
|
|
use: {
|
|
baseURL: baseUrl,
|
|
screenshot: 'off',
|
|
trace: 'off',
|
|
},
|
|
workers: 1,
|
|
projects: [
|
|
{
|
|
name: 'screenshots',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
viewport: { width: 1920, height: 1080 },
|
|
},
|
|
},
|
|
],
|
|
});
|