universo-platform-2d
63 строки · 1.6 Кб
1import { testResultDir } from '@affine-test/kit/playwright';
2import type { PlaywrightTestConfig } from '@playwright/test';
3// import { devices } from '@playwright/test';
4
5/**
6* Read environment variables from file.
7* https://github.com/motdotla/dotenv
8*/
9// require('dotenv').config();
10
11/**
12* See https://playwright.dev/docs/test-configuration.
13*/
14const config: PlaywrightTestConfig = {
15testDir: './e2e',
16fullyParallel: true,
17timeout: process.env.CI ? 300_000 : 60_000,
18outputDir: testResultDir,
19use: {
20viewport: { width: 1440, height: 800 },
21},
22reporter: process.env.CI ? 'github' : 'list',
23webServer: [
24// Intentionally not building the web, reminds you to run it by yourself.
25{
26command: 'yarn -T run start:web-static',
27port: 8080,
28timeout: 120 * 1000,
29reuseExistingServer: !process.env.CI,
30stdout: 'pipe',
31env: {
32COVERAGE: process.env.COVERAGE || 'false',
33DISTRIBUTION: 'desktop',
34},
35},
36{
37command: 'yarn workspace @affine/server start',
38port: 3010,
39timeout: 120 * 1000,
40reuseExistingServer: !process.env.CI,
41stdout: 'pipe',
42stderr: 'pipe',
43env: {
44DATABASE_URL:
45process.env.DATABASE_URL ??
46'postgresql://affine:affine@localhost:5432/affine',
47NODE_ENV: 'development',
48AFFINE_ENV: process.env.AFFINE_ENV ?? 'dev',
49DEBUG: 'affine:*',
50FORCE_COLOR: 'true',
51DEBUG_COLORS: 'true',
52MAILER_SENDER: 'noreply@toeverything.info',
53},
54},
55],
56};
57
58if (process.env.CI) {
59config.retries = 3;
60config.workers = '50%';
61}
62
63export default config;
64