UNPKG

@gatling.io/http

Version:

Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).

98 lines (97 loc) 4.45 kB
import { CheckBuilderCaptureGroup, CheckBuilderFind, CheckBuilderMultipleFind, Session } from "@gatling.io/core"; /** * Bootstrap a check that capture the response location, eg the landing url in a chain of * redirects * * @returns the next step in the check DSL */ export declare const currentLocation: () => CheckBuilderFind<string>; export interface CurrentLocationRegexFunction { /** * Bootstrap a check that capture some <a * href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular * Expression</a> capture groups on the response location, eg the landing url in a chain of * redirects * * @param pattern - the regular expression, expressed as a Gatling Expression Language String * @returns the next step in the check DSL */ (pattern: string): CheckBuilderCaptureGroup; /** * Bootstrap a check that capture some <a * href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular * Expression</a> capture groups on the response location, eg the landing url in a chain of * redirects * * @param pattern - the regular expression, expressed as a function * @returns the next step in the check DSL */ (pattern: (session: Session) => string): CheckBuilderCaptureGroup; } export declare const currentLocationRegex: CurrentLocationRegexFunction; export interface HeaderFunction { /** * Bootstrap a check that capture the value of a HTTP header * * @param name the name of the HTTP header, expressed as a Gatling Expression Language String * @return the next step in the check DSL */ (name: string): CheckBuilderMultipleFind<string>; /** * Bootstrap a check that capture the value of a HTTP header * * @param name - the name of the HTTP header, expressed as a function * @returns the next step in the check DSL */ (name: (session: Session) => string): CheckBuilderMultipleFind<string>; } export declare const header: HeaderFunction; export interface HeaderRegexFunction { /** * Bootstrap a check that capture some <a * href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular * Expression</a> capture groups on a response header * * @param name - the name of the HTTP header, expressed as a Gatling Expression Language String * @param pattern - the regular expression, expressed as a Gatling Expression Language String * @returns the next step in the check DSL */ (name: string, pattern: string): CheckBuilderCaptureGroup; /** * Bootstrap a check that capture some <a * href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular * Expression</a> capture groups on a response header * * @param name - the name of the HTTP header, expressed as a function * @param pattern - the regular expression, expressed as a Gatling Expression Language String * @returns the next step in the check DSL */ (name: (session: Session) => string, pattern: string): CheckBuilderCaptureGroup; /** * Bootstrap a check that capture some <a * href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular * Expression</a> capture groups on a response header * * @param name - the name of the HTTP header, expressed as a Gatling Expression Language String * @param pattern - the regular expression, expressed as a function * @returns the next step in the check DSL */ (name: string, pattern: (session: Session) => string): CheckBuilderCaptureGroup; /** * Bootstrap a check that capture some <a * href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular * Expression</a> capture groups on a response header * * @param name the name of the HTTP header, expressed as a function * @param pattern the regular expression, expressed as a function * @return the next step in the check DSL */ (name: (session: Session) => string, pattern: (session: Session) => string): CheckBuilderCaptureGroup; } export declare const headerRegex: HeaderRegexFunction; /** * Bootstrap a check that capture the response HTTP status code * * @returns the next step in the check DSL */ export declare const status: () => CheckBuilderFind<number>;