import { Codegen, Context } from './internal/codegen/index.js'; import { RuntimeCheckResource } from './check-codegen.js'; /** * The check props `PlaywrightCheckProps` leaves out that the codegen could * otherwise spell; `doubleCheck` it never spells for any class. */ export declare const PLAYWRIGHT_CHECK_OMITTED_PROPS: readonly ["retryStrategy"]; /** * Generates a `PlaywrightCheck` construct from a Playwright check suite's * API representation. * * The deploy preview is this codegen's consumer: it renders the deployed and * the local version of an updated suite as constructs and prints the * difference. `checkly import` never writes a suite: the API leaves them out * of import plans, because a suite is defined by its uploaded code bundle, * which an import plan cannot hand back as source, and the import command * refuses one on its own too (`PREVIEW_ONLY_CHECK_TYPES` in * `check-codegen.ts`). The code generated here is displayed, not written to * a project. * * What the API holds differs from what the construct takes. The construct's * `playwrightConfigPath`, `pwProjects` and `pwTags` are not stored: the CLI * folds them into `testCommand` on deploy (`PlaywrightCheck.buildTestCommand` * appends `--config `, `--project …` and `--grep |` to * the user's command, or to the package manager's `playwright test`). This * codegen unfolds that command again, so the construct reads as the user * wrote it, and prints `testCommand` only when the user's part differs from * the package manager's default (the project's current one: a suite deployed * under another package manager shows its old default as a `testCommand` * the new deploy removes). A command that is not in the CLI's own * format is printed whole and `playwrightConfigPath` is left out: the * construct requires the prop, but a made-up path would show a change that * did not happen. Such a construct would not type-check; the preview only * displays it. * * Deliberately not printed: the code bundle (`codeBundlePath`, * `codeBundleSha256`), the dependency cache hash, the Playwright version, the * browsers and the working directory. They describe the bundled project * rather than the construct's props; the API reports the bundle, the version * and the cache as changes with a cause, which the preview prints as notes * beside the construct. A `browsers` or `workingDir` change has no cause and * is not listed beside a construct diff; both derive from the bundled * Playwright project, whose change the code bundle note announces. * * A suite has no retry strategy and no double check (Playwright retries * tests itself), and no automatic check repair, so none of those is printed * whatever the API sends. */ export interface PlaywrightCheckResource extends RuntimeCheckResource { checkType: 'PLAYWRIGHT'; /** The full command the runner executes; see {@link unfoldTestCommand}. */ testCommand?: string | null; installCommand?: string | null; /** The JavaScript engine's name (`node`, `bun`) and version. */ engine?: string | null; engineVersion?: string | null; } /** A test command split into the construct props it was built from. */ export interface UnfoldedTestCommand { /** * The command without the flags the CLI appends; the whole command when it * could not be unfolded. */ command: string; playwrightConfigPath?: string; pwProjects?: string[]; pwTags?: string[]; } /** * Splits a stored test command back into the user's command and the * construct props the CLI folded into it. A bare `--config` word marks where * the CLI's part may start; the earliest one whose tail reads as the CLI's * format wins, so a user's own command keeps whatever it had before it * (spacing and quoting included) and a quoted value that merely spells a * flag is never mistaken for the boundary. A command with no such boundary * was not built by the CLI and is returned whole. * * The `--grep` pattern joins the tags with `|`, so a single tag that itself * contains `|` cannot be told from two tags and comes back as two. */ export declare function unfoldTestCommand(testCommand: string): UnfoldedTestCommand; export declare class PlaywrightCheckCodegen extends Codegen { describe(resource: PlaywrightCheckResource): string; gencode(logicalId: string, resource: PlaywrightCheckResource, context: Context): void; }