//#region src/runtime/step-evidence.d.ts /** * Step-boundary screenshot capture for tests ccqa generates for external * targets (Playwright today). Generated tests import this through the * `ccqa/step-evidence` subpath and call it at each spec-step boundary; the * `.png` + `.json` pairs it writes are exactly what `ccqa run`'s * report loader consumes, so an external target's rows carry the same * per-step evidence the built-in agent-browser path produces. * * Two constraints shape the whole module: * * - **No test-framework dependency.** The page handle is typed * structurally, so ccqa never imports `@playwright/test` and a consumer * installs nothing beyond ccqa itself. Any object exposing these three * members works — including a Playwright `Page`. * - **Never fail the user's test.** Capture is best-effort: every error is * swallowed with a stderr note. A missing screenshot costs a frame in the * report; it must never flip a passing spec to red. * * Capture is opt-in at runtime via `CCQA_EVIDENCE_DIR`, which only `ccqa run` * sets. Running the generated test directly (or through the generation-time * verify/fix loop) writes nothing. */ /** * The subset of a browser page this module needs. Structural by design — see * the module comment. */ interface CcqaEvidencePage { screenshot(options: { path: string; }): Promise; url(): string; title(): Promise; } /** * Capture the screen as the step is entered. Pair with `ccqaStepAfter` at the * end of the same step. */ declare function ccqaStepBefore(page: CcqaEvidencePage, stepId: string, source: string): Promise; /** * Capture the screen as the step closes and finalise the step's metadata: * the closing shot becomes the step's primary screenshot, the entry shot (if * one was taken) rides along as `beforePngFile`, and the "did not complete" * caption written by `ccqaStepBefore` is cleared. * * If the closing shot itself fails, the step still COMPLETED — it just lost its * final frame. Rewrite the meta without the failure caption (keeping the entry * shot as the frame) so a passing step doesn't render red; the capture failure * is surfaced via the stderr warn in `capture()`. */ declare function ccqaStepAfter(page: CcqaEvidencePage, stepId: string, source: string): Promise; //#endregion export { CcqaEvidencePage, ccqaStepAfter, ccqaStepBefore };