import { CheckProps, RuntimeCheck, RuntimeCheckProps } from './check'; import { Content, Entrypoint } from './construct'; import { PlaywrightConfig } from './playwright-config'; import { Diagnostics } from './diagnostics'; import { BrowserCheckBundle } from './browser-check-bundle'; import { ConfigDefaultsGetter } from './check-config'; import { CheckConfigDefaults } from '../services/checkly-config-loader'; import { Bundler } from '../services/check-parser/bundler'; export interface BrowserCheckProps extends RuntimeCheckProps { /** * A valid piece of Node.js javascript code describing a browser interaction * with the Puppeteer or Playwright frameworks. */ code: Content | Entrypoint; /** * A valid fully qualified domain name (FQDN) to check for SSL certificate * expiration. For example, 'app.checklyhq.com'. */ sslCheckDomain?: string; /** * A valid playwright config object, same format and keys as you would use on * playwright.config.ts */ playwrightConfig?: PlaywrightConfig; } /** * Creates a Browser Check to monitor web applications using Playwright. * * Browser checks allow you to monitor complex user interactions, page performance, * and visual regressions. They run real browser scripts using Playwright to simulate * user behavior and validate web application functionality. * * @example * ```typescript * // Basic browser check with script file * new BrowserCheck('login-flow', { * name: 'User Login Flow', * frequency: Frequency.EVERY_10M, * locations: ['us-east-1', 'eu-west-1'], * code: { * entrypoint: path.join(__dirname, 'login.spec.js') * } * }) * * // Browser check with inline code * new BrowserCheck('homepage', { * name: 'Homepage Check', * frequency: Frequency.EVERY_5M, * code: { * content: ` * const { test, expect } = require('@playwright/test') * * test('homepage loads correctly', async ({ page }) => { * await page.goto('https://example.com') * await expect(page.locator('h1')).toContainText('Welcome') * await expect(page).toHaveTitle(/Example/) * }) * ` * }, * playwrightConfig: { * use: { * viewport: { width: 1280, height: 720 } * } * } * }) * ``` * * @see {@link https://www.checklyhq.com/docs/constructs/browser-check/ | BrowserCheck API Reference} * @see {@link https://www.checklyhq.com/docs/detect/synthetic-monitoring/browser-checks/overview/ | Browser Checks Documentation} * @see {@link https://playwright.dev/ | Playwright Documentation} */ export declare class BrowserCheck extends RuntimeCheck { readonly code: Content | Entrypoint; readonly sslCheckDomain?: string; readonly playwrightConfig?: PlaywrightConfig; /** * Constructs the Browser Check instance * * @param logicalId unique project-scoped resource name identification * @param props check configuration properties * {@link https://www.checklyhq.com/docs/constructs/browser-check/ Read more in the docs} */ constructor(logicalId: string, props: BrowserCheckProps); describe(): string; protected configDefaultsGetter(props: CheckProps): ConfigDefaultsGetter; protected applyConfigDefaults>(props: T): T; validate(diagnostics: Diagnostics): Promise; static bundle(bundler: Bundler, entry: string, runtimeId?: string): Promise<{ script: string; scriptPath: string; dependencies: number[]; snapshots: { absolutePath: string; path: string; }[]; }>; getSourceFile(): string | undefined; bundle(bundler: Bundler): Promise; synthesize(): { checkType: string; sslCheckDomain: string | null; playwrightConfig: PlaywrightConfig | undefined; 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: import("./ref").Ref | null; retryStrategy: import("./retry-strategy").LinearRetryStrategy | import("./retry-strategy").ExponentialRetryStrategy | import("./retry-strategy").FixedRetryStrategy | import("./retry-strategy").SingleRetryRetryStrategy | null | undefined; doubleCheck: boolean | undefined; alertSettings: import("./alert-escalation-policy").AlertEscalation | undefined; useGlobalAlertSettings: boolean | undefined; runParallel: boolean | undefined; triggerIncident: { serviceId: import("./ref").Ref; severity: "MINOR" | "MEDIUM" | "MAJOR" | "CRITICAL"; name: string; description: string; notifySubscribers: boolean; } | undefined; description?: string | undefined; name: string; }; }