UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

101 lines 3.94 kB
/** * @fileoverview Canonical Donobu test-report model. * * This is the single in-memory / on-disk shape shared between the reporter, * the auto-heal orchestrator, the merge step, and the HTML renderer. It is a * Playwright-JSON superset with explicit Donobu fields: downstream tools that * only understand Playwright JSON continue to work because unknown fields are * ignored. * * The file is intentionally loose about the inner Playwright shape (`unknown` * at the boundary, `any` inside the renderer) — the goal here is to give every * consumer one type to import and one filename to look for on disk, not to * retype the whole Playwright reporter surface. */ /** * Filename the reporter writes into each run's Playwright output directory. * The auto-heal orchestrator looks for this file (in both the initial run's * output dir and the heal-run's staging dir) to drive the merge + re-render. * * Internal contract only — not a public artifact and not guaranteed to stay * stable across Donobu versions. */ export declare const DONOBU_REPORT_STATE_FILENAME = ".donobu-report-state.json"; /** * Per-format output record written by each Donobu reporter into the shared * state file. The auto-heal orchestrator reads this map after merging two * runs and re-renders whichever formats the user has configured, landing each * result at the same path the reporter originally chose. */ export interface DonobuReportOutputs { html?: { outputFile: string; }; markdown?: { outputFile: string; }; /** * Slack-specific configuration is read from environment variables * (`DONOBU_SLACK_WEBHOOK_URL`, `DONOBU_REPORT_URL`) — see the `slack.ts` * reporter docs — so the only thing tracked per-output is where the * payload was written. */ slack?: { outputFile: string; }; } export interface DonobuReportMetadata { /** True on reports that are the result of merging an initial + heal run. */ donobuMergedReport?: boolean; mergedAtIso?: string; sources?: { initial?: string | null; autoHeal?: string | null; }; /** Absolute path to the triage run directory that produced the plans/evidence. */ triageRunDir?: string; /** Composite keys (`file::projectName::title`) of tests that auto-heal repaired. */ donobuHealedTests?: string[]; /** * Per-format output paths recorded by each configured Donobu reporter. The * orchestrator iterates this to regenerate every output after the auto-heal * merge. */ donobuOutputs?: DonobuReportOutputs; [key: string]: unknown; } /** * Donobu's canonical test-report shape. Produced by the reporter, merged by * `mergeReports`, rendered by `renderHtml`. Suites / specs / tests / results * are left as `unknown[]` here and walked with `any` inside the renderer — * the renderer already tolerates the full breadth of Playwright's JSON. * * Triage data (treatment plans, failure evidence) is loaded separately and * passed alongside a `DonobuReport` to the renderer — it is not part of the * serialized model. */ export interface DonobuReport { suites?: unknown[]; stats?: unknown; config?: unknown; errors?: unknown[]; metadata?: DonobuReportMetadata; [key: string]: unknown; } /** * A test the orchestrator has designated as healed (used to annotate the * merged report when the heal-run didn't expose the test under a matching key). * * `TPlan` is generic so callers that have a stronger type for the treatment * plan (e.g. a Zod-inferred type) can preserve it; the merge step itself only * reads `testCase`, so `unknown` is a safe default for the model's boundary. */ export interface HealedTestDescriptor<TPlan = unknown> { plan: TPlan; testCase: { title?: string; file?: string; projectName?: string; }; } //# sourceMappingURL=model.d.ts.map