UNPKG

@gatling.io/postman

Version:

Gatling Postman adds support for loading Postman collections in the [Gatling load testing tool](https://gatling.io/).

73 lines (72 loc) 2.77 kB
import { ActionBuilder, ChainBuilder, Duration, ScenarioBuilder, ProtocolBuilder } from "@gatling.io/core"; export interface Postman { /** * @param collectionPath - Path to an exported collection file in the project resources */ fromResource(collectionPath: string): PostmanCollection; } export interface PostmanCollection extends PostmanCollectionFolder { /** * Inject an environment in the collection. * * @param variables - A dictionary of variables, or the path to an exported environment file in the project resources */ environment(variables: Record<string, string> | string): PostmanCollection; /** * Inject global variables in the collection. * * @param variables - A dictionary of variables, or the path to an exported environment file in the project resources */ globals(variables: Record<string, string> | string): PostmanCollection; /** * Inject a CSV data file in the collection. */ csvDataFile(path: string): PostmanCollection; /** * Inject a JSON data file in the collection. */ jsonDataFile(path: string): PostmanCollection; /** * Call at the start of a scenario to initialize variables. */ initVariables: ChainBuilder; export: PostmanCollectionExports; } export interface PostmanCollectionExports { id: string; collection: string; environment: string; globals: string; } export interface PostmanCollectionFolder { /** * Move down one level to a folder contained in the current folder. * * @param folder - Name of a folder contained in the current folder */ folder(folder: string): PostmanCollectionFolder; /** * Create a Gatling HTTP request from a Postman request contained in the current folder. * * @param request - Name of a request contained in the current folder * @param overrideName - Optionally override the Gatling request name, otherwise the Postman request name will be used */ request(request: string, overrideName?: string): ActionBuilder; /** * Create a Gatling scenario from the list of requests contained in the current folder. * * @param name - Name of the scenario * @param options - */ scenario(name: string, options?: ScenarioOptions): ScenarioBuilder; } export interface ScenarioOptions { /** Include requests in sub-folders, false by default. */ recursive?: boolean; /** Include this pause time between requests, no pause by default. */ pauses?: Duration; } export declare const postman: Postman; export interface PostmanProtocolBuilder extends ProtocolBuilder { } export declare const postmanProtocol: (...collections: PostmanCollection[]) => PostmanProtocolBuilder;