import { RuntimeCheck, RuntimeCheckProps } from './check'; import { Diagnostics } from './diagnostics'; import { PlaywrightCheckBundle } from './playwright-check-bundle'; import { Ref } from './ref'; import { ConfigDefaultsGetter } from './check-config'; import { CheckConfigDefaults } from '../services/checkly-config-loader'; import { Bundler } from '../services/check-parser/bundler'; export interface PlaywrightCheckProps extends Omit { /** * Path to the Playwright configuration file (playwright.config.js/ts). * This file defines test settings, browser configurations, and project structure. * * @example "playwright.config.ts" */ playwrightConfigPath: string; /** * Command to install dependencies before running tests. * Useful for ensuring test dependencies are available in the runtime environment. * * @example "npm ci" * @example "yarn install --frozen-lockfile" */ installCommand?: string; /** * Command to execute Playwright tests. * The check will automatically append configuration, project, and tag arguments. * * @defaultValue "npx playwright test" * @example "npx playwright test --grep@checkly --config=playwright.foo.config.ts" * @example "yarn playwright test" */ testCommand?: string; /** * Specific Playwright projects to run from your configuration. * Projects let you run tests in different browsers or with different settings. * * @example "chromium" * @example ["chromium", "firefox"] * @see {@link https://playwright.dev/docs/test-projects | Playwright Projects} */ pwProjects?: string | string[]; /** * Tags to filter which tests to run using Playwright's grep functionality. * Tests matching any of these tags will be executed. * * @example "@smoke" * @example ["@smoke", "@critical"] * @see {@link https://playwright.dev/docs/test-annotations#tag-tests | Playwright Test Tags} */ pwTags?: string | string[]; /** * File patterns to include when bundling the test project. * Use this to include test files, utilities, and other assets. * * @example "tests/**\/*" * @example ["tests/**\/*", "utils/**\/*", "fixtures/**\/*"] */ include?: string | string[]; /** * Name of the check group to assign this check to. * The group must exist in your project configuration. * * @deprecated Use {@link group} instead. Depending on load order, group * defaults may not work correctly when using {@link groupName} to attach the * check to a group. * @example "E2E Tests" * @example "Critical User Flows" */ groupName?: string; } /** * Creates a Playwright Check to run end-to-end tests using Playwright Test. * * Playwright check suites allow you to monitor complex user interactions and workflows * by running your existing Playwright test suites as monitoring checks. They support * multiple browsers, test filtering, and custom test commands. * * @example * ```typescript * // Basic Playwright check * new PlaywrightCheck('e2e-login', { * name: 'Login Flow E2E Test', * playwrightConfigPath: '../playwright.config.js', * frequency: Frequency.EVERY_10M, * locations: ['us-east-1', 'eu-west-1'] * }) * * // Advanced check with projects and tags * new PlaywrightCheck('critical-flows', { * name: 'Critical User Flows', * playwrightConfigPath: '../playwright.config.js', * installCommand: 'npm ci', * pwProjects: ['chromium', 'firefox'], * pwTags: ['@smoke', '@critical'], * include: ['tests/**\/*', 'utils/**\/*'], * groupName: 'E2E Tests', * frequency: Frequency.EVERY_5M * }) * ``` * * @see {@link https://www.checklyhq.com/docs/constructs/playwright-check/ | PlaywrightCheck API Reference} * @see {@link https://www.checklyhq.com/docs/detect/synthetic-monitoring/playwright-checks/overview/ | Playwright Checks Documentation} * @see {@link https://playwright.dev/ | Playwright Documentation} */ export declare class PlaywrightCheck extends RuntimeCheck { #private; installCommand?: string; testCommand?: string; playwrightConfigPath: string; pwProjects: string[]; pwTags: string[]; include: string[]; /** @deprecated Use {@link groupId} instead. Kept for compatibility with earlier versions. */ groupName?: string; constructor(logicalId: string, props: PlaywrightCheckProps); describe(): string; protected configDefaultsGetter(props: PlaywrightCheckProps): ConfigDefaultsGetter; protected validateDoubleCheck(diagnostics: Diagnostics): Promise; protected validateRetryStrategy(diagnostics: Diagnostics): Promise; protected validateHeadlessMode(diagnostics: Diagnostics): Promise; protected validateWebServerConfig(diagnostics: Diagnostics): Promise; protected validateBrowserInstallCommand(diagnostics: Diagnostics): void; validate(diagnostics: Diagnostics): Promise; getSourceFile(): string | undefined; static buildTestCommand(testCommand: string, playwrightConfigPath: string, playwrightProject?: string[], playwrightTag?: string[]): string; bundle(bundler: Bundler): Promise; synthesize(): { checkType: string; doubleCheck: boolean; runtimeId: string | undefined; environmentVariables: import("./key-value-pair").default[] | undefined; activated: boolean | undefined; muted: boolean | undefined; shouldFail: boolean | undefined; locations: (keyof import("..").Region)[] | undefined; privateLocations: undefined; tags: string[] | undefined; frequency: number | undefined; frequencyOffset: number | undefined; groupId: Ref | null; retryStrategy: import("./retry-strategy").LinearRetryStrategy | import("./retry-strategy").ExponentialRetryStrategy | import("./retry-strategy").FixedRetryStrategy | import("./retry-strategy").SingleRetryRetryStrategy | null | undefined; alertSettings: import("./alert-escalation-policy").AlertEscalation | undefined; useGlobalAlertSettings: boolean | undefined; runParallel: boolean | undefined; triggerIncident: { serviceId: Ref; severity: "MINOR" | "MEDIUM" | "MAJOR" | "CRITICAL"; name: string; description: string; notifySubscribers: boolean; } | undefined; description?: string | undefined; name: string; }; }