platform-codebase/features/webmap/e2e/playwright.config.ts

52 lines
1.3 KiB
TypeScript
Executable file

import { defineConfig, devices } from '@playwright/test';
/**
* Playwright config for webmap staging verification tests
*
* Run all staging tests:
* npx playwright test
*
* Run specific site:
* STAGING_URL=http://next.www.atlilith.com npx playwright test staging.spec.ts
* TRUSTEDMEET_STAGING_URL=http://next.www.trustedmeet.com npx playwright test staging-trustedmeet.spec.ts
*/
export default defineConfig({
testDir: '.',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? 'github' : 'html',
use: {
trace: 'on-first-retry',
screenshot: 'only-on-failure',
// Allow self-signed certificates for staging environments
ignoreHTTPSErrors: true,
// Extra HTTP headers for webmap routing (Host header)
extraHTTPHeaders: process.env.STAGING_HOST
? { Host: process.env.STAGING_HOST }
: undefined,
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Additional args to handle self-signed certificates in staging
launchOptions: {
args: ['--ignore-certificate-errors'],
},
},
},
],
// Timeout for each test
timeout: 30000,
// Expect timeout
expect: {
timeout: 10000,
},
});