2586fdb135
- 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
39 lines
1010 B
TypeScript
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' },
|
|
},
|
|
],
|
|
});
|