UNPKG

@ovotech/genesys-web-messaging-tester-cli

Version:
29 lines (28 loc) 1.04 kB
import { Conversation, SessionConfig } from '@ovotech/genesys-web-messaging-tester'; export type TestScriptFileScenarioStep = { readonly say: string; } | { readonly waitForReplyContaining: string; } | { readonly waitForReplyMatching: RegExp; }; export interface TestScriptFile { readonly config?: { readonly deploymentId: string; readonly region: string; readonly origin?: string; }; readonly scenarios: { [key: string]: TestScriptFileScenarioStep[]; }; } export interface StepContext { timeoutInSeconds: number; } export interface TestScriptScenario { sessionConfig: SessionConfig; name: string; steps: ((convo: Conversation, context: StepContext) => Promise<unknown>)[]; } export declare function parseScenarioStep(step: TestScriptFileScenarioStep): (convo: Conversation, context: StepContext) => Promise<unknown | void>; export declare function extractScenarios(testScript: Exclude<TestScriptFile, 'config'>, sessionConfig: SessionConfig): TestScriptScenario[];