Files
template-showcase/playwright.config.ts
T

49 lines
1.3 KiB
TypeScript

import { defineConfig } from '@playwright/test'
// The app runs against the fake platform in e2e/fake-platform.mjs. The optional
// module variables are withheld, so the dashboard shows every enable card (plan D13).
const platform = 'http://127.0.0.1:4010'
// The variables of the optional modules, withheld from the app under test.
const optional = new Set([
'NATS_URL',
'NATS_TOKEN',
'QDRANT_URL',
'QDRANT_API_KEY',
'REDIS_URL',
'GIT_URL',
'AWS_ENDPOINT_URL',
'AWS_ACCESS_KEY_ID',
'AWS_SECRET_ACCESS_KEY',
])
const base = Object.fromEntries(
Object.entries(process.env).filter((entry): entry is [string, string] => entry[1] !== undefined && !optional.has(entry[0])),
)
export default defineConfig({
testDir: 'e2e',
workers: 1,
reporter: [['list']],
use: { baseURL: 'http://localhost:3000' },
webServer: [
{
command: 'node e2e/fake-platform.mjs',
url: `${platform}/__e2e/health`,
reuseExistingServer: false,
},
{
command: 'npm run start',
url: 'http://localhost:3000/api/health',
reuseExistingServer: false,
timeout: 120_000,
env: {
...base,
CONUSAI_API_URL: `${platform}/api`,
CONUSAI_API_TOKEN: 'e2e-deployment-token',
CONUSAI_PROJECT_ID: 'e2e',
CONUSAI_DSN: "http://e2e@127.0.0.1:4010/1",
CONUSAI_RELEASE: 'e2e',
},
},
],
})