33 lines
948 B
TypeScript
33 lines
948 B
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
const port = Number(process.env.PLAYWRIGHT_PORT ?? 43119);
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: false,
|
|
workers: 1,
|
|
timeout: 90_000,
|
|
forbidOnly: Boolean(process.env.CI),
|
|
retries: process.env.CI ? 2 : 0,
|
|
reporter: 'line',
|
|
expect: { timeout: 30_000 },
|
|
use: {
|
|
baseURL: `http://127.0.0.1:${port}`,
|
|
actionTimeout: 15_000,
|
|
navigationTimeout: 60_000,
|
|
trace: 'retain-on-failure',
|
|
},
|
|
projects: [
|
|
{ name: 'desktop-chromium', use: { ...devices['Desktop Chrome'], channel: 'chrome' } },
|
|
{ name: 'mobile-chromium', use: { ...devices['Pixel 7'], channel: 'chrome' } },
|
|
],
|
|
webServer: {
|
|
command: 'node server.js',
|
|
cwd: '.next/standalone',
|
|
env: { ...process.env, HOSTNAME: '127.0.0.1', PORT: String(port) },
|
|
url: `http://127.0.0.1:${port}`,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120_000,
|
|
},
|
|
});
|