2024-02-05 07:10:17 +03:00
|
|
|
import { testResultDir } from '@affine-test/kit/playwright';
|
2023-09-17 23:26:06 +03:00
|
|
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
|
|
|
// import { devices } from '@playwright/test';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read environment variables from file.
|
|
|
|
* https://github.com/motdotla/dotenv
|
|
|
|
*/
|
|
|
|
// require('dotenv').config();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See https://playwright.dev/docs/test-configuration.
|
|
|
|
*/
|
|
|
|
const config: PlaywrightTestConfig = {
|
|
|
|
testDir: './e2e',
|
|
|
|
fullyParallel: true,
|
|
|
|
timeout: process.env.CI ? 50_000 : 30_000,
|
2024-02-05 07:10:17 +03:00
|
|
|
outputDir: testResultDir,
|
2023-09-17 23:26:06 +03:00
|
|
|
use: {
|
|
|
|
viewport: { width: 1440, height: 800 },
|
|
|
|
},
|
|
|
|
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,
|
2024-03-28 13:24:25 +03:00
|
|
|
stdout: 'pipe',
|
2023-09-17 23:26:06 +03:00
|
|
|
env: {
|
|
|
|
COVERAGE: process.env.COVERAGE || 'false',
|
2024-03-28 13:24:25 +03:00
|
|
|
DISTRIBUTION: 'desktop',
|
2023-09-17 23:26:06 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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 ??
|
|
|
|
'postgresql://affine:affine@localhost:5432/affine',
|
|
|
|
NODE_ENV: 'development',
|
|
|
|
AFFINE_ENV: process.env.AFFINE_ENV ?? 'dev',
|
|
|
|
DEBUG: 'affine:*',
|
|
|
|
FORCE_COLOR: 'true',
|
|
|
|
DEBUG_COLORS: 'true',
|
2024-02-19 17:37:08 +03:00
|
|
|
MAILER_SENDER: 'noreply@toeverything.info',
|
2023-09-17 23:26:06 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.env.CI) {
|
|
|
|
config.retries = 3;
|
|
|
|
config.workers = '50%';
|
|
|
|
}
|
|
|
|
|
|
|
|
export default config;
|