appium-uiautomator2-driver
Version:
UiAutomator2 integration for Appium
97 lines • 4.16 kB
TypeScript
import type { DoSetElementValueOpts } from 'appium-android-driver';
import type { Element as AppiumElement, Position, Rect, Size } from '@appium/types';
import type { AndroidUiautomator2Driver } from '../driver';
/**
* Gets the currently active element.
* @returns The currently active element.
*/
export declare function active(this: AndroidUiautomator2Driver): Promise<AppiumElement>;
/**
* Gets an element attribute value.
* @param attribute - Name of the attribute to retrieve.
* @param elementId - ID of the element.
* @returns The attribute value as a string.
*/
export declare function getAttribute(this: AndroidUiautomator2Driver, attribute: string, elementId: string): Promise<string>;
/**
* Returns whether the element is displayed.
* @param elementId - ID of the element.
* @returns True if the element is displayed, false otherwise.
*/
export declare function elementDisplayed(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
/**
* Returns whether the element is enabled.
* @param elementId - ID of the element.
* @returns True if the element is enabled, false otherwise.
*/
export declare function elementEnabled(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
/**
* Returns whether the element is selected.
* @param elementId - ID of the element.
* @returns True if the element is selected, false otherwise.
*/
export declare function elementSelected(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
/**
* Gets the element tag name.
* @param elementId - ID of the element.
* @returns The element tag name.
*/
export declare function getName(this: AndroidUiautomator2Driver, elementId: string): Promise<string>;
/**
* Gets the element location.
* @param elementId - ID of the element.
* @returns The element position coordinates (x, y).
*/
export declare function getLocation(this: AndroidUiautomator2Driver, elementId: string): Promise<Position>;
/**
* Gets the element size.
* @param elementId - ID of the element.
* @returns The element size (width, height).
*/
export declare function getSize(this: AndroidUiautomator2Driver, elementId: string): Promise<Size>;
/**
* Sets the value of an element using the upstream driver API.
* @param params - Options containing the element ID and value to set.
*/
export declare function doSetElementValue(this: AndroidUiautomator2Driver, params: DoSetElementValueOpts): Promise<void>;
/**
* Sends text to an element without replacement.
* @param keys - Text to send, either as a string or array of strings (which will be joined).
* @param elementId - ID of the element.
*/
export declare function setValueImmediate(this: AndroidUiautomator2Driver, keys: string | string[], elementId: string): Promise<void>;
/**
* Gets the element text.
* @param elementId - ID of the element.
* @returns The element text content.
*/
export declare function getText(this: AndroidUiautomator2Driver, elementId: string): Promise<string>;
/**
* Clicks the given element.
* @param element - ID of the element to click.
*/
export declare function click(this: AndroidUiautomator2Driver, element: string): Promise<void>;
/**
* Takes a screenshot of the element.
* @param element - ID of the element.
* @returns Base64-encoded PNG screenshot of the element.
*/
export declare function getElementScreenshot(this: AndroidUiautomator2Driver, element: string): Promise<string>;
/**
* Clears the element text.
* @param elementId - ID of the element to clear.
*/
export declare function clear(this: AndroidUiautomator2Driver, elementId: string): Promise<void>;
/**
* Gets the element rectangle.
* @param elementId - ID of the element.
* @returns The element rectangle (x, y, width, height).
*/
export declare function getElementRect(this: AndroidUiautomator2Driver, elementId: string): Promise<Rect>;
/**
* Replaces the element text.
* @param elementId - ID of the element.
* @param text - Text to replace the current element value with.
*/
export declare function mobileReplaceElementValue(this: AndroidUiautomator2Driver, elementId: string, text: string): Promise<void>;
//# sourceMappingURL=element.d.ts.map