/** * Represents the Testim Dev Kit step locator. * @see https://help.testim.io/docs/working-with-locators */ declare class TDKStepLocator { elementLocator?: any; selector?: string; nthChildIndex?: number; id?: string; name?: string; innerLocator?: TDKStepLocator; parentLocator?: TDKStepLocator; find(selector: any): TDKStepLocator; nthChild(index: number): TDKStepLocator; childWithText(text: string): TDKStepLocator; /** * Sets the locator confidence threshold * @param threshold the locator conidence score */ withConfidence(threshold: number): TDKStepLocator; } /** * Represents the options passed to a click. * @see https://help.testim.io/docs/click */ interface ClickOptions { button?: 'left' | 'right'; offset?: { x: number; y: number; }; } /** * Represents the return value from a getCookie or setCookie call. * @see https://help.testim.io/docs/get-cookie */ declare class CookieData { name?: string; value?: string; domain?: string; expires?: number; httpOnly?: boolean; secure?: boolean; path?: string; } /** * Represents an x/y point - passed to Drag and Drop */ interface Point { x: number; y: number; } /** * A CSS selector used to select an element. This is usually a string like `'.foo'` and the syntax is whatever * the browser and JSDOM's `document.querySelector` understand. * @see https://www.w3.org/TR/selectors-3/#selectors */ declare type Selector = string; /** * All Testim methods that work on an element work on either a Selector or TDKStepLocator */ declare type SelectParam = Selector | TDKStepLocator; /** * The options passed to a scrollToElement command * @see https://help.testim.io/docs/scroll-to-element */ interface ScrollOptions { scrollTarget?: SelectParam; } /** The options passed to a hover command * @see https://help.testim.io/docs/hover */ interface HoverOptions { offset?: { x: number; y: number; }; } /** The options passed to a waitForCode command * @see https://help.testim.io/docs/wait-for-code */ interface WaitForCodeOptions { pollInterval: number; } /** The options passed to a resize command * @see https://help.testim.io/docs/resize */ interface ResizeOptions { width: number; height: number; } /** the options passed to a waitForElement command * @see https://help.testim.io/docs/wait-for-element */ interface WaitForElementOptions { checkVisibility?: boolean; } /** the options passed to a waitForText command * @see https://help.testim.io/docs/wait-for-text */ interface WaitForTextOptions { checkVisibility?: boolean; } interface Headers { [key: string]: string; } declare type RequestMethods = 'GET' | 'POST' | 'PUT' | 'PATH' | 'DELETE' | 'COPY' | 'HEAD' | 'OPTIONS'; interface ApiCallOptions { method?: RequestMethods; headers?: Headers; body?: string; sendViaWebApp?: boolean; omitCookies?: boolean; } export declare enum GeneratedValueTypes { LettersOnly = "Letters Only", NumbersOnly = "Numbers Only", Mixed = "Mixed" } /** * Clicks the given element on the screen, clicks on the element in its center by default. * @see https://help.testim.io/docs/click */ export declare function click(selector: SelectParam, options?: ClickOptions): Promise; /** * Clicks the given element on the screen, clicks on the element in its center by default. * @see https://help.testim.io/docs/dblclick */ export declare function dblclick(selector: SelectParam, options?: ClickOptions): Promise; /** * Sleeps a specified duration. Basically the same as * const sleep = require('util').promisify(setTimeout); * Except that it adds a sleep step to the UI * @param ms milliseconds to sleep */ export declare function sleep(ms: number): Promise; /** * Api call */ export declare function apiCall(url: string, options?: ApiCallOptions): Promise<{ statusCode: number; statusText: string; requestDuration: number; responseBody: any; responseHeaders: any; }>; /** * Get latest download item work only in Chrome extension mode */ export declare function downloadFile(): Promise<{ fileName: string; fileType: string; sizeInBytes: number; fileBlob: any; }>; /** * Generate random value letters/numbers/mixed */ export declare function generateRandomValue(generatedLength?: number, valueType?: GeneratedValueTypes, prefixValue?: string): Promise; /** * Generate Testim random email - PRO feature */ export declare function generateTestimEmail(): Promise; /** * Get email messages from Testim email inbox - PRO feature */ export declare function getTestimInbox(emailAddress: string): Promise; /** * Get document element outer html */ export declare function html(): Promise; /** * This method used to simulate upload file on */ export declare function inputFile(selector: SelectParam, inputFileUrls: string | string[]): Promise; /** * This method used to simulate drop file on drop zone */ export declare function dropFile(selector: SelectParam, inputFileUrls: string | string[]): Promise; /** * Refresh current page */ export declare function refresh(): Promise; /** * Get current page title */ export declare function title(): Promise; /** * Get current page url */ export declare function url(): Promise; /** * This method is used to extract an element's text content. * @see https://help.testim.io/docs/text */ export declare function text(selector: SelectParam): Promise; /** * Scroll to a given element on the screen. * @see https://help.testim.io/docs/scroll-to-element */ export declare function scrollToElement(selector: SelectParam, options?: ScrollOptions): Promise; /** * This method is used to set an element's text content. If the element already has text content it overrides it. * @see https://help.testim.io/docs/type */ export declare function type(selector: SelectParam, textValue: string): Promise; /** * This method is used to run custom JavaScript in the browser application page. This is useful as an escape hatch and in order to implement interactions that are not available out of the box with Testim or in order to interact with the page JavaScript. * @see https://help.testim.io/docs/evaluate */ export declare function evaluate(fn: (...any: U) => R | Promise, ...parameters: U): Promise; /** * This method is used to execute an arbitrary command that runs in Node.js from within the test * @see https://help.testim.io/docs/cli-action */ export declare function cliAction(fn: (...any: U) => R | Promise, ...parameters: U): Promise; /** * The go command navigates to a given web page in the controlled browser. * @see https://help.testim.io/docs/go */ export declare function go(url: string): Promise; /** * Sets a cookie on a given page. * @see https://help.testim.io/docs/set-cookie */ export declare function setCookie(cookieData: CookieData): Promise; /** * Gets a cookie by a specific name. * @see https://help.testim.io/docs/get-cookie */ export declare function getCookie(name: string): Promise; /** * Hovers over the given element on the screen, on the element center by default. * @see https://help.testim.io/docs/hover */ export declare function hover(selector: SelectParam, options: HoverOptions): Promise; /** * This method checks that an element matching the given selector exists on the page * @see https://help.testim.io/docs/exists */ export declare function exists(selector: SelectParam): Promise; /** * This method is used to check if a checkbox element is checked or not. * @see https://help.testim.io/docs/checkbox */ export declare function checkbox(selector: SelectParam): Promise; /** * This method is used to check if a radio element is checked or not. * @see https://help.testim.io/docs/radio */ export declare function radio(selector: SelectParam): Promise; /** * This method selects a given