import { TestResult } from '@playwright/test/reporter'; import { Attachment } from 'qase-javascript-commons'; import { StepIndex } from './step-index'; type ArrayItemType = T extends (infer R)[] ? R : never; export interface TestCaseMetadata { ids: number[]; /** Multi-project mapping: project code -> test case IDs. */ projectMapping?: Record; title: string; fields: Record; parameters: Record; groupParams: Record; attachments: Attachment[]; ignore: boolean; suite: string; comment: string; tags: string[]; } /** * Parses Playwright `result.attachments` into a `TestCaseMetadata` object and, * as a side effect, routes per-step attachments into the supplied `StepIndex`. * * Recognised attachment shapes: * - `qase-metadata` content type — JSON metadata payload (ids/title/fields/...). * - profiler steps content type — skipped here; merged later in onTestEnd. * - `step_attach_(body|file)__` — routed to the parent step's * attachment list inside `StepIndex`. * - everything else — appended to the test-level attachment list. */ export declare class MetadataExtractor { private readonly stepIndex; constructor(stepIndex: StepIndex); transform(testAttachments: ArrayItemType[]): TestCaseMetadata; } export {};