// ClientFunction //---------------------------------------------------------------------------- interface ClientFunctionOptions { /** * Contains functions, variables or objects used by the client function internally. * Properties of the `dependencies` object will be added to the client function's scope as variables. */ dependencies?: {[key: string]: any}, /** * If you need to call a client function from a Node.js callback, assign the current test controller to the `boundTestRun` option. */ boundTestRun?: TestController } interface ClientFunction { /** * Client function * * @param args - Function arguments. */ (...args: any[]): Promise; /** * Returns a new client function with a different set of options that includes options from the * original function and new `options` that overwrite the original ones. * * @param options - New options. */ with(options: ClientFunctionOptions): ClientFunction; } // NodeSnapshot //---------------------------------------------------------------------------- interface TextRectangle { /** * Y-coordinate, relative to the viewport origin, of the bottom of the rectangle box. */ bottom: number; /** * X-coordinate, relative to the viewport origin, of the left of the rectangle box. */ left: number; /** * X-coordinate, relative to the viewport origin, of the right of the rectangle box. */ right: number; /** * Y-coordinate, relative to the viewport origin, of the top of the rectangle box. */ top: number; /** * Width of the rectangle box (This is identical to `right` minus `left`). */ width: number; /** * Height of the rectangle box (This is identical to `bottom` minus `top`). */ height: number; } interface NodeSnapshot { /** * The number of child HTML elements. */ childElementCount: number; /** * The number of child nodes. */ childNodeCount: number; /** * `true` if this node has child HTML elements. */ hasChildElements: boolean; /** * `true` if this node has child nodes. */ hasChildNodes: boolean; /** * The type of the node. * See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType */ nodeType: number; /** * The text content of the node and its descendants. * See https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent */ textContent: string; /** * Attributes of the element. */ attributes?: {[name: string]: string}; /** * The size of the element and its position relative to the viewport. */ boundingClientRect?: TextRectangle; /** * For checkbox and radio input elements, their current state. For other elements, `undefined`. */ checked?: boolean | undefined; /** * The list of element's classes. */ classNames?: string[]; /** * The inner height of the element, including padding but not the horizontal scrollbar height, border, or margin. * See https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight */ clientHeight?: number; /** * The width of the left border of the element. * See https://developer.mozilla.org/en-US/docs/Web/API/Element/clientLeft */ clientLeft?: number; /** * The width of the top border of the element. * See https://developer.mozilla.org/en-US/docs/Web/API/Element/clientTop */ clientTop?: number; /** * The inner width of the element, including padding but not the vertical scrollbar width, border, or margin. * See https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth */ clientWidth?: number; /** * `true` if the element is focused. */ focused?: boolean; /** * The element's identifier. * See https://developer.mozilla.org/en-US/docs/Web/API/Element/id */ id?: string; /** * The element's text content "as rendered". * See https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute */ innerText?: string; /** * The namespace URI of the element. If the element does not have a namespace, this property is set to null. * See https://developer.mozilla.org/en-US/docs/Web/API/Element/namespaceURI */ namespaceURI?: string | null; /** * The height of the element including vertical padding and borders. * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight */ offsetHeight?: number; /** * The number of pixels that the upper left corner of the element is offset by to the left within the `offsetParent` node. * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetLeft */ offsetLeft?: number; /** * The number of pixels that the upper left corner of the element is offset by to the top within the offsetParent node. * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop */ offsetTop?: number; /** * The width of the element including vertical padding and borders. * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetWidth */ offsetWidth?: number; /** * Indicates that `