import { Point } from "./point"; import { Direction } from "./direction"; import { INsCapabilities } from "./interfaces/ns-capabilities"; export declare class UIElement { private _element; private _driver; private _wd; private _webio; private _args; private _searchMethod; private _searchParams; private _index?; private static readonly DEFAULT_REFETCH_TIME; constructor(_element: any, _driver: any, _wd: any, _webio: any, _args: INsCapabilities, _searchMethod: string, _searchParams: string, _index?: number); /** * Click on element */ click(): Promise; tapCenter(): Promise; tapAtTheEnd(): Promise; /** * @deprecated * Tap on element * This method is not working very good with UiAutomator2 * It is better to use click instead. */ tap(): Promise; /** * Double tap on element */ doubleTap(): Promise; /** * Get location of element */ location(): Promise; /** * Get size of element */ size(): Promise; /** * Get text of element */ text(): Promise; /** * Returns if an element is selected */ isSelected(): Promise; /** * Selected an element */ select(retries?: number): Promise; /** * Returns if an element is checked */ isChecked(): Promise; /** * Get web driver element */ element(): Promise; /** * Shows if element is displayed. Returns true or false. If the element doesn't exist it will return false */ isDisplayed(): Promise; /** * Returns true or false */ exists(): Promise; /** * Waits until the element exists not. * @param wait */ waitForExistNot(wait?: number): Promise; /** * Wait until the elements appear * @param wait */ waitForExist(wait?: number): Promise; /** * Get attribute of element * @param attr */ getAttribute(attr: any): Promise; /** * Get rectangle of element */ getRectangle(): Promise<{ x: number; y: number; width: number; height: number; }>; /** * Get rectangle of element in actual dimensions */ getActualRectangle(): Promise<{ x: number; y: number; width: number; height: number; }>; /** * Scroll with offset from element with minimum inertia * @param direction * @param yOffset * @param xOffset */ scroll(direction: Direction, yOffset?: number, xOffset?: number): Promise; /** * Scroll with offset from element with minimum inertia * @param direction * @param yOffset * @param xOffset */ scrollTo(direction: Direction, elementToSearch: () => Promise, yOffset?: number, xOffset?: number, retries?: number): Promise; /** * Drag element with specific offset * @param direction * @param yOffset * @param xOffset - default value 0 */ drag(direction: Direction, yOffset: number, xOffset?: number): Promise; /** * Click and hold over an element * @param time in milliseconds to increase the default press period. */ hold(time?: number): Promise; /** * Send keys to field or other UI component * @param text The string to input * @param shouldClearText Clears existing input before send new one - default value is 'true' * @param useAdb default value is false. Usable for Android ONLY ! * Must be combined with '--relaxed-security' appium flag. When not running in sauceLabs '--ignoreDeviceController' should be added too. * @param adbDeleteCharsCount default value is 10. Usable for Android ONLY when 'useAdb' and 'shouldClearText' are True! */ sendKeys(text: string, shouldClearText?: boolean, useAdb?: boolean, adbDeleteCharsCount?: number): Promise; /** * Type text to field or other UI component * @param text * @param shouldClearText, default value is true */ type(text: string, shouldClearText?: boolean): Promise; /** * Send key code to device * @param key code */ pressKeycode(keyCode: number): Promise; /** * Clears text from ui element */ clearText(): Promise; /** * Clears text from ui element with ADB. Android ONLY ! * Must be combined with '--relaxed-security' appium flag. When not running in sauceLabs '--ignoreDeviceController' should be added too. * @param charactersCount Characters count to delete. (Optional - default value 10) */ adbDeleteText(charactersCount?: number): Promise; log(): Promise; refetch(): Promise; /** * Easy to use in order to chain and search for nested elements */ driver(): any; /** * Swipe element left/right * @param direction */ swipe(direction: Direction): Promise; }