webdriverio
Version:
Next-gen browser and mobile automation test framework for Node.js
42 lines • 2.13 kB
TypeScript
/**
* A leaf module (it imports only the error codes): `implicitWait`, the element middleware,
* `setValue` and `waitForStable` import it.
*
* The error of a command on a stale element that the lookup waited `waitforTimeout` for and
* did not find again (the page removed it) is the "element wasn't found" error of
* `implicitWait`, as in 9.31.9, with the code `ELEMENT_NOT_FOUND_AGAIN` and the stale element
* error as its `cause`. It is not a stale element error, so the outer layers of the command do
* not look for the element (and wait) again.
*/
import { ELEMENT_NOT_FOUND_AGAIN } from './errorCodes.js';
/**
* Flag the "element wasn't found" error of `implicitWait` when its wait for the element ended
* without it. A recorded element stays, see `recordNotFound`
*/
export declare function markWaited(err: unknown): void;
/**
* whether the error comes from a wait for the element that ended without it, see `markWaited`
*/
export declare function waitedFor(err: unknown): boolean;
/**
* whether the error is the one of a stale element that was not found again, see
* `ELEMENT_NOT_FOUND_AGAIN`
*/
export declare function isElementNotFoundAgain(err: unknown): err is Error & {
code: typeof ELEMENT_NOT_FOUND_AGAIN;
};
/**
* Record the element of the chain whose lookup ended without it, for an error of
* `implicitWait` in `refetchElement`
*/
export declare function recordNotFound(err: unknown, el: object): void;
export declare function notFoundElement(err: unknown): object | undefined;
/**
* Give the error of a stale element that was not found again its code, see
* `ELEMENT_NOT_FOUND_AGAIN`, and its `cause`, the stale element error of the driver (when the
* caller gives it). When the element that was not found is the element of the command, the
* message names the command (the outer layers of the command name it in turn, so the message
* names the command that the user called); the first line of the stack shows that message.
*/
export declare function nameNotFoundAgain(err: Error, el: object, commandName: string, cause?: unknown): void;
//# sourceMappingURL=elementNotFound.d.ts.map