UNPKG

@ply-ct/ply

Version:

REST API Automated Testing

85 lines (84 loc) 2.79 kB
import { Values } from './values'; import * as flowbee from './flowbee'; import { Listener } from './event'; import { Log } from './log'; import { RunOptions } from './options'; import { Runtime } from './runtime'; import { PlyStep } from './step'; import { Suite } from './suite'; import { Request } from './request'; import { Result } from './result'; export interface Flow { flow: flowbee.Flow; instance: flowbee.FlowInstance; } export interface Subflow { subflow: flowbee.Subflow; instance: flowbee.SubflowInstance; } export interface FlowResult extends Result { /** * flow path */ flow: string; /** * return values */ return?: Values; } export declare class FlowStepResults { readonly flow: string; private results; constructor(flow: string); add(stepId: string, result: Result): void; get latest(): Result; latestBad(): boolean; get overall(): Result; /** * Step result values */ get values(): Values; } export declare class PlyFlow implements Flow { readonly flow: flowbee.Flow; readonly requestSuite: Suite<Request>; private readonly logger; readonly name: string; readonly type = "flow"; start: number; end?: number | undefined; instance: flowbee.FlowInstance; results: FlowStepResults; maxLoops: number; private _onFlow; onFlow(listener: Listener<flowbee.FlowEvent>): void; constructor(flow: flowbee.Flow, requestSuite: Suite<Request>, logger: Log); clone(): PlyFlow; newInstance(): flowbee.FlowInstance; /** * Flow input values */ getFlowValues(values: Values, runOptions?: RunOptions): Values; /** * returns missing value names */ validateValues(values: Values): string[]; /** * Flow output values */ getReturnValues(values: Values, trusted?: boolean): Values | undefined; /** * Run a ply flow. */ run(runtime: Runtime, values: Values, runOptions?: RunOptions, runNum?: number): Promise<Result>; private endFlow; /** * Executes a step within a flow and recursively executes the following step(s). */ exec(step: flowbee.Step, runtime: Runtime, values: Values, incomingLinkId?: string, runOptions?: RunOptions, runNum?: number, subflow?: Subflow): Promise<void>; getSubflows(type: 'Before' | 'After', step?: flowbee.Step): Subflow[]; runSubflows(subflows: Subflow[], runtime: Runtime, values: Values, runOptions?: RunOptions, runNum?: number): Promise<void>; stepError(plyStep: PlyStep, message: string): void; flowEvent(eventType: flowbee.FlowEventType, elementType: flowbee.FlowElementType, instance: flowbee.FlowInstance | flowbee.SubflowInstance | flowbee.StepInstance): flowbee.FlowEvent; private emit; }