test(e2e): add isolated browser journey and cleanup supervision
Add a fake-only end-to-end stack, Firefox journey, and bounded process cleanup for normal, failed, and interrupted runs. Refs #12 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
21
frontend/e2e/README.md
Normal file
21
frontend/e2e/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Ticket #12 — isolated browser E2E
|
||||
|
||||
The supervisor requires Linux `/proc`, child-subreaper support and Python 3 (standard library only). Run `make test-e2e` from the project root after `make deps` and `make test-postgres`. The latter prepares the pinned embedded-postgres CLI v2.0.1/PostgreSQL 16.15.1 cache. Install Playwright's pinned Firefox beforehand if it is not already cached (`cd frontend && npx playwright install firefox`). These preparation steps may require network access; the E2E runner itself uses offline caches and never installs dependencies.
|
||||
|
||||
The runner builds the dedicated `backend/cmd/e2e` executable, starts a disposable `tradarr_e2e` database, applies the real migrations, and refuses a nonempty database. It ignores inherited application/test database URLs, chooses loopback ports, and bootstraps a reserved disposable admin. Exactly one fixture source is enabled. Provider roles refer to the loopback fake; the injected generation providers and scraper are fakes, with no concrete retrieval adapter instantiated. Production uses the same `internal/server` constructor with its existing real composition and scheduler enabled.
|
||||
|
||||
OpenFIGI, an Ollama-compatible fake Laya and a fake scraper share a loopback HTTP service with `/audit` counters and structured call events. The ranking fake extracts the real candidate UUID from the request prompt and returns it in `ranked_article_ids`; the browser assertion checks that actual UUID in audit events against the saved outcome. No hard-coded fixture ID selects a candidate.
|
||||
|
||||
The temporary private manifest declares `networkPolicy: loopback-only` and `generationProvider: fake-laya`, along with frontend/API/database/fake URLs, disposable bootstrap credentials and the cached `psql` path. The Playwright global guard validates it before opening Firefox. The manifest is generated by the runner, not a reusable configuration file. A new private work directory is created per run, with mode-0600 manifest/logs. It is removed on success, failure or interruption, along with processes and disposable DB files; build and PostgreSQL binary caches remain.
|
||||
|
||||
The Make recipe execs a launcher whose parent is make. A detached Python watchdog owns a separate worker session, monitors the original make PID/start time and a liveness pipe, and acts as a Linux child subreaper. It detects parent SIGKILL or a killed launcher without depending on shell traps. On exit it retains every observed PID/start-time identity, discovers direct children through `/proc/self/task/*/children`, signals all owned descendants (including detached groups/sessions), and escalates to SIGKILL after 1.5 seconds. An empty ancestry snapshot is never treated as proof of cleanup: completion requires the kernel's `waitpid`/`ECHILD` confirmation plus no live retained identity. It then removes the workspace. Kernel parent-death signals additionally protect the launcher, CLI worker, e2e-stack, Vite and Playwright launchers. The E2E Go main thread is kept alive for these thread-sensitive Linux guards. Cleanup is bounded; failure to terminate a process retains the workspace and reports an error. It never kills by executable name or removes shared build caches. As with any userspace watchdog, killing the watchdog itself with SIGKILL is outside this guarantee.
|
||||
|
||||
`make test-e2e-supervisor` runs offline regressions for owner/launcher SIGKILL, TERM-resistant detached grandchildren, and a deliberately empty `/proc` ancestry snapshot while a kernel-owned child remains alive. The latter fails on the original implementation; the initial three tests did not cover it.
|
||||
|
||||
`make test-e2e-timeout` launches the real runner via `timeout --foreground --preserve-status --signal=INT --kill-after=8s 8s make test-e2e`, with real disposable PostgreSQL/backend/Vite and a PATH wrapper that blocks Playwright **before** browser execution. It requires observing those real processes and a ready manifest, then verifies no surviving observed identity or workspace **immediately when timeout returns**. The test does not keep its own parent alive waiting for post-return cleanup. To use QA's actual wrapper instead of the built-in one, run `make test-e2e-timeout E2E_REPRO_WRAPPER=/absolute/QA/wrapper-directory`; a missing wrapper fails closed rather than silently running without the intended reproduction. The real E2E cleanup should also be checked with the QA PATH-wrapper/`timeout --foreground --preserve-status --signal=INT --kill-after=8s 8s make test-e2e` reproducer. The supervisor inherits the nearest enclosing GNU timeout's soft deadline from its `/proc` arguments and start time. It begins cancellation at that deadline even when make does not forward SIGINT to its recipe. For the 8s INT / 8s kill-after reproducer, cleanup must finish during the grace interval and return 130 (or make's error status), rather than relying on a watcher after exit 137. This matters when the outer execution environment tears down remaining processes as soon as timeout returns. An arbitrary SIGKILL of the entire execution namespace cannot leave a userspace watcher running.
|
||||
|
||||
The E2E executable rejects nonliteral/nonloopback destination URLs and installs an HTTP transport that refuses external egress without DNS/proxy fallback. The temporary Vite configuration removes external font/preconnect links and adds a restrictive CSP. Playwright blocks nonloopback page requests and service workers; Firefox prefetch/speculative connections are disabled. No production frontend file or retrieval adapter is changed for this policy.
|
||||
|
||||
The Firefox journey covers admin login/account creation, new-user login, explicit OpenFIGI search/selection/follow, language/ranking preferences and fake-backed generation. It compares counts and hashes for `articles`, `article_symbols` and `scrape_jobs`, verifies retired routes are 404, reads the authenticated aggregate history, verifies its single-source counters, and rejects fixture article fields and actual candidate IDs in that outcome. HTTP success through the real application is required; API/provider routes are not mocked in the browser.
|
||||
|
||||
`npm run test:e2e` alone still fails closed without a valid running stack manifest. Use `make test-e2e` for complete lifecycle management. The scenario has no automatic retry. Browser traces and logs can contain disposable credentials and are deliberately kept inside the cleaned workspace.
|
||||
7
frontend/e2e/global-setup.mjs
Normal file
7
frontend/e2e/global-setup.mjs
Normal file
@ -0,0 +1,7 @@
|
||||
import { readStackManifest } from './stack-manifest.mjs'
|
||||
|
||||
export default async function globalSetup() {
|
||||
// Fail closed before launching Firefox or making any request if the local fake
|
||||
// composition has not been supplied. This prevents accidental live-provider runs.
|
||||
readStackManifest()
|
||||
}
|
||||
86
frontend/e2e/stack-manifest.mjs
Normal file
86
frontend/e2e/stack-manifest.mjs
Normal file
@ -0,0 +1,86 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { isIP } from 'node:net'
|
||||
import { tmpdir } from 'node:os'
|
||||
import path from 'node:path'
|
||||
|
||||
const requiredURLs = [
|
||||
'frontendUrl',
|
||||
'apiUrl',
|
||||
'databaseUrl',
|
||||
'openFigiFakeUrl',
|
||||
'scraperFakeUrl',
|
||||
'layaFakeUrl',
|
||||
'fakeControlUrl',
|
||||
]
|
||||
|
||||
function loopbackURL(value, field, protocols) {
|
||||
let parsed
|
||||
try {
|
||||
parsed = new URL(value)
|
||||
} catch {
|
||||
throw new Error(`E2E fake stack manifest field ${field} must be a URL.`)
|
||||
}
|
||||
if (!protocols.includes(parsed.protocol)) {
|
||||
throw new Error(`E2E fake stack manifest field ${field} uses an unsupported protocol.`)
|
||||
}
|
||||
const hostname = parsed.hostname.replace(/^\[|\]$/g, '')
|
||||
const loopback = hostname === 'localhost' || hostname.endsWith('.localhost') ||
|
||||
(isIP(hostname) === 4 && hostname.startsWith('127.')) || hostname === '::1'
|
||||
if (!loopback) {
|
||||
throw new Error(`E2E fake stack manifest field ${field} must use a loopback host.`)
|
||||
}
|
||||
return parsed
|
||||
}
|
||||
|
||||
export function stackManifestPath() {
|
||||
return process.env.TRADARR_E2E_STACK_MANIFEST ||
|
||||
path.join(process.env.TMPDIR || tmpdir(), 'tradarr-e2e', 'stack.json')
|
||||
}
|
||||
|
||||
export function readStackManifest() {
|
||||
const manifestPath = stackManifestPath()
|
||||
let manifest
|
||||
try {
|
||||
manifest = JSON.parse(readFileSync(manifestPath, 'utf8'))
|
||||
} catch {
|
||||
throw new Error([
|
||||
`Safe E2E composition is missing: no readable stack manifest at ${manifestPath}.`,
|
||||
'No browser, application server, database, or provider was started by this run.',
|
||||
'The manifest must be produced by a loopback-only fake stack and point to a disposable E2E database.',
|
||||
].join(' '))
|
||||
}
|
||||
|
||||
if (manifest.networkPolicy !== 'loopback-only') {
|
||||
throw new Error('E2E fake stack manifest must declare networkPolicy "loopback-only".')
|
||||
}
|
||||
if (manifest.generationProvider !== 'fake-laya') {
|
||||
throw new Error('E2E fake stack manifest must declare generationProvider "fake-laya".')
|
||||
}
|
||||
for (const field of requiredURLs) {
|
||||
if (typeof manifest[field] !== 'string' || !manifest[field]) {
|
||||
throw new Error(`E2E fake stack manifest is missing ${field}.`)
|
||||
}
|
||||
loopbackURL(manifest[field], field, field === 'databaseUrl' ? ['postgres:', 'postgresql:'] : ['http:', 'https:'])
|
||||
}
|
||||
if (typeof manifest.psqlPath !== 'string' || !manifest.psqlPath.startsWith('/')) {
|
||||
throw new Error('E2E fake stack manifest must provide an absolute psqlPath for database assertions.')
|
||||
}
|
||||
if (!manifest.bootstrapAdmin?.email || !manifest.bootstrapAdmin?.password) {
|
||||
throw new Error('E2E fake stack manifest must provide disposable bootstrap admin credentials.')
|
||||
}
|
||||
for (const field of ['indexQuery', 'indexName', 'indexSymbol', 'indexFIGI', 'summarySentinel', 'articleTitle', 'articleURL', 'articleContent', 'candidateID']) {
|
||||
if (typeof manifest.fixtures?.[field] !== 'string' || !manifest.fixtures[field]) {
|
||||
throw new Error(`E2E fake stack manifest is missing fixtures.${field}.`)
|
||||
}
|
||||
}
|
||||
|
||||
const databaseURL = new URL(manifest.databaseUrl)
|
||||
const databaseName = decodeURIComponent(databaseURL.pathname.replace(/^\//, ''))
|
||||
if (!/(^|[-_])(e2e|test)([-_]|$)/i.test(databaseName)) {
|
||||
throw new Error('E2E database name must identify a disposable database with an e2e or test marker.')
|
||||
}
|
||||
if (!manifest.fakeAuditPath || !manifest.fakeAuditPath.startsWith('/')) {
|
||||
throw new Error('E2E fake stack manifest must provide an absolute fakeAuditPath.')
|
||||
}
|
||||
return { ...manifest, databaseURL }
|
||||
}
|
||||
133
frontend/e2e/ticket12-happy-path.spec.mjs
Normal file
133
frontend/e2e/ticket12-happy-path.spec.mjs
Normal file
@ -0,0 +1,133 @@
|
||||
import { execFileSync } from 'node:child_process'
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { test, expect } from '@playwright/test'
|
||||
import { readStackManifest } from './stack-manifest.mjs'
|
||||
|
||||
function articleAndJobSnapshot(stack) {
|
||||
const env = {
|
||||
...process.env,
|
||||
PGHOST: stack.databaseURL.hostname,
|
||||
PGPORT: stack.databaseURL.port || '5432',
|
||||
PGUSER: decodeURIComponent(stack.databaseURL.username),
|
||||
PGPASSWORD: decodeURIComponent(stack.databaseURL.password),
|
||||
PGDATABASE: decodeURIComponent(stack.databaseURL.pathname.slice(1)),
|
||||
PGSSLMODE: stack.databaseURL.searchParams.get('sslmode') || 'disable',
|
||||
}
|
||||
const sql = `SELECT
|
||||
(SELECT count(*)::text || ':' || coalesce(md5(string_agg(md5(row_to_json(a)::text), ',' ORDER BY row_to_json(a)::text)), md5('')) FROM public.articles a)
|
||||
|| '|' ||
|
||||
(SELECT count(*)::text || ':' || coalesce(md5(string_agg(md5(row_to_json(s)::text), ',' ORDER BY row_to_json(s)::text)), md5('')) FROM public.article_symbols s)
|
||||
|| '|' ||
|
||||
(SELECT count(*)::text || ':' || coalesce(md5(string_agg(md5(row_to_json(j)::text), ',' ORDER BY row_to_json(j)::text)), md5('')) FROM public.scrape_jobs j);`
|
||||
return execFileSync(stack.psqlPath, ['--no-psqlrc', '--tuples-only', '--no-align', '--set', 'ON_ERROR_STOP=1', '--command', sql], {
|
||||
env,
|
||||
encoding: 'utf8',
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
timeout: 10_000,
|
||||
}).trim()
|
||||
}
|
||||
|
||||
async function login(page, baseURL, email, password) {
|
||||
await page.goto(new URL('/login', baseURL).href)
|
||||
await page.getByLabel('Adresse email').fill(email)
|
||||
await page.getByLabel('Mot de passe').fill(password)
|
||||
await page.getByRole('button', { name: 'Se connecter' }).click()
|
||||
await expect(page).toHaveURL(new URL('/', baseURL).href)
|
||||
}
|
||||
|
||||
test('admin creates a user who follows a fake index and generates a private summary without article/job writes', async ({ page, request }) => {
|
||||
const stack = readStackManifest()
|
||||
await page.context().route('**/*', async route => {
|
||||
const host = new URL(route.request().url()).hostname
|
||||
if (host !== '127.0.0.1' && host !== '[::1]') return route.abort('blockedbyclient')
|
||||
return route.continue()
|
||||
})
|
||||
const baseURL = stack.frontendUrl
|
||||
const fixture = stack.fixtures
|
||||
const email = `e2e-${randomUUID()}@example.test`
|
||||
const password = `E2e-${randomUUID()}!`
|
||||
const before = articleAndJobSnapshot(stack)
|
||||
|
||||
await test.step('admin bootstrap login and account creation', async () => {
|
||||
await login(page, baseURL, stack.bootstrapAdmin.email, stack.bootstrapAdmin.password)
|
||||
await page.goto(new URL('/admin/users', baseURL).href)
|
||||
await page.getByRole('button', { name: 'Créer un compte' }).click()
|
||||
const form = page.getByRole('form', { name: 'Créer un compte' })
|
||||
await form.getByLabel('Email').fill(email)
|
||||
await form.getByLabel('Mot de passe initial').fill(password)
|
||||
await form.getByRole('button', { name: 'Créer', exact: true }).click()
|
||||
await expect(form.getByRole('status')).toHaveText('Compte créé avec succès.')
|
||||
await page.getByRole('button', { name: 'Déconnexion' }).click()
|
||||
})
|
||||
|
||||
await test.step('new user login and explicit fake OpenFIGI selection', async () => {
|
||||
await login(page, baseURL, email, password)
|
||||
await page.goto(new URL('/assets', baseURL).href)
|
||||
const query = page.getByRole('textbox', { name: 'Nom ou symbole' })
|
||||
await query.fill(fixture.indexQuery)
|
||||
await page.getByRole('button', { name: 'Rechercher' }).click()
|
||||
const results = page.getByRole('region', { name: 'Résultats de recherche' })
|
||||
await expect(results.getByText(fixture.indexName)).toBeVisible()
|
||||
await expect(results.getByText(fixture.indexSymbol)).toBeVisible()
|
||||
await results.getByRole('button', { name: 'Suivre cet indice' }).click()
|
||||
await expect(page.getByRole('region', { name: 'Indices suivis' })).toContainText(fixture.indexSymbol)
|
||||
})
|
||||
|
||||
await test.step('user saves language and ranking preferences', async () => {
|
||||
await page.goto(new URL('/preferences', baseURL).href)
|
||||
await page.getByLabel('Langue des synthèses').selectOption('en')
|
||||
await page.getByLabel('Informations utilisées par Laya pour classer les articles').selectOption('title_content')
|
||||
await page.getByRole('button', { name: 'Enregistrer' }).click()
|
||||
await expect(page.getByRole('status')).toHaveText('Préférences enregistrées.')
|
||||
})
|
||||
|
||||
await test.step('fake scraper and Laya produce an aggregate summary', async () => {
|
||||
await page.goto(new URL('/', baseURL).href)
|
||||
await page.getByRole('button', { name: 'Générer une synthèse' }).click()
|
||||
await expect(page.getByText(fixture.summarySentinel, { exact: false })).toBeVisible({ timeout: 90_000 })
|
||||
await expect(page.getByText('Langue de cette synthèse : English', { exact: true })).toBeVisible()
|
||||
for (const forbidden of [fixture.articleTitle, fixture.articleURL, fixture.articleContent, fixture.candidateID]) {
|
||||
await expect(page.getByText(forbidden, { exact: false })).toHaveCount(0)
|
||||
}
|
||||
})
|
||||
|
||||
await test.step('legacy article/job routes stay closed and database rows remain unchanged', async () => {
|
||||
const api = stack.apiUrl
|
||||
expect((await request.get(new URL('/api/articles', api).href)).status()).toBe(404)
|
||||
expect((await request.get(new URL('/api/articles/e2e-forbidden', api).href)).status()).toBe(404)
|
||||
expect((await request.get(new URL('/api/admin/scrape-jobs', api).href)).status()).toBe(404)
|
||||
expect((await request.post(new URL('/api/admin/scrape-jobs/trigger', api).href)).status()).toBe(404)
|
||||
expect(articleAndJobSnapshot(stack)).toBe(before)
|
||||
})
|
||||
|
||||
await test.step('fake-provider audit confirms every dependency stayed local', async () => {
|
||||
const response = await request.get(new URL(stack.fakeAuditPath, stack.fakeControlUrl).href)
|
||||
expect(response.ok()).toBeTruthy()
|
||||
const events = await response.json()
|
||||
expect(events.openfigiSearches).toBeGreaterThan(0)
|
||||
expect(events.scraperCalls).toBeGreaterThan(0)
|
||||
expect(events.layaRankingCalls).toBeGreaterThan(0)
|
||||
expect(events.layaSummaryCalls).toBeGreaterThan(0)
|
||||
const token = await page.evaluate(() => localStorage.getItem('token'))
|
||||
const history = await request.get(new URL('/api/summaries/generations', stack.apiUrl).href, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
expect(history.status()).toBe(200)
|
||||
const generations = await history.json()
|
||||
expect(generations.data.length).toBe(1)
|
||||
const outcome = generations.data[0].outcome
|
||||
expect(outcome.status).toBe('succeeded')
|
||||
expect(outcome.total_candidates).toBe(1)
|
||||
expect(outcome.source_stats).toHaveLength(1)
|
||||
const serialized = JSON.stringify(outcome)
|
||||
const candidateIDs = events.events.filter(event => event.kind === 'layaRankingCalls').map(event => event.candidate_id)
|
||||
expect(candidateIDs.length).toBeGreaterThan(0)
|
||||
for (const forbidden of [fixture.articleTitle, fixture.articleURL, fixture.articleContent, ...candidateIDs]) {
|
||||
expect(serialized).not.toContain(forbidden)
|
||||
await expect(page.getByText(forbidden, { exact: false })).toHaveCount(0)
|
||||
}
|
||||
for (const field of ['title', 'url', 'content', 'prompt', 'candidate_id']) {
|
||||
expect(serialized).not.toContain(`"${field}":`)
|
||||
}
|
||||
})
|
||||
})
|
||||
64
frontend/package-lock.json
generated
64
frontend/package-lock.json
generated
@ -29,6 +29,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.5",
|
||||
"@playwright/test": "1.60.0",
|
||||
"@testing-library/jest-dom": "^8.0.0",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@testing-library/user-event": "^14.6.13",
|
||||
@ -2464,6 +2465,22 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@playwright/test": {
|
||||
"version": "1.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.60.0.tgz",
|
||||
"integrity": "sha512-O71yZIbAh/PxDMNGns37GHBIfrVkEVyn+AXyIa5dOTfb4/xNvRWV+Vv/NMbNCtODB/pO7vLlF2OTmMVLhmr7Ag==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright": "1.60.0"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/number": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz",
|
||||
@ -8995,6 +9012,53 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.60.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.60.0.tgz",
|
||||
"integrity": "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright-core": "1.60.0"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.60.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.60.0.tgz",
|
||||
"integrity": "sha512-9bW6zvX/m0lEbgTKJ6YppOKx8H3VOPBMOCFh2irXFOT4BbHgrx5hPjwJYLT40Lu+4qtD36qKc/Hn56StUW57IA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright/node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/possible-typed-array-names": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
"build": "tsc -b && vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint .",
|
||||
"test": "vitest run"
|
||||
"test": "vitest run",
|
||||
"test:e2e": "playwright test --config=playwright.e2e.config.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-avatar": "^1.1.3",
|
||||
@ -32,6 +33,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.5",
|
||||
"@playwright/test": "1.60.0",
|
||||
"@testing-library/jest-dom": "^8.0.0",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@testing-library/user-event": "^14.6.13",
|
||||
|
||||
20
frontend/playwright.e2e.config.mjs
Normal file
20
frontend/playwright.e2e.config.mjs
Normal file
@ -0,0 +1,20 @@
|
||||
import { defineConfig } from '@playwright/test'
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
testMatch: '**/*.spec.mjs',
|
||||
fullyParallel: false,
|
||||
forbidOnly: Boolean(process.env.CI),
|
||||
retries: 0,
|
||||
workers: 1,
|
||||
reporter: 'list',
|
||||
timeout: 120_000,
|
||||
globalSetup: './e2e/global-setup.mjs',
|
||||
use: {
|
||||
browserName: 'firefox',
|
||||
serviceWorkers: 'block',
|
||||
launchOptions: { firefoxUserPrefs: { 'network.dns.disablePrefetch': true, 'network.prefetch-next': false, 'network.http.speculative-parallel-limit': 0 } },
|
||||
headless: true,
|
||||
trace: 'retain-on-failure',
|
||||
},
|
||||
})
|
||||
@ -1,4 +1,4 @@
|
||||
import { defineConfig } from 'vitest/config'
|
||||
import { configDefaults, defineConfig } from 'vitest/config'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import path from 'node:path'
|
||||
|
||||
@ -9,5 +9,6 @@ export default defineConfig({
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
clearMocks: true,
|
||||
exclude: [...configDefaults.exclude, 'e2e/**'],
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user