UNPKG

webdriverio

Version:

Next-gen browser and mobile automation test framework for Node.js

55 lines • 1.86 kB
import type { remote } from 'webdriver'; import type { ElementReference } from '@wdio/protocols'; /** * Moves whose duration came from the default rather than the caller. Tracked * out of band so the Classic wire format stays unchanged. */ export declare const DEFAULT_DURATION_MOVES: WeakSet<object>; /** * Converts classic action sources to BiDi input sources: element origins become * `{ type: 'element', sharedId }` references. */ export declare function toBidiActions<T extends { actions: object[]; }>(sequence: T[]): remote.InputSourceActions[]; export type ActionType = 'key' | 'pointer' | 'wheel'; export type KeyActionType = 'mouse' | 'pen' | 'touch'; export interface ActionParameters { pointerType?: KeyActionType; } export interface BaseActionParams { id?: string; parameters?: ActionParameters; } interface Sequence { type: string; duration?: number; origin?: (ElementReference | WebdriverIO.Element | 'pointer' | 'viewport') & { then?: Function; }; value?: string; } export default class BaseAction { #private; protected instance: WebdriverIO.Browser | WebdriverIO.BrowsingContext; protected sequence: Sequence[]; constructor(instance: WebdriverIO.Browser | WebdriverIO.BrowsingContext, type: ActionType, params?: BaseActionParams); toJSON(): { id: string; type: ActionType; parameters: ActionParameters; actions: Sequence[]; }; /** * Inserts a pause action for the specified device, ensuring it idles for a tick. * @param duration idle time of tick */ pause(duration: number): this; /** * Perform action sequence * @param skipRelease set to true if `releaseActions` command should not be invoked */ perform(skipRelease?: boolean): Promise<void>; } export {}; //# sourceMappingURL=base.d.ts.map