appium-espresso-driver
Version:
Espresso integration for Appium
105 lines • 6.78 kB
TypeScript
import type { EspressoDriver } from '../driver.js';
/**
* Flash the element with given id.
* durationMillis and repeatCount are optional
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-flashelement
* @param elementId - The ID of the element to flash
* @param durationMillis - Optional duration in milliseconds for each flash
* @param repeatCount - Optional number of times to repeat the flash
* @returns Promise that resolves when the flash command is executed
*/
export declare function mobileFlashElement(this: EspressoDriver, elementId: string, durationMillis?: number, repeatCount?: number): Promise<any>;
/**
* Dismisses the autofill UI for the given element.
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-dismissautofill
* @param elementId - The ID of the element for which to dismiss autofill
* @returns Promise that resolves when the autofill is dismissed
*/
export declare function mobileDismissAutofill(this: EspressoDriver, elementId: string): Promise<void>;
/**
* Performs a swipe gesture on the given element.
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-swipe
* @param elementId - The ID of the element to swipe
* @param direction - Optional swipe direction (e.g., 'up', 'down', 'left', 'right')
* @param swiper - Optional swiper configuration
* @param startCoordinates - Optional starting coordinates for the swipe
* @param endCoordinates - Optional ending coordinates for the swipe
* @param precisionDescriber - Optional precision describer for the swipe action
* @returns Promise that resolves when the swipe is completed
*/
export declare function mobileSwipe(this: EspressoDriver, elementId: string, direction?: string, swiper?: string, startCoordinates?: string, endCoordinates?: string, precisionDescriber?: string): Promise<any>;
/**
* Opens a drawer element (e.g., Navigation Drawer) with the specified gravity.
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-opendrawer
* @param elementId - The ID of the drawer element to open
* @param gravity - Optional gravity value for drawer positioning (e.g., Gravity.START, Gravity.END)
* @returns Promise that resolves when the drawer is opened
*/
export declare function mobileOpenDrawer(this: EspressoDriver, elementId: string, gravity?: number): Promise<any>;
/**
* Closes a drawer element (e.g., Navigation Drawer) with the specified gravity.
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-closedrawer
* @param elementId - The ID of the drawer element to close
* @param gravity - Optional gravity value for drawer positioning (e.g., Gravity.START, Gravity.END)
* @returns Promise that resolves when the drawer is closed
*/
export declare function mobileCloseDrawer(this: EspressoDriver, elementId: string, gravity?: number): Promise<any>;
/**
* Sets the date on a date picker element.
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-setdate
* @param elementId - The ID of the date picker element
* @param year - The year to set (e.g., 2024)
* @param monthOfYear - The month to set (0-11, where 0 is January)
* @param dayOfMonth - The day of the month to set (1-31)
* @returns Promise that resolves when the date is set
*/
export declare function mobileSetDate(this: EspressoDriver, elementId: string, year: number, monthOfYear: number, dayOfMonth: number): Promise<any>;
/**
* Sets the time on a time picker element.
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-settime
* @param elementId - The ID of the time picker element
* @param hours - The hour to set (0-23)
* @param minutes - The minute to set (0-59)
* @returns Promise that resolves when the time is set
*/
export declare function mobileSetTime(this: EspressoDriver, elementId: string, hours: number, minutes: number): Promise<any>;
/**
* Navigates to a menu item in a navigation element (e.g., BottomNavigationView).
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-navigateto
* @param elementId - The ID of the navigation element
* @param menuItemId - The ID of the menu item to navigate to (must be a non-negative number)
* @returns Promise that resolves when navigation is completed
* @throws {errors.InvalidArgumentError} If menuItemId is not a non-negative number
*/
export declare function mobileNavigateTo(this: EspressoDriver, elementId: string, menuItemId: number | string): Promise<any>;
/**
* Perform a 'GeneralClickAction' (https://developer.android.com/reference/androidx/test/espresso/action/GeneralClickAction)
*
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-clickaction
* @param elementId - The ID of the element to perform the click action on
* @param tapper - Optional tapper configuration for the click action
* @param coordinatesProvider - Optional coordinates provider for the click position
* @param precisionDescriber - Optional precision describer for the click action
* @param inputDevice - Optional input device identifier
* @param buttonState - Optional button state for the click action
* @returns Promise that resolves when the click action is performed
*/
export declare function mobileClickAction(this: EspressoDriver, elementId: string, tapper?: string, coordinatesProvider?: string, precisionDescriber?: string, inputDevice?: number, buttonState?: number): Promise<any>;
/**
* Scrolls to a specific page in a ViewPager or similar scrollable element.
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-scrolltopage
* @param elementId - The ID of the scrollable element (e.g., ViewPager)
* @param scrollTo - Optional direction to scroll: 'first', 'last', 'left', or 'right'
* @param scrollToPage - Optional page index to scroll to (must be non-negative)
* @param smoothScroll - Optional flag to enable smooth scrolling (default: false)
* @returns Promise that resolves when scrolling is completed
* @throws {errors.InvalidArgumentError} If scrollTo is not one of the valid values or scrollToPage is negative
*/
export declare function mobileScrollToPage(this: EspressoDriver, elementId: string, scrollTo?: string, scrollToPage?: number, smoothScroll?: boolean): Promise<any>;
/**
* Performs an editor action (e.g., IME action like DONE, SEARCH, NEXT) on the current input field.
* @param action - The editor action to perform (can be a string or numeric action code)
* @returns Promise that resolves when the editor action is performed
*/
export declare function mobilePerformEditorAction(this: EspressoDriver, action: string | number): Promise<void>;
//# sourceMappingURL=element.d.ts.map