UNPKG

app-walkthrough

Version:

An intuitive guided walkthrough library with UI highlighting and voice narration for web apps.

49 lines (48 loc) 1.83 kB
export type TSelectorType = "css" | "testId" | "xpath"; export type TActionType = "input" | "click" | "dropdownClick" | "dropdownSearchClick" | "clickRowAction" | "clickTab" | "assert" | "select" | "check" | "multiSelect" | "uploadFile" | "hover" | "dragDrop" | "scrollTo" | "selectDate" | "keyboard"; export type TSelector = { selectorType?: TSelectorType; selector: string; target?: string; index?: number; }; export type TActionText = { actionName?: string; actionNameKey?: string; description?: string; descriptionKey?: string | string[]; beforeMessage?: string; beforeMessageKey?: string | string[]; afterMessage?: string; afterMessageKey?: string | string[]; }; export type TActionBase = { waitSeconds?: number; actionType: TActionType; selectors: TSelector[]; } & TActionText; export type TInputAction = TActionBase & { actionType: "input" | "select" | "dropdownClick" | "dropdownSearchClick" | "multiSelect"; input: string | string[] | number | number[]; }; export type TUploadFileAction = TActionBase & { actionType: "uploadFile"; input: string; }; export type TKeyboardAction = TActionBase & { actionType: "keyboard"; input: string; }; export type TGeneralAction = TActionBase & { actionType: "click" | "clickRowAction" | "clickTab" | "check" | "hover" | "dragDrop" | "scrollTo" | "selectDate" | "assert"; input?: never; }; export type TAction = TInputAction | TUploadFileAction | TKeyboardAction | TGeneralAction; export type TUrlAction = { urlString: string; actionType: "url"; waitSeconds?: number; } & TActionText; export type TStepAction = TAction | TUrlAction; export declare function isUrlAction(step: TStepAction): step is TUrlAction; export declare function isUiAction(step: TStepAction): step is TAction;