import { RequestHandler, Skill } from 'ask-sdk-core'; import { Intent, interfaces } from 'ask-sdk-model'; import { Control } from '../../controls/Control'; import { ControlInput } from '../../controls/ControlInput'; import { ControlServicesProps } from '../../controls/ControlServices'; import { IControl } from '../../controls/interfaces/IControl'; import { IControlInput } from '../../controls/interfaces/IControlInput'; import { IControlResult } from '../../controls/interfaces/IControlResult'; import { InputModality, OutputModality } from '../../modality/ModalityEvaluation'; import { ControlHandler } from '../../runtime/ControlHandler'; import { SkillInvoker, TestResponseObject } from './SkillInvoker'; import UserEvent = interfaces.alexa.presentation.apl.UserEvent; export declare function waitForDebugger(): void; /** * Find the control with the specified id in the control tree * @param rootControl - Root control * @param id - Control id to search for */ export declare function findControlInTreeById(rootControl: IControl, id: string): any; /** * Find the control with the specified property name and value in the control tree * @param rootControl - Root control * @param property - Property name * @param value - Property value */ export declare function findControlByProperty(rootControl: IControl, property: string, value: any): any; /** * Invokes the core handling method of ControlHandler * * Purpose: * - for unit-testing the handling functionality (without rendering). * * @param rootControl - Root control * @param input - Input */ export declare function simpleInvoke(rootControl: Control, input: ControlInput, customServices?: ControlServicesProps): Promise; /** * Tests a multi-turn script, verifying that the correct prompts are produced on * each turn. * * For finer-grained control, for assertions and breakpoints, use a sequence * of calls to `testTurn`. * * Each user turn comprises three entries: * 1. The user utterance. This is not a functional parameter is for * documentation / readability. * 2. The input object for the turn. This should be synchronized with the user-utterance. * 3. The expected response for the turn: prompt, set of allowed prompts or * TestResponse object. * * The user utterance and expected prompt can start with 'U: ' and 'A: ' to aid readability. * @param turns - Array of 3 entries per logical turn. [utterance, Intent] */ export declare function testE2E(handler: ControlHandler, turns: Array): Promise; /** * Test a single turn through the complete runtime flow * * @param invoker - SkillInvoker * @param utterance - Utterance. This is only for documentation / readability. * @param input - Input object * @param expectedResponse - The expected response: prompt, set of allowed * prompts or TestResponse object. */ export declare function testTurn(invoker: SkillInvoker, utterance: string, input: IControlInput, expectedResponse: string | string[] | TestResponseObject): Promise; /** * Utility to create Input objects for use in tests. */ export declare class TestInput { static turnNumber: number; static responseStyle: { modality: OutputModality; }; static inputModality: InputModality; /** * Reset the turn counter. */ static reset(): void; /** * Creates a ControlInput for a given Intent-name or complete Intent object. */ static of(nameOrIntent: Intent | string): ControlInput; /** * Creates a ControlInput for a given Intent-name and slots, or complete Intent object. */ static intent(nameOrIntent: string | Intent, slotValues?: { [k: string]: any; }): ControlInput; /** * Creates a ControlInput representing a LaunchRequest. */ static launchRequest(): ControlInput; /** * Creates a ControlInput for an APL User Event. */ static userEvent(userEvent: UserEvent): ControlInput; static simpleUserEvent(args: any[], token?: string, locale?: string): ControlInput; static canFulfillIntentRequest(nameOrIntent: string | Intent, slotValues?: { [k: string]: any; }): ControlInput; } /** * Utility to run tests on a Skill or RequestHandler. */ export declare class SkillTester { invoker: SkillInvoker; constructor(skillOrRequestHandler: Skill | RequestHandler); testTurn(utterance: string, input: ControlInput, expectedPrompt: string): Promise; } //# sourceMappingURL=TestingUtils.d.ts.map