Files
kestrelos/playwright.config.js
Madison Grubb fc6a34c266
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
gen tls in e2e. add snapshotting in kaniko
2026-02-12 11:06:26 -05:00

62 lines
1.8 KiB
JavaScript

import { defineConfig, devices } from '@playwright/test'
/**
* Playwright configuration for E2E tests.
* Tests live streaming flow: Mobile Safari (publisher) → Desktop Chrome/Firefox (viewer)
*/
export default defineConfig({
testDir: './test/e2e',
fullyParallel: false, // WebRTC tests need sequential execution
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
workers: 1, // Run tests sequentially for WebRTC
reporter: 'html',
globalSetup: './test/e2e/global-setup.js',
globalTeardown: './test/e2e/global-teardown.js',
use: {
baseURL: 'https://localhost:3000',
ignoreHTTPSErrors: true, // Accept self-signed certs from .dev-certs/
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'mobile-safari',
use: {
...devices['iPhone 13'],
// Use WebKit for Safari-like behavior (actual Safari requires macOS)
channel: 'webkit',
permissions: ['geolocation'],
geolocation: { latitude: 37.7749, longitude: -122.4194 },
},
},
{
name: 'desktop-chrome',
use: {
...devices['Desktop Chrome'],
launchOptions: {
args: [
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream',
],
},
},
},
{
name: 'desktop-firefox',
use: {
...devices['Desktop Firefox'],
},
},
],
webServer: {
command: 'npm run dev',
url: 'https://localhost:3000/health/ready',
reuseExistingServer: !process.env.CI, // Don't reuse in CI (always start fresh)
timeout: 180_000, // 3 minutes (180 seconds) for server startup (CI can be slower)
ignoreHTTPSErrors: true,
},
timeout: 60_000, // 60 seconds per test (WebRTC setup takes time)
})