UNPKG

@gatling.io/core

Version:

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

83 lines (82 loc) 3.75 kB
import { SessionTo } from "../session"; import { Executable } from "./execs"; import JvmDoIf = io.gatling.javaapi.core.condition.DoIf; import JvmDoIfEquals = io.gatling.javaapi.core.condition.DoIfEquals; export interface Then<T> { then(executable: Executable<any>, ...executables: Executable<any>[]): T; } export interface DoIfFunction<T extends DoIf<T>> { /** * Execute the "then" block only if the condition is true * * @param condition - the condition expressed as a Gatling Expression Language String that must * evaluate to a Boolean * @returns a DSL component for defining the "then" block */ (condition: string): Then<T>; /** * Execute the "then" block only if the condition is true * * @param condition - the condition expressed as a function * @returns a DSL component for defining the "then" block */ (condition: SessionTo<boolean>): Then<T>; } export interface DoIf<T extends DoIf<T>> { doIf: DoIfFunction<T>; } export declare const doIfImpl: <J2, J1 extends JvmDoIf<J2, any>, T extends DoIf<T>>(jvmDoIf: J1, wrap: (wrapped: J2) => T) => DoIfFunction<T>; export interface DoIfEqualsFunction<T extends DoIfEquals<T>> { /** * Execute the "then" block only if the actual value is equal to the expected one * * @param actual - the actual value expressed as a Gatling Expression Language String * @param expected - the expected value expressed as a Gatling Expression Language String * @returns a DSL component for defining the "then" block */ (actual: string, expected: string): Then<T>; /** * Execute the "then" block only if the actual value is equal to the expected one * * @param actual - the actual value expressed as a Gatling Expression Language String * @param expected - the expected static value * @returns a DSL component for defining the "then" block */ (actual: string, expected: unknown): Then<T>; /** * Execute the "then" block only if the actual value is equal to the expected one * * @param actual - the actual value expressed as a Gatling Expression Language String * @param expected - the expected value expressed as a function * @returns a DSL component for defining the "then" block */ (actual: string, expected: SessionTo<unknown>): Then<T>; /** * Execute the "then" block only if the actual value is equal to the expected one * * @param actual - the actual value expressed as a function * @param expected - the expected value expressed as a Gatling Expression Language String * @returns a DSL component for defining the "then" block */ (actual: SessionTo<unknown>, expected: string): Then<T>; /** * Execute the "then" block only if the actual value is equal to the expected one * * @param actual - the actual value expressed as a function * @param expected - the expected static value * @returns a DSL component for defining the "then" block */ (actual: SessionTo<unknown>, expected: unknown): Then<T>; /** * Execute the "then" block only if the actual value is equal to the expected one * * @param actual - the actual value expressed as a function * @param expected - the expected value expressed as a function * @returns a DSL component for defining the "then" block */ (actual: SessionTo<unknown>, expected: SessionTo<unknown>): Then<T>; } export interface DoIfEquals<T extends DoIfEquals<T>> { doIfEquals: DoIfEqualsFunction<T>; } export declare const doIfEqualsImpl: <J2, J1 extends JvmDoIfEquals<J2, any>, T extends DoIfEquals<T>>(jvmDoIfEquals: J1, wrap: (wrapped: J2) => T) => DoIfEqualsFunction<T>;