UNPKG

@theintern/leadfoot

Version:

Leadfoot. A JavaScript client library that brings cross-platform consistency to the Selenium WebDriver API.

50 lines (49 loc) 2.01 kB
import Locator, { Strategy } from './lib/Locator'; import { CancellablePromise } from '@theintern/common'; import Session from './Session'; export default class Element extends Locator<CancellablePromise<Element>, CancellablePromise<Element[]>, CancellablePromise<void>> { private _elementId; private _session; constructor(elementId: any, session: Session); get elementId(): string; get session(): Session; private _get; private _post; toJSON(): { ELEMENT: string; 'element-6066-11e4-a52e-4f735466cecf': string; }; private _normalizeWhitespace; private _uploadFile; find(using: Strategy, value: string): CancellablePromise<Element>; findAll(using: Strategy, value: string): CancellablePromise<Element[]>; click(): CancellablePromise<void>; submit(): CancellablePromise<void>; getVisibleText(): CancellablePromise<string>; type(value: string | string[]): CancellablePromise<void>; getTagName(): CancellablePromise<string>; clearValue(): CancellablePromise<void>; isSelected(): CancellablePromise<boolean>; isEnabled(): CancellablePromise<boolean>; getSpecAttribute(name: string): CancellablePromise<string | null>; getAttribute(name: string): CancellablePromise<string | null>; getProperty<T = any>(name: string): CancellablePromise<T>; equals(other: Element): CancellablePromise<boolean>; isDisplayed(): CancellablePromise<boolean>; getPosition(): CancellablePromise<{ x: number; y: number; }>; getSize(): CancellablePromise<{ width: number; height: number; }>; getComputedStyle(propertyName: string): CancellablePromise<string>; findDisplayed(using: Strategy, value: string): CancellablePromise<Element>; waitForDeleted(strategy: Strategy, value: string): CancellablePromise<void>; } export declare type ElementOrElementId = { ELEMENT: string; } | { 'element-6066-11e4-a52e-4f735466cecf': string; } | Element | string;