rwsdk
Version:
Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime
51 lines (50 loc) • 2.71 kB
text/typescript
import type { Browser, Page } from "puppeteer-core";
import { SmokeTestOptions, SmokeTestResult } from "./types.mjs";
export declare function checkUrlStyles(page: Page, expectedColor: "red" | "green"): Promise<void>;
export declare function checkClientModuleStyles(page: Page, expectedColor: "blue" | "green"): Promise<void>;
/**
* Launch a browser instance
*/
export declare function launchBrowser(browserPath?: string, headless?: boolean): Promise<Browser>;
/**
* Get the browser executable path
*/
export declare function getBrowserPath(testOptions?: SmokeTestOptions): Promise<string>;
/**
* Check a URL by performing smoke tests and realtime upgrade
*/
export declare function checkUrl(url: string, artifactDir: string, browserPath?: string, headless?: boolean, bail?: boolean, skipClient?: boolean, environment?: string, realtime?: boolean, targetDir?: string, skipHmr?: boolean, skipStyleTests?: boolean): Promise<void>;
/**
* Check smoke test status for a specific URL
*/
export declare function checkUrlSmoke(page: Page, url: string, isRealtime: boolean, bail: boolean | undefined, skipClient: boolean | undefined, environment: string | undefined, timestampState: {
initialServerValue: number;
clientUpdatedValue: number | null;
}, targetDir?: string, skipHmr?: boolean, skipStyleTests?: boolean): Promise<void>;
/**
* Check server-side smoke test status
*/
export declare function checkServerSmoke(page: Page, phase?: string, environment?: string, bail?: boolean, expectedTimestamp?: number, isServerRenderCheck?: boolean): Promise<SmokeTestResult>;
/**
* Check client-side smoke test if refresh button is available
*/
export declare function checkClientSmoke(page: Page, phase?: string, environment?: string, bail?: boolean): Promise<SmokeTestResult | null>;
/**
* Upgrade to realtime mode
*/
export declare function upgradeToRealtime(page: Page, environment?: string, // Add environment parameter with default
bail?: boolean): Promise<void>;
/**
* DRY: checkServerUp now checks both root and custom path if needed
*/
export declare function checkServerUp(baseUrl: string, customPath?: string, retries?: number, bail?: boolean): Promise<boolean>;
/**
* HMR test for server component
* Updates the server component and verifies that HMR applies the changes
*/
export declare function testServerComponentHmr(page: Page, targetDir: string, phase?: string, environment?: string, bail?: boolean): Promise<boolean>;
/**
* HMR test for client component
* Updates the client component and verifies that HMR applies the changes
*/
export declare function testClientComponentHmr(page: Page, targetDir: string, phase?: string, environment?: string, bail?: boolean): Promise<boolean>;