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,
|
2023-08-29 13:07:05 +03:00
|
|
|
use: {
|
|
|
|
baseURL: 'http://localhost:8081/',
|
|
|
|
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: [
|
|
|
|
// 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',
|
2023-08-29 13:07:05 +03:00
|
|
|
NODE_ENV: 'development',
|
|
|
|
AFFINE_ENV: process.env.AFFINE_ENV ?? 'dev',
|
|
|
|
DEBUG: 'affine:*',
|
|
|
|
FORCE_COLOR: 'true',
|
|
|
|
DEBUG_COLORS: 'true',
|
2023-09-02 21:13:59 +03:00
|
|
|
ENABLE_LOCAL_EMAIL: process.env.ENABLE_LOCAL_EMAIL ?? 'true',
|
2023-08-29 13:07:05 +03:00
|
|
|
NEXTAUTH_URL: 'http://localhost:8080',
|
|
|
|
OAUTH_EMAIL_SENDER: 'noreply@toeverything.info',
|
2023-09-16 03:56:26 +03:00
|
|
|
OAUTH_EMAIL_LOGIN: 'noreply@toeverything.info',
|
|
|
|
OAUTH_EMAIL_PASSWORD: 'affine',
|
2023-08-29 13:07:05 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.env.CI) {
|
|
|
|
config.retries = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default config;
|