UNPKG

appium-android-driver

Version:

Android UiAutomator and Chrome support for Appium

126 lines 5.61 kB
import type { Position, Size } from '@appium/types'; import type { AndroidDriver } from '../driver'; import type { DoSetElementValueOpts } from './types'; /** * Gets an attribute value from an element. * * @param attribute The name of the attribute to retrieve. * @param elementId The element identifier. * @returns Promise that resolves to the attribute value, or `null` if not found. * @throws {errors.NotImplementedError} This method is not implemented. */ export declare function getAttribute(this: AndroidDriver, attribute: string, elementId: string): Promise<string | null>; /** * Clicks on an element. * * @param elementId The element identifier. * @returns Promise that resolves when the click is performed. * @throws {errors.NotImplementedError} This method is not implemented. */ export declare function click(this: AndroidDriver, elementId: string): Promise<void>; /** * Gets the text content of an element. * * @param elementId The element identifier. * @returns Promise that resolves to the element's text content. * @throws {errors.NotImplementedError} This method is not implemented. */ export declare function getText(this: AndroidDriver, elementId: string): Promise<string>; /** * Gets the location of an element on the screen. * * @param elementId The element identifier. * @returns Promise that resolves to the element's position (x, y coordinates). * @throws {errors.NotImplementedError} This method is not implemented. */ export declare function getLocation(this: AndroidDriver, elementId: string): Promise<Position>; /** * Gets the size of an element. * * @param elementId The element identifier. * @returns Promise that resolves to the element's size (width, height). * @throws {errors.NotImplementedError} This method is not implemented. */ export declare function getSize(this: AndroidDriver, elementId: string): Promise<Size>; /** * Gets the class name of an element. * * @param elementId The element identifier. * @returns Promise that resolves to the element's class name. */ export declare function getName(this: AndroidDriver, elementId: string): Promise<string>; /** * Checks if an element is displayed. * * @param elementId The element identifier. * @returns Promise that resolves to `true` if the element is displayed, `false` otherwise. */ export declare function elementDisplayed(this: AndroidDriver, elementId: string): Promise<boolean>; /** * Checks if an element is enabled. * * @param elementId The element identifier. * @returns Promise that resolves to `true` if the element is enabled, `false` otherwise. */ export declare function elementEnabled(this: AndroidDriver, elementId: string): Promise<boolean>; /** * Checks if an element is selected. * * @param elementId The element identifier. * @returns Promise that resolves to `true` if the element is selected, `false` otherwise. */ export declare function elementSelected(this: AndroidDriver, elementId: string): Promise<boolean>; /** * Sets the value of an element. * * @param keys The text to set, either as a string or an array of strings (which will be joined). * @param elementId The element identifier. * @param replace If `true`, replaces the existing value. If `false`, appends to it. Defaults to `false`. * @returns Promise that resolves when the value is set. */ export declare function setElementValue(this: AndroidDriver, keys: string | string[], elementId: string, replace?: boolean): Promise<void>; /** * Sets the value of an element. * * Reason for isolating doSetElementValue from setElementValue is for reusing setElementValue * across android-drivers (like appium-uiautomator2-driver) and to avoid code duplication. * Other android-drivers (like appium-uiautomator2-driver) need to override doSetElementValue * to facilitate setElementValue. * * @param params The parameters for setting the element value. * @returns Promise that resolves when the value is set. * @throws {errors.NotImplementedError} This method is not implemented. */ export declare function doSetElementValue(this: AndroidDriver, params: DoSetElementValueOpts): Promise<void>; /** * Sets the value of an element (appends to existing value). * * @param keys The text to set, either as a string or an array of strings (which will be joined). * @param elementId The element identifier. * @returns Promise that resolves when the value is set. */ export declare function setValue(this: AndroidDriver, keys: string | string[], elementId: string): Promise<void>; /** * Replaces the value of an element. * * @param keys The text to set, either as a string or an array of strings (which will be joined). * @param elementId The element identifier. * @returns Promise that resolves when the value is replaced. */ export declare function replaceValue(this: AndroidDriver, keys: string | string[], elementId: string): Promise<void>; /** * Sets the value of an element immediately using ADB input. * * @param keys The text to set, either as a string or an array of strings (which will be joined). * @param elementId The element identifier. * @returns Promise that resolves when the value is set. */ export declare function setValueImmediate(this: AndroidDriver, keys: string | string[], elementId: string): Promise<void>; /** * Gets the location of an element relative to the view. * * @param elementId The element identifier. * @returns Promise that resolves to the element's position (x, y coordinates). */ export declare function getLocationInView(this: AndroidDriver, elementId: string): Promise<Position>; //# sourceMappingURL=element.d.ts.map