/** * Worker-level hooks: BeforeAll / AfterAll. */ import { WorkerInfo } from '@playwright/test'; import { KeyValue, PlaywrightLocation, TestTypeCommon } from '../playwright/types'; import { HookConstructorOptions } from './shared'; import { TagsExpression } from '../steps/tags'; export type WorkerHookType = 'beforeAll' | 'afterAll'; type WorkerHookOptions = { name?: string; tags?: string; timeout?: number; }; type WorkerHookFixtures = { $workerInfo: WorkerInfo; [key: string]: unknown; }; type WorkerHookFn = (fixtures: Fixtures) => unknown; export type WorkerHook = { type: WorkerHookType; options: WorkerHookOptions; fn: WorkerHookFn; tagsExpression?: TagsExpression; location: PlaywrightLocation; customTest?: TestTypeCommon; defaultTags?: string; executed?: boolean; }; export type WorkerHookRunInfo = { test: TestTypeCommon; hook: WorkerHook; fixtures: WorkerHookFixtures; }; /** * When calling BeforeAll() / AfterAll() you can pass: * 1. hook fn * 2. options object + hook fn * * See: https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/api_reference.md#afteralloptions-fn */ type WorkerHookDefinitionArgs = [WorkerHookFn] | [WorkerHookOptions, WorkerHookFn]; /** * Returns BeforeAll() / AfterAll() functions. */ export declare function workerHookFactory(type: WorkerHookType, { customTest, defaultTags }: HookConstructorOptions): (...args: WorkerHookDefinitionArgs) => void; export declare function runWorkerHooks(hooksRunInfo: Map): Promise; export declare function getWorkerHooksToRun(type: WorkerHookType, tags: string[]): WorkerHook[]; export declare function getWorkerHooksFixtureNames(hooks: WorkerHook[]): string[]; export {}; //# sourceMappingURL=worker.d.ts.map