@gatling.io/core
Version:
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
86 lines (85 loc) • 4.03 kB
TypeScript
import { SessionTo } from "../session";
import { Executable } from "./execs";
import JvmDoIfOrElse = io.gatling.javaapi.core.condition.DoIfOrElse;
import JvmDoIfEqualsOrElse = io.gatling.javaapi.core.condition.DoIfEqualsOrElse;
export interface Then<T> {
then(executable: Executable<any>, ...executables: Executable<any>[]): OrElse<T>;
}
export interface OrElse<T> {
orElse(executable: Executable<any>, ...executables: Executable<any>[]): T;
}
export interface DoIfOrElseFunction<T extends DoIfOrElse<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 DoIfOrElse<T extends DoIfOrElse<T>> {
doIfOrElse: DoIfOrElseFunction<T>;
}
export declare const doIfOrElseImpl: <J2, J1 extends JvmDoIfOrElse<J2, any>, T extends DoIfOrElse<T>>(jvmDoIfOrElse: J1, wrap: (wrapped: J2) => T) => DoIfOrElseFunction<T>;
export interface DoIfEqualsOrElseFunction<T extends DoIfEqualsOrElse<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 function
* @param expected - the expected value expressed as a Gatling Expression Language String
* @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 DoIfEqualsOrElse<T extends DoIfEqualsOrElse<T>> {
doIfEqualsOrElse: DoIfEqualsOrElseFunction<T>;
}
export declare const doIfEqualsOrElseImpl: <J2, J1 extends JvmDoIfEqualsOrElse<J2, any>, T extends DoIfEqualsOrElse<T>>(jvmDoIfEqualsOrElse: J1, wrap: (wrapped: J2) => T) => DoIfEqualsOrElseFunction<T>;