/** * Sequential spans of Playwrght test. */ import type { TestStatus } from '@playwright/test/reporter'; export type TestTimings = { testId: string; projectName: string; tags: string[]; workerIndex: number; parallelIndex: number; mergeReportId?: string; status: TestStatus; retry: number; startTime: number; totalDuration: number; beforeHooks: HookSpan[]; beforeFixtures: FixtureSpan[]; testBody: TestBodySpan; afterHooks: HookSpan[]; afterFixtures: FixtureSpan[]; }; export type Span = TestBodySpan | HookSpan | FixtureSpan; export type SpanScope = 'test' | 'worker'; export type SpanStage = 'setup' | 'teardown'; export type BaseSpan = { title: string; startTime: number; duration: number; location: SpanLocation; error?: SpanError; }; export type TestBodySpan = Omit & { type: 'testBody'; title: string[]; }; export type HookSpan = BaseSpan & { type: 'hook'; scope: SpanScope; stage: SpanStage; }; export type FixtureSpan = BaseSpan & { type: 'fixture'; scope: SpanScope; stage: SpanStage; executedPart: 'setup' | 'teardown' | 'full-run'; fromHook?: boolean; setupDuration: number; teardownDuration: number; }; export type SpanError = { message: string; location: SpanLocation; }; export type SpanLocation = { file: string; line: number; column: number; };