appium-mac2-driver
Version:
XCTest-based Appium driver for macOS apps automation
278 lines • 17.3 kB
TypeScript
/**
* Set value to the given element.
* Note:
* This is not exposed as 'macos: setValue' because this is the same as
* element.send_keys in W3C WebDriver spec.
*
* @this {Mac2Driver}
* @param {string} elementId Uuid of the element to set value for.
* @param {any} [value] Value to set. Could also be an array.
* @param {string} [text] Text to set. If both value and text are set then `value` is preferred
* @param {number} [keyModifierFlags] If set then the given key modifiers will
* be applied while the element value is being set. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details.
*/
export function macosSetValue(this: import("../driver").Mac2Driver, elementId: string, value?: any, text?: string, keyModifierFlags?: number): Promise<any>;
/**
* Perform click gesture on an element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {string} [elementId] Uuid of the element to click. Either this property
* or/and x and y must be set. If both are set then x and y are
* considered as relative element coordinates. If only x and y
* are set then these are parsed as absolute coordinates.
* @param {number} [x] Click X coordinate
* @param {number} [y] Click Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while click is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosClick(this: import("../driver").Mac2Driver, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform scroll gesture on an element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {number} deltaX Horizontal delta as float number
* @param {number} deltaY Vertical delta as float number
* @param {string} [elementId] Uuid of the element to be scrolled. Either this property
* or/and x and y must be set. If both are set then x and y are
* considered as relative element coordinates. If only x and y are
* set then these are parsed as absolute coordinates.
* @param {number} [x] Scroll X coordinate
* @param {number} [y] Scroll Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while scroll is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosScroll(this: import("../driver").Mac2Driver, deltaX: number, deltaY: number, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform swipe gesture on an element
*
* @this {Mac2Driver}
* @param {'up'|'down'|'left'|'right'} direction Swipe direction
* @param {string} [elementId] Uuid of the element to be swiped. Either this property
* or/and x and y must be set. If both are set then x and y are
* considered as relative element coordinates. If only x and y are
* set then these are parsed as absolute coordinates.
* @param {number} [x] Swipe X coordinate
* @param {number} [y] Swipe Y coordinate
* @param {number} [velocity] The value is measured in pixels per second and same
* values could behave differently on different devices depending
* on their display density. Higher values make swipe gesture faster
* (which usually scrolls larger areas if we apply it to a list)
* and lower values slow it down. Only values greater than zero have effect.
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while scroll is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosSwipe(this: import("../driver").Mac2Driver, direction: "up" | "down" | "left" | "right", elementId?: string, x?: number, y?: number, velocity?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform right click gesture on an element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {string} [elementId] Uuid of the element to click. Either this property
* or/and x and y must be set. If both are set then x and y are
* considered as relative element coordinates. If only x and y
* are set then these are parsed as absolute coordinates.
* @param {number} [x] Click X coordinate
* @param {number} [y] Click Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while click is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosRightClick(this: import("../driver").Mac2Driver, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform hover gesture on an element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {string} [elementId] Uuid of the element to hover. Either this property
* or/and x and y must be set. If both are set then x and y are
* considered as relative element coordinates. If only x and y
* are set then these are parsed as absolute coordinates.
* @param {number} [x] Click X coordinate
* @param {number} [y] Click Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while click is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosHover(this: import("../driver").Mac2Driver, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform double click gesture on an element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {string} [elementId] Uuid of the element to hover. Either this property
* or/and x and y must be set. If both are set then x and y are
* considered as relative element coordinates. If only x and y
* are set then these are parsed as absolute coordinates.
* @param {number} [x] Click X coordinate
* @param {number} [y] Click Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while click is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosDoubleClick(this: import("../driver").Mac2Driver, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform long click and drag gesture on an element or by absolute coordinates
*
* @this {Mac2Driver}
* @param {number} duration Long click duration in float seconds
* @param {string} [sourceElementId] Uuid of the element to start the drag from.
* Either this property and `destinationElement` must be provided
* or `startX`, `startY`, `endX`, `endY` coordinates must be set.
* @param {string} [destinationElementId] Uuid of the element to end the drag on.
* Either this property and `sourceElement` must be provided or
* `startX`, `startY`, `endX`, `endY` coordinatesmust be set.
* @param {number} [startX] Starting X coordinate
* @param {number} [startY] Starting Y coordinate
* @param {number} [endX] Ending X coordinate
* @param {number} [endY] Ending Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while drag is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosClickAndDrag(this: import("../driver").Mac2Driver, duration: number, sourceElementId?: string, destinationElementId?: string, startX?: number, startY?: number, endX?: number, endY?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform long click, drag and hold gesture on an element or by absolute coordinates
*
* @this {Mac2Driver}
* @param {number} duration Long click duration in float seconds
* @param {number} holdDuration Touch hold duration in float seconds
* @param {string} [sourceElementId] Uuid of the element to start the drag from.
* Either this property and `destinationElement` must be provided
* or `startX`, `startY`, `endX`, `endY` coordinates must be set.
* @param {string} [destinationElementId] Uuid of the element to end the drag on.
* Either this property and `sourceElement` must be provided
* or `startX`, `startY`, `endX`, `endY` coordinates must be set.
* @param {number} [startX] Starting X coordinate
* @param {number} [startY] Starting Y coordinate
* @param {number} [endX] Ending X coordinate
* @param {number} [endY] Ending Y coordinate
* @param {number} [velocity] Dragging velocity in pixels per second.
* If not provided then the default velocity is used. See
* https://developer.apple.com/documentation/xctest/xcuigesturevelocity
* for more details
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while drag is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details */
export function macosClickAndDragAndHold(this: import("../driver").Mac2Driver, duration: number, holdDuration: number, sourceElementId?: string, destinationElementId?: string, startX?: number, startY?: number, endX?: number, endY?: number, velocity?: number, keyModifierFlags?: number): Promise<any>;
/**
* Send keys to the given element or to the application under test
*
* @this {Mac2Driver}
* @param {(import('../types').KeyOptions | string)[]} keys Array of keys to type.
* Each item could either be a string, that represents a key itself (see
* https://developer.apple.com/documentation/xctest/xcuielement/1500604-typekey
* and https://developer.apple.com/documentation/xctest/xcuikeyboardkey)
* or a dictionary, if the key should also be entered with modifiers.
* @param {string} [elementId] Uuid of the element to send the keys to.
* If unset then keys are sent to the current application
* under test.
*/
export function macosKeys(this: import("../driver").Mac2Driver, keys: (import("../types").KeyOptions | string)[], elementId?: string): Promise<any>;
/**
* Perform tap gesture on a Touch Bar element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {string} [elementId] Uuid of the Touch Bar element to tap. Either this property
* or/and x and y must be set. If both are set then x and y are considered
* as relative element coordinates. If only x and y are set then
* these are parsed as absolute Touch Bar coordinates.
* @param {number} [x] Tap X coordinate
* @param {number} [y] Tap Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while click is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosTap(this: import("../driver").Mac2Driver, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform tap gesture on a Touch Bar element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {string} [elementId] Uuid of the Touch Bar element to tap. Either this property
* or/and x and y must be set. If both are set then x and y are considered
* as relative element coordinates. If only x and y are set then
* these are parsed as absolute Touch Bar coordinates.
* @param {number} [x] Tap X coordinate
* @param {number} [y] Tap Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while click is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosDoubleTap(this: import("../driver").Mac2Driver, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform press gesture on a Touch Bar element or by relative/absolute coordinates
*
* @this {Mac2Driver}
* @param {number} duration The number of float seconds to hold the mouse button
* @param {string} [elementId] Uuid of the Touch Bar element to be pressed. Either this property
* or/and x and y must be set. If both are set then x and y are considered
* as relative element coordinates. If only x and y are set then these are
* parsed as absolute Touch Bar coordinates.
* @param {number} [x] Press X coordinate
* @param {number} [y] Press Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while click is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosPressAndHold(this: import("../driver").Mac2Driver, duration: number, elementId?: string, x?: number, y?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform long press and drag gesture on a Touch Bar element or by absolute coordinates
*
* @this {Mac2Driver}
* @param {number} duration Long press duration in float seconds
* @param {string} [sourceElementId] Uuid of a Touch Bar element to start the drag from.
* Either this property and `destinationElement` must be provided or
* `startX`, `startY`, `endX`, `endY` coordinates must be set.
* @param {string} [destinationElementId] Uuid of a Touch Bar element to end the drag on.
* Either this property and `sourceElement` must be provided or
* `startX`, `startY`, `endX`, `endY` coordinates must be set.
* @param {number} [startX] Starting X coordinate
* @param {number} [startY] Starting Y coordinate
* @param {number} [endX] Ending X coordinate
* @param {number} [endY] Ending Y coordinate
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while drag is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosPressAndDrag(this: import("../driver").Mac2Driver, duration: number, sourceElementId?: string, destinationElementId?: string, startX?: number, startY?: number, endX?: number, endY?: number, keyModifierFlags?: number): Promise<any>;
/**
* Perform press, drag and hold gesture on a Touch Bar element or by absolute Touch Bar coordinates
*
* @this {Mac2Driver}
* @param {number} duration Long press duration in float seconds
* @param {number} holdDuration Touch hold duration in float seconds
* @param {string} [sourceElementId] Uuid of a Touch Bar element to start the drag from.
* Either this property and `destinationElement` must be provided or
* `startX`, `startY`, `endX`, `endY` coordinates must be set.
* @param {string} [destinationElementId] Uuid of a Touch Bar element to end the drag on.
* Either this property and `sourceElement` must be provided or
* `startX`, `startY`, `endX`, `endY` coordinates must be set.
* @param {number} [startX] Starting X coordinate
* @param {number} [startY] Starting Y coordinate
* @param {number} [endX] Ending X coordinate
* @param {number} [endY] Ending Y coordinate
* @param {number} [velocity] Dragging velocity in pixels per second.
* If not provided then the default velocity is used. See
* https://developer.apple.com/documentation/xctest/xcuigesturevelocity
* for more details
* @param {number} [keyModifierFlags] If set then the given key modifiers will be
* applied while drag is performed. See
* https://developer.apple.com/documentation/xctest/xcuikeymodifierflags
* for more details
*/
export function macosPressAndDragAndHold(this: import("../driver").Mac2Driver, duration: number, holdDuration: number, sourceElementId?: string, destinationElementId?: string, startX?: number, startY?: number, endX?: number, endY?: number, velocity?: number, keyModifierFlags?: number): Promise<any>;
export type Mac2Driver = import("../driver").Mac2Driver;
//# sourceMappingURL=gestures.d.ts.map