40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { defineConfig } from '@playwright/test';
|
|
import { mkdtempSync } from 'node:fs';
|
|
import { tmpdir } from 'node:os';
|
|
import path from 'node:path';
|
|
|
|
const dataDirectory =
|
|
process.env.SENDEWERK_E2E_DATA_DIR || mkdtempSync(path.join(tmpdir(), 'sendewerk-e2e-'));
|
|
const mailOutboxDirectory = path.join(dataDirectory, 'mail-outbox');
|
|
process.env.SENDEWERK_E2E_DATA_DIR = dataDirectory;
|
|
process.env.SENDEWERK_E2E_OUTBOX_DIR = mailOutboxDirectory;
|
|
|
|
export default defineConfig({
|
|
testDir: 'tests',
|
|
testMatch: '**/*.e2e.ts',
|
|
fullyParallel: false,
|
|
workers: 1,
|
|
webServer: {
|
|
command: 'npm run setup && npm run build && npm start',
|
|
url: 'http://127.0.0.1:4173/healthz',
|
|
timeout: 120_000,
|
|
reuseExistingServer: false,
|
|
env: {
|
|
SENDEWERK_DB_PATH: path.join(dataDirectory, 'e2e.sqlite'),
|
|
SENDEWERK_UPLOAD_DIR: path.join(dataDirectory, 'uploads'),
|
|
SENDEWERK_MAIL_OUTBOX_DIR: mailOutboxDirectory,
|
|
SENDEWERK_MAIL_TRANSPORT: 'local',
|
|
SENDEWERK_APP_ORIGIN: 'http://127.0.0.1:4173',
|
|
SENDEWERK_SETUP_TOKEN: 'e2e-only-setup-token-32-characters',
|
|
ORIGIN: 'http://127.0.0.1:4173',
|
|
HOST: '127.0.0.1',
|
|
PORT: '4173'
|
|
}
|
|
},
|
|
use: {
|
|
baseURL: 'http://127.0.0.1:4173',
|
|
browserName: 'chromium',
|
|
trace: 'retain-on-failure'
|
|
}
|
|
});
|