UNPKG

webdriverio

Version:

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

57 lines • 2.71 kB
import type { ReactSelectorOptions, Selector } from '../types.js'; /** * The React selector options of an element found with `react$` or `react$$`, * kept so that the element is found again with the same props and state. A * symbol, so it isn't part of the public element type. */ export declare const REACT_OPTIONS: unique symbol; /** * Set on the "not found" element that `$$(selector)[index]` gives when the list did * not reach the index after `waitforTimeout`, so the implicit wait of a command does * not wait a second time. A symbol, so it isn't part of the public element type. */ export declare const INDEX_NOT_FOUND: unique symbol; type Scope = WebdriverIO.Browser | WebdriverIO.Element; /** * An element can be found again if it has a selector to run again: a string, * a function, a custom strategy or a mobile matcher object. An element * reference or an `HTMLElement` can't be. */ export declare function canFindAgain(element: WebdriverIO.Element): boolean; /** * The selector and the props of an item of a list that `foundWith` found in * `parent`, for `getElements`. `selector` and `props` are the selector of that * command and its arguments after it. An item of `custom$$` gets the strategy * reference that `custom$$` gives to its items: on an element, the element is the * last argument of the strategy. `undefined` for a list command that is not in * `LIST_QUERIES`, a list of elements or element references, or a strategy that is * not registered. */ export declare function itemOf(foundWith: string, selector: unknown, props: unknown[], parent: Scope): { selector: Selector; props: { reactOptions?: ReactSelectorOptions | undefined; isShadowElement: boolean; isReactElement: boolean; }; } | undefined; /** * Find all elements again with the list form of the command that found this * element: `react$$`, `shadow$$` or `$$`. */ export declare function findAllAgain(element: WebdriverIO.Element, parent?: Scope): import("../types.js").ChainablePromiseArray; /** * Find an element again the way it was found: with the same command (`$`, * `shadow$` or `react$`, or the list form of it for an element of a list), at * the same index and with the same strictness. * * With `wait`, an element of a list waits until its index exists, as * `$$(selector)[index]` does. Without it, a missing index gives `undefined` * at once. A single element without a match comes back without an element id. */ export declare function findElementAgain(element: WebdriverIO.Element, { parent, wait }?: { parent?: Scope; wait?: boolean; }): Promise<WebdriverIO.Element | undefined>; export {}; //# sourceMappingURL=findElementAgain.d.ts.map