Files
SlabUploader/frontend/test/bvt/playwright.config.ts
T
grokbot_ty 2586fdb135 test(gate-b): update Playwright assertions for cutout-on-checkerboard (#55)
- live-mask.spec.ts: replace green-overlay avgAlpha assertions with
  checkerboard + slab pixel detection; add green-overlay color rejection
  check; fix hasColorVariance false-positive with monochrome test image
- mask-ux.spec.ts: rename test to match new rendering (no green overlay)
- playwright.config.ts: set baseURL when webServer is used so page.goto('/')
  resolves correctly in local dev

Fixes: issue #55 mask preview
2026-09-08 00:35:08 +00:00

39 lines
1010 B
TypeScript

import { defineConfig } from '@playwright/test';
import { fileURLToPath } from 'node:url';
import * as path from 'node:path';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// Allow overriding via env for remote testing (e.g. against deployed instance).
const BASE_URL = process.env.PLAYWRIGHT_BASE_URL || undefined;
export default defineConfig({
testDir: '.',
fullyParallel: true,
forbidOnly: false,
retries: 2,
workers: 1,
use: {
trace: 'on-first-retry',
screenshot: 'only-on-failure',
baseURL: BASE_URL || 'http://localhost:18080',
// Ignore self-signed TLS certs on deployed hosts.
ignoreHTTPSErrors: true,
},
webServer: BASE_URL
? undefined
: {
command: 'npx sirv build --port 18080',
port: 18080,
reuseExistingServer: true,
cwd: path.resolve(__dirname, '../../'),
stdout: 'ignore',
stderr: 'pipe',
},
projects: [
{
name: 'chromium',
use: { browserName: 'chromium' },
},
],
});