@neuralegion/cypress-har-generator
Version:
The Cypress plugin for generating HTTP Archive (HAR) files is a tool that allows developers and QA engineers to capture detailed information about network requests made during the execution of Cypress tests.
16 lines (15 loc) • 831 B
TypeScript
import type { Protocol } from 'devtools-protocol';
import type ProtocolMappingApi from 'devtools-protocol/types/protocol-mapping';
export declare type NetworkEvents = Pick<ProtocolMappingApi.Events, `Network.${string}` & keyof ProtocolMappingApi.Events>;
export declare type NetworkEventParams<T extends keyof NetworkEvents> = NetworkEvents[T][0];
export declare type NetworkEvent = {
params: NetworkEventParams<keyof NetworkEvents>;
method: keyof NetworkEvents;
sessionId?: string;
};
export interface Network {
getResponseBody(requestId: string): Promise<Protocol.Network.GetResponseBodyResponse>;
getRequestBody(requestId: string): Promise<Protocol.Network.GetRequestPostDataResponse>;
attachToTargets(listener: (event: NetworkEvent) => unknown): Promise<void>;
detachFromTargets(): Promise<void>;
}