UNPKG

@assert-equals/dappdriver

Version:

DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion

140 lines (139 loc) 4.41 kB
import { IHTMLElement } from '../interface/controls/html-element'; import { IPageObject } from '../interface/page/page-object'; import { IConfirmation } from '../interface/wallet/confirmation'; /** * * * @export * @class HTMLElement * @implements {IHTMLElement} */ export declare class HTMLElement implements IHTMLElement { protected cssLocator: string; private element; private timeout; /** * Creates an instance of HTMLElement. * @param {string} cssLocator * @param {number} [timeout=20000] * @param {*} [element=null] * @memberof HTMLElement */ constructor(cssLocator: string, timeout?: number, element?: any); /** * * * @protected * @param {keyof IHTMLElement} methodName * @param {Array<any>} [args=[]] * @return {*} {Promise<any>} * @memberof HTMLElement */ protected callIfMethodExists(methodName: keyof IHTMLElement, args?: Array<any>): Promise<any>; /** * * Schedules a command to click on this element * @template TPage * @param {new () => TPage} [page] * @return {*} {Promise<any>} * @memberof HTMLElement */ click(): Promise<void>; click<TPage>(page: new () => TPage): Promise<TPage>; /** * * Schedules a command to click on this element and wait for the given amount of time * @param {number} [duration=1000] * @return {*} {Promise<void>} * @memberof HTMLElement */ clickAndWait(duration?: number): Promise<void>; /** * * Schedules a command to click on this element and switch the focus of all future commands to another window * @template TPage * @param {new () => TPage} [page] * @return {*} {Promise<any>} * @memberof HTMLElement */ clickAndOpensInNewWindow(): Promise<void>; clickAndOpensInNewWindow<TPage>(page: new () => TPage): Promise<TPage>; /** * * Schedules a command to click on this element and switch the focus of all future commands to the window * @template TPage * @param {new () => TPage} page * @return {*} {Promise<TPage>} * @memberof HTMLElement */ clickAndOpensInWindow<TPage extends IConfirmation | IPageObject>(page: new () => TPage): Promise<TPage>; /** * * Schedules a command to click on this element and switch the focus of all future commands to the main window * @template TPage * @param {new () => TPage} [page] * @return {*} {Promise<any>} * @memberof HTMLElement */ clickAndSwitchToMainWindow(): Promise<void>; clickAndSwitchToMainWindow<TPage>(page: new () => TPage): Promise<TPage>; /** * * Schedules a command to query for the value of the given attribute of the element * @param {string} attribute * @return {*} {(Promise<string | null>)} * @memberof HTMLElement */ getAttribute(attribute: string): Promise<string | null>; /** * * Schedules a command to query for the value of the given css property of the element * @param {string} property * @return {*} {(Promise<string | null>)} * @memberof HTMLElement */ getCssValue(property: string): Promise<string | null>; /** * * Schedules a command to query for the visible innerText of the element * @return {*} {Promise<string>} * @memberof HTMLElement */ getText(): Promise<string>; /** * * Schedules a command to hover over this element * @return {*} {Promise<void>} * @memberof HTMLElement */ hover(): Promise<void>; /** * * Schedules a command to query whether this element is currently displayed * @return {*} {Promise<boolean>} * @memberof HTMLElement */ isDisplayed(): Promise<boolean>; /** * * Schedules a command to query whether the element is enabled * @return {*} {Promise<boolean>} * @memberof HTMLElement */ isEnabled(): Promise<boolean>; /** * * Schedules a command to query whether the element is visible * @return {*} {Promise<boolean>} * @memberof HTMLElement */ isVisible(): Promise<boolean>; /** * * Schedules a command to type a sequence in the element * @param {string} keys * @return {*} {Promise<void>} * @memberof HTMLElement */ type(keys: string): Promise<void>; }