Open History to see the last commit
1import { test as base } from '@playwright/test'
2
3const AIMOCK_PORT = 4010
4
5export type AIMockFixture = {
6 testId: string
7 aimockPort: number
8}
9
10// aimock is started in globalSetup and shared across all workers.
11// Tests only need testId (for sequenceIndex isolation) and aimockPort.
12export const test = base.extend<AIMockFixture>({
13 aimockPort: [
14 async ({}, use) => {
15 await use(AIMOCK_PORT)
16 },
17 { scope: 'worker' },
18 ],
19
20 // Test-scoped: unique ID per test for sequenceIndex isolation
21 testId: async ({}, use, testInfo) => {
22 const id = `${testInfo.workerIndex}-${testInfo.testId}`
23 await use(id)
24 },
25})
26
27export { expect } from '@playwright/test'