UNPKG

cabbie-async

Version:
58 lines (57 loc) 2.21 kB
import Driver from './driver'; import { ElementHandle } from './flow-types/element-handle'; import { SelectorType } from './enums/selector-types'; import BaseClass from './base-class'; import Mouse from './mouse'; import Touch from './touch'; declare class Element extends BaseClass { _parent: Element | Driver; _selector: string; elementID: string; mouse: Mouse; touch: Touch; constructor(driver: Driver, parent: Element | Driver, selector: string, elementHandle: ElementHandle); getAttribute(attribute: string): Promise<string>; hasClass(className: string): Promise<boolean>; getText(): Promise<string>; getTagName(): Promise<string>; getCssValue(property: string): Promise<string>; isDisplayed(): Promise<boolean>; isSelected(): Promise<boolean>; isEqual(element: Element): Promise<boolean>; isEnabled(): Promise<boolean>; isDisabled(): Promise<boolean>; sendKeys(str: string | Array<string>): Promise<void>; clear(): Promise<void>; submit(): Promise<void>; getSize(): Promise<{ width: number; height: number; }>; getPosition(): Promise<{ x: number; y: number; }>; getFrame(): Promise<{ x: number; y: number; width: number; height: number; }>; getAbsoluteCenter(): Promise<{ x: number; y: number; }>; getRelativeCenter(): Promise<{ x: number; y: number; }>; getElement(selector: string, selectorType?: SelectorType): Promise<Element>; tryGetElement(selector: string, selectorType?: SelectorType): Promise<Element | null>; getElements(selector: string, selectorType?: SelectorType): Promise<Array<Element>>; getElementsByTextContent(textContent: string, selector?: string, selectorType?: SelectorType): Promise<Array<Element>>; getElementByTextContent(textContent: string, selector?: string, selectorType?: SelectorType): Promise<Element>; tryGetElementByTextContent(textContent: string, selector?: string, selectorType?: SelectorType): Promise<Element | null>; hasElement(selector: string, selectorType?: SelectorType): Promise<boolean>; } export default Element;