UNPKG

playwright-api-mock

Version:

An automated API response snapshot tool for Playwright. This plugin records API network requests during test runs and reuses them as mocks for fast, reliable, and deterministic tests.

17 lines (16 loc) 474 B
import type { APIResponse } from '@playwright/test'; import type { StoreConfig } from './types'; export declare class SnapshotsStore { private path; private getStoredHeaders; private snapshots; constructor(params: StoreConfig); getStoredSnapshot(key: string): { status: number; headers?: { [key: string]: string; }; body: unknown; }; storeResponse(key: string, response: APIResponse): Promise<void>; }