UNPKG

@sap_oss/wdio-qmate-service

Version:

[![REUSE status](https://api.reuse.software/badge/github.com/SAP/wdio-qmate-service)](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[![Node.js CI](https://github.com/SAP/wdio-qmate-service/actions/workflows/node.js.yml/badge.svg)](http

96 lines (95 loc) 4.21 kB
import { Element } from "../../../../@types/wdio"; /** * @class element * @memberof mobile */ export declare class ElementModule { private vlf; private ErrorHandler; /** * @function isVisible * @memberof mobile.element * @description Returns a boolean if the mobile element is visible to the user. * @param {Element} element - The Mobile Ui element. * @param {boolean} [strict=true] - If strict mode is enabled it will only return "true" if the element is visible on the mobile view and within the viewport. * If "false", it will be sufficient if the element is visible on the view but not inside the current viewport. * @returns {boolean} Returns true or false. * @example * await mobile.element.isVisible(elem); */ isVisible(element: Element, strict?: boolean): Promise<boolean>; /** * @function isPresent * @memberof mobile.element * @description Returns a boolean if the element is present at the DOM or not. It might be hidden. * @param {Element} element - The element. * @returns {boolean} Returns true or false. * @example * await mobile.element.isPresent(elem); */ isPresent(element: Element): Promise<boolean>; /** * @function waitToBePresent * @memberof mobile.element * @description Waits until the element with the given selector is present. * @param {Object} selector - The CSS selector describing the element. * @param {number} [timeout = 30000] - The timeout to wait (ms). * @returns {boolean} Returns true or false. * @example * await mobile.element.waitToBePresent(".input01"); * await mobile.element.waitToBePresent("#button12"); * await mobile.element.waitToBePresent("p:first-child"); */ waitToBePresent(selector: any, timeout?: number): Promise<boolean>; /** * @function waitToBeVisible * @memberof mobile.element * @description Waits until the element with the given selector is visible. * @param {Object} selector - The CSS selector describing the element. * @param {number} [timeout=30000] - The timeout to wait (ms). * @returns {boolean} Returns true or false. * @example * await mobile.element.waitToBeVisible(".input01"); * await mobile.element.waitToBeVisible("#button12"); * await mobile.element.waitToBeVisible("p:first-child"); */ waitToBeVisible(selector: any, timeout?: number): Promise<boolean>; /** * @function waitToBeClickable * @memberof mobile.element * @description Waits until the element with the given selector is clickable. * @param {Object} selector - The CSS selector describing the element. * @param {number} [timeout=30000] - The timeout to wait (ms). * @returns {boolean} Returns true or false. * @example * await mobile.element.waitToBeClickable(".input01"); * await mobile.element.waitToBeClickable("#button12"); * await mobile.element.waitToBeClickable("p:first-child"); */ waitToBeClickable(selector: any, timeout?: number): Promise<boolean>; /** * @function isSelected * @memberof mobile.element * @description Returns a boolean if the element (e.g. checkbox) is selected. * @param {Element | string} elementOrSelector - The element. * @returns {boolean} Returns true or false. * @example * const isSelected = await mobile.element.isSelected(elem); */ isSelected(elementOrSelector: Element | string): Promise<boolean>; /** * @function waitToBeEnabled * @memberof mobile.element * @description Waits until the element with the given selector is present. * @param {Object} selector - The CSS selector describing the element. * @param {number} [timeout=30000] - The timeout to wait (ms). * @returns {boolean} Returns true or false. * @example * await mobile.element.waitToBeEnabled(".input01"); * await mobile.element.waitToBeEnabled("#button12"); * await mobile.element.waitToBeEnabled("p:first-child"); */ waitToBeEnabled(selector: any, timeout?: number): Promise<boolean>; } declare const _default: ElementModule; export default _default;