2024-02-05 07:10:17 +03:00
|
|
|
import { testResultDir } from '@affine-test/kit/playwright';
|
2023-08-29 13:07:05 +03:00
|
|
|
import type {
|
|
|
|
PlaywrightTestConfig,
|
|
|
|
PlaywrightWorkerOptions,
|
|
|
|
} from '@playwright/test';
|
|
|
|
|
|
|
|
const config: PlaywrightTestConfig = {
|
|
|
|
testDir: './e2e',
|
|
|
|
fullyParallel: !process.env.CI,
|
2023-12-06 13:15:03 +03:00
|
|
|
timeout: 120_000,
|
2024-02-05 07:10:17 +03:00
|
|
|
outputDir: testResultDir,
|
2023-08-29 13:07:05 +03:00
|
|
|
use: {
|
2024-07-18 09:33:52 +03:00
|
|
|
baseURL: 'http://localhost:8080/',
|
2023-08-29 13:07:05 +03:00
|
|
|
browserName:
|
|
|
|
(process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ??
|
|
|
|
'chromium',
|
|
|
|
permissions: ['clipboard-read', 'clipboard-write'],
|
|
|
|
viewport: { width: 1440, height: 800 },
|
2023-09-13 19:54:02 +03:00
|
|
|
actionTimeout: 10 * 1000,
|
2023-08-29 13:07:05 +03:00
|
|
|
locale: 'en-US',
|
2023-09-13 19:54:02 +03:00
|
|
|
trace: 'on',
|
|
|
|
video: 'on',
|
2023-08-29 13:07:05 +03:00
|
|
|
},
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
workers: process.env.CI ? 1 : 4,
|
|
|
|
retries: 1,
|
|
|
|
reporter: process.env.CI ? 'github' : 'list',
|
|
|
|
webServer: [
|
2024-07-18 09:33:52 +03:00
|
|
|
{
|
|
|
|
command: 'yarn run serve:test-static',
|
|
|
|
port: 8081,
|
|
|
|
timeout: 120 * 1000,
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
env: {
|
|
|
|
COVERAGE: process.env.COVERAGE || 'false',
|
|
|
|
ENABLE_DEBUG_PAGE: '1',
|
|
|
|
},
|
|
|
|
},
|
2023-08-29 13:07:05 +03:00
|
|
|
// Intentionally not building the web, reminds you to run it by yourself.
|
|
|
|
{
|
|
|
|
command: 'yarn -T run start:web-static',
|
|
|
|
port: 8080,
|
|
|
|
timeout: 120 * 1000,
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
env: {
|
|
|
|
COVERAGE: process.env.COVERAGE || 'false',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
command: 'yarn workspace @affine/server start',
|
|
|
|
port: 3010,
|
|
|
|
timeout: 120 * 1000,
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
stdout: 'pipe',
|
|
|
|
stderr: 'pipe',
|
|
|
|
env: {
|
|
|
|
DATABASE_URL:
|
|
|
|
process.env.DATABASE_URL ??
|
2023-09-13 19:54:02 +03:00
|
|
|
'postgresql://affine:affine@localhost:5432/affine',
|
2024-07-19 06:31:01 +03:00
|
|
|
NODE_ENV: 'development',
|
2023-08-29 13:07:05 +03:00
|
|
|
AFFINE_ENV: process.env.AFFINE_ENV ?? 'dev',
|
|
|
|
DEBUG: 'affine:*',
|
|
|
|
FORCE_COLOR: 'true',
|
|
|
|
DEBUG_COLORS: 'true',
|
2024-02-19 17:37:08 +03:00
|
|
|
MAILER_HOST: '0.0.0.0',
|
|
|
|
MAILER_PORT: '1025',
|
|
|
|
MAILER_SENDER: 'noreply@toeverything.info',
|
|
|
|
MAILER_USER: 'noreply@toeverything.info',
|
|
|
|
MAILER_PASSWORD: 'affine',
|
2023-08-29 13:07:05 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.env.CI) {
|
|
|
|
config.retries = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default config;
|