feat(screenshots): Playwright capture pipeline (local-only, viewport-only)

This commit is contained in:
2026-05-17 10:36:32 -07:00
parent 748fcfeb6f
commit e3b113cc2f
5 changed files with 745 additions and 7 deletions

View File

@@ -0,0 +1,33 @@
export type Shot = {
/** Stable filename id; output is src/assets/screenshots/whp/<id>.png */
id: string;
/** Path on the WHP host. Leading slash, no scheme/host. */
path: string;
/** Optional CSS selector to clip to a region instead of the full viewport */
selector?: string;
/** Optional list of selectors to redact (account ID, IPs, etc.) before snapshot */
mask?: string[];
/** Defaults: 1440x900 */
viewport?: { width: number; height: number };
/** Optional selector to wait for before capturing */
waitFor?: string;
};
/** Always-applied redactions. Per-shot mask is added on top of this list. */
export const DEFAULT_MASK: string[] = [
'[data-test="account-id"]',
'[data-test="server-hostname"]',
'[data-test="user-ip"]',
'.billing-column',
];
export const shots: Shot[] = [
{ id: 'whp-domains-add', path: '/domains/add' },
{ id: 'whp-sites-add', path: '/sites/add' },
{ id: 'whp-email-add', path: '/email/add' },
{ id: 'whp-backups-settings', path: '/backups/settings' },
{ id: 'whp-backups-history', path: '/backups/history' },
{ id: 'whp-monitor', path: '/security/monitor' },
{ id: 'whp-email-archive', path: '/email/archive' },
{ id: 'whp-resources', path: '/overview/resources' },
];