AFFiNE/playwright.config.ts

42 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-11-10 15:51:06 +03:00
import type { PlaywrightTestConfig } from '@playwright/test';
// import { devices } from '@playwright/test';
2022-11-10 15:51:06 +03:00
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './tests',
timeout: 30 * 1000,
use: {
browserName: 'chromium',
viewport: { width: 1440, height: 800 },
actionTimeout: 5 * 1000,
// Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer
// You can open traces locally(`npx playwright show-trace trace.zip`)
// or in your browser on [Playwright Trace Viewer](https://trace.playwright.dev/).
2022-11-10 15:51:06 +03:00
trace: 'on-first-retry',
// Record video only when retrying a test for the first time.
video: 'on-first-retry',
2022-11-10 15:51:06 +03:00
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? '100%' : undefined,
2022-11-10 15:51:06 +03:00
webServer: {
command: 'pnpm build && pnpm start -p 8080',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
2022-11-10 15:51:06 +03:00
},
};
export default config;