appium-xcuitest-driver 10.12.1 → 10.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/lib/commands/context.d.ts +130 -161
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +122 -107
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/execute.js +1 -1
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/general.js +1 -1
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/gesture.d.ts +103 -119
- package/build/lib/commands/gesture.d.ts.map +1 -1
- package/build/lib/commands/gesture.js +98 -138
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/commands/pcap.d.ts +1 -1
- package/build/lib/commands/pcap.d.ts.map +1 -1
- package/build/lib/commands/performance.d.ts +1 -1
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/record-audio.d.ts +2 -1
- package/build/lib/commands/record-audio.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +2 -1
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +3 -5
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/timeouts.js +1 -1
- package/build/lib/commands/timeouts.js.map +1 -1
- package/build/lib/commands/web.d.ts +199 -202
- package/build/lib/commands/web.d.ts.map +1 -1
- package/build/lib/commands/web.js +206 -174
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/driver.d.ts +2 -1
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +10 -4
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +0 -1
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/{context.js → context.ts} +172 -145
- package/lib/commands/execute.js +1 -1
- package/lib/commands/general.js +1 -1
- package/lib/commands/{gesture.js → gesture.ts} +225 -183
- package/lib/commands/screenshots.js +3 -5
- package/lib/commands/timeouts.js +1 -1
- package/lib/commands/{web.js → web.ts} +305 -263
- package/lib/driver.ts +11 -4
- package/lib/execute-method-map.ts +0 -1
- package/npm-shrinkwrap.json +14 -89
- package/package.json +2 -2
|
@@ -1,36 +1,42 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { ActionSequence, Element } from '@appium/types';
|
|
3
|
+
import type { Direction } from './types';
|
|
1
4
|
/**
|
|
5
|
+
* Shakes the device.
|
|
2
6
|
*
|
|
3
|
-
* @param {any[]} gestures
|
|
4
|
-
* @param {string[]|null} keysToInclude
|
|
5
|
-
* @returns {string}
|
|
6
|
-
*/
|
|
7
|
-
export function gesturesChainToString(gestures: any[], keysToInclude?: string[] | null): string;
|
|
8
|
-
/**
|
|
9
|
-
* Shake the device
|
|
10
|
-
* @this {XCUITestDriver}
|
|
11
7
|
* @group Simulator Only
|
|
8
|
+
* @throws {Error} If called on a real device
|
|
12
9
|
*/
|
|
13
|
-
export function mobileShake(this:
|
|
10
|
+
export declare function mobileShake(this: XCUITestDriver): Promise<void>;
|
|
14
11
|
/**
|
|
15
|
-
*
|
|
12
|
+
* Clicks on an element.
|
|
13
|
+
*
|
|
14
|
+
* In web context, uses native web tap if configured, otherwise uses atom-based clicking.
|
|
15
|
+
* In native context, delegates to native click.
|
|
16
16
|
*/
|
|
17
|
-
export function click(this:
|
|
17
|
+
export declare function click(this: XCUITestDriver, el: Element | string): Promise<void>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Releases all actions.
|
|
20
|
+
*
|
|
21
|
+
* On this platform, this is a no-op.
|
|
20
22
|
*/
|
|
21
|
-
export function releaseActions(this:
|
|
23
|
+
export declare function releaseActions(this: XCUITestDriver): Promise<void>;
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* Performs a sequence of W3C actions.
|
|
26
|
+
*
|
|
27
|
+
* Automatically converts MOUSE pointer type to TOUCH and filters out zero-duration pauses.
|
|
28
|
+
*
|
|
29
|
+
* @param actions - Array of action sequences to perform
|
|
30
|
+
* @throws {errors.InvalidArgumentError} If actions contain web elements
|
|
26
31
|
*/
|
|
27
|
-
export function performActions(this:
|
|
32
|
+
export declare function performActions(this: XCUITestDriver, actions: ActionSequence[]): Promise<void>;
|
|
28
33
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
34
|
+
* Performs a native click on an element.
|
|
35
|
+
*
|
|
36
|
+
* @param el - Element to click
|
|
31
37
|
* @group Native Only
|
|
32
38
|
*/
|
|
33
|
-
export function nativeClick(this:
|
|
39
|
+
export declare function nativeClick(this: XCUITestDriver, el: Element | string): Promise<void>;
|
|
34
40
|
/**
|
|
35
41
|
* Scrolls the current viewport to the given element.
|
|
36
42
|
*
|
|
@@ -39,13 +45,11 @@ export function nativeClick(this: import("../driver").XCUITestDriver, el: import
|
|
|
39
45
|
* This API uses native XCTest calls, so it is performant. The same native call is implicitly performed by a `click` command if the destination element is outside the current viewport.
|
|
40
46
|
*
|
|
41
47
|
* @since 4.7.0
|
|
42
|
-
* @
|
|
48
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to scroll to. The destination element must be located in a scrollable container and must be hittable. If the element is already present in the current viewport then no action is performed.
|
|
49
|
+
* @throws {errors.InvalidArgumentError} If elementId is not provided
|
|
43
50
|
* @privateRemarks See https://github.com/facebook/WebDriverAgent/blob/master/WebDriverAgentLib/Commands/FBElementCommands.m for details on WDA gestures API
|
|
44
|
-
* @param {Element|string} elementId - The internal element identifier (as hexadecimal hash string) to scroll to. The destination element must be located in a scrollable container and must be hittable. If the element is already present in the current viewport then no action is performed.
|
|
45
|
-
* @returns {Promise<void>}
|
|
46
|
-
* @this {XCUITestDriver}
|
|
47
51
|
*/
|
|
48
|
-
export function mobileScrollToElement(this:
|
|
52
|
+
export declare function mobileScrollToElement(this: XCUITestDriver, elementId: Element | string): Promise<void>;
|
|
49
53
|
/**
|
|
50
54
|
* Scrolls an element or the entire screen.
|
|
51
55
|
*
|
|
@@ -60,35 +64,34 @@ export function mobileScrollToElement(this: import("../driver").XCUITestDriver,
|
|
|
60
64
|
* - If it is necessary to perform many scroll gestures on parent container to reach the necessary child element (tens of them), then the method call may fail. *
|
|
61
65
|
* - The implementation of this extension relies on several undocumented XCTest features, which might not always be reliable.
|
|
62
66
|
*
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
69
|
-
* @
|
|
70
|
-
* @this {XCUITestDriver}
|
|
67
|
+
* @param name - The internal element identifier (as hexadecimal hash string) to scroll on (e.g. the container). The Application element will be used if this argument is not provided.
|
|
68
|
+
* @param direction - The main difference between this command and a `mobile: swipe` command using the same direction is that `mobile: scroll` will attempt to move the current viewport exactly to the next or previous page (the term "page" means the content, which fits into a single device screen).
|
|
69
|
+
* @param predicateString - The `NSPredicate` locator of the child element, to which the scrolling should be performed. Has no effect if `elementId` is not a container.
|
|
70
|
+
* @param toVisible - If `true`, scrolls to the first visible `elementId` in the parent container. Has no effect if `elementId` is unset.
|
|
71
|
+
* @param distance - A ratio of the screen height; `1.0` means a full-screen-worth of scrolling.
|
|
72
|
+
* @param elementId - Element ID or Element used in various strategies.
|
|
73
|
+
* @throws {errors.InvalidArgumentError} If no valid strategy is provided or if direction is invalid
|
|
71
74
|
* @example
|
|
72
75
|
* ```python
|
|
73
76
|
* driver.execute_script('mobile: scroll', {'direction': 'down'})
|
|
74
77
|
* ```
|
|
75
78
|
*/
|
|
76
|
-
export function mobileScroll(this:
|
|
79
|
+
export declare function mobileScroll(this: XCUITestDriver, name?: string, direction?: Direction, predicateString?: string, toVisible?: boolean, distance?: number, elementId?: Element | string): Promise<void>;
|
|
77
80
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* @param
|
|
81
|
-
* @
|
|
81
|
+
* Performs a swipe gesture in the specified direction.
|
|
82
|
+
*
|
|
83
|
+
* @param direction - Direction to swipe ('up', 'down', 'left', or 'right')
|
|
84
|
+
* @param velocity - Optional velocity of the swipe
|
|
85
|
+
* @param elementId - Optional element to swipe on. If not provided, swipes on the application element
|
|
86
|
+
* @throws {errors.InvalidArgumentError} If direction is invalid
|
|
82
87
|
*/
|
|
83
|
-
export function mobileSwipe(this:
|
|
88
|
+
export declare function mobileSwipe(this: XCUITestDriver, direction: Direction, velocity?: number, elementId?: Element | string): Promise<void>;
|
|
84
89
|
/**
|
|
85
90
|
* Performs a pinch gesture on the given element or on the Application element.
|
|
86
91
|
*
|
|
87
|
-
* @param
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @returns {Promise<void>}
|
|
91
|
-
* @this {XCUITestDriver}
|
|
92
|
+
* @param scale - Pinch scale (float value). A value between `0` and `1` performs a "pinch close" (or "zoom out"); a value greater than `1` performs a "pinch open" ("zoom in").
|
|
93
|
+
* @param velocity - The velocity of the pinch in scale factor per second (float value).
|
|
94
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to pinch on. The Application element will be used if this parameter is not provided.
|
|
92
95
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618669-pinchwithscale?language=objc
|
|
93
96
|
* @example
|
|
94
97
|
*
|
|
@@ -96,28 +99,24 @@ export function mobileSwipe(this: import("../driver").XCUITestDriver, direction:
|
|
|
96
99
|
* execute_script 'mobile: pinch', scale: 0.5, velocity: 1.1, element: element.ref
|
|
97
100
|
* ```
|
|
98
101
|
*/
|
|
99
|
-
export function mobilePinch(this:
|
|
102
|
+
export declare function mobilePinch(this: XCUITestDriver, scale: number, velocity: number, elementId?: Element | string): Promise<void>;
|
|
100
103
|
/**
|
|
101
104
|
* Performs double tap gesture on the given element or on the screen.
|
|
102
105
|
*
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
105
|
-
* @param
|
|
106
|
-
* @returns {Promise<void>}
|
|
107
|
-
* @this {XCUITestDriver}
|
|
106
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to double tap on. The Application element will be used if this parameter is not provided.
|
|
107
|
+
* @param x - The _x_ coordinate (float value) to double tap on.
|
|
108
|
+
* @param y - The _y_ coordinate (float value) to double tap on.
|
|
108
109
|
* @example
|
|
109
110
|
* ```javascript
|
|
110
111
|
* // using WebdriverIO
|
|
111
112
|
* await driver.execute('mobile: doubleTap', {element: element.value.ELEMENT});
|
|
112
113
|
* ```
|
|
113
114
|
*/
|
|
114
|
-
export function mobileDoubleTap(this:
|
|
115
|
+
export declare function mobileDoubleTap(this: XCUITestDriver, elementId?: Element | string, x?: number, y?: number): Promise<void>;
|
|
115
116
|
/**
|
|
116
117
|
* Performs two finger tap gesture on the given element or on the application element.
|
|
117
118
|
*
|
|
118
|
-
* @param
|
|
119
|
-
* @returns {Promise<void>}
|
|
120
|
-
* @this {XCUITestDriver}
|
|
119
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to double tap on. The Application element will be used if this parameter is not provided.
|
|
121
120
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618675-twofingertap?language=objc
|
|
122
121
|
* @example
|
|
123
122
|
* ```csharp
|
|
@@ -126,15 +125,14 @@ export function mobileDoubleTap(this: import("../driver").XCUITestDriver, elemen
|
|
|
126
125
|
* ((IJavaScriptExecutor)driver).ExecuteScript("mobile: twoFingerTap", tfTap);
|
|
127
126
|
* ```
|
|
128
127
|
*/
|
|
129
|
-
export function mobileTwoFingerTap(this:
|
|
128
|
+
export declare function mobileTwoFingerTap(this: XCUITestDriver, elementId?: Element | string): Promise<void>;
|
|
130
129
|
/**
|
|
131
130
|
* Performs a "long press" gesture on the given element or on the screen.
|
|
132
131
|
*
|
|
133
|
-
* @param
|
|
134
|
-
* @param
|
|
135
|
-
* @param
|
|
136
|
-
* @param
|
|
137
|
-
* @this {XCUITestDriver}
|
|
132
|
+
* @param duration - The duration (in seconds) of the gesture.
|
|
133
|
+
* @param x - The _x_ coordinate (float value) to hold on.
|
|
134
|
+
* @param y - The _y_ coordinate (float value) to hold on.
|
|
135
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to hold on. The Application element will be used if this parameter is not provided.
|
|
138
136
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618663-pressforduration?language=objc
|
|
139
137
|
* @example
|
|
140
138
|
* ```csharp
|
|
@@ -144,29 +142,25 @@ export function mobileTwoFingerTap(this: import("../driver").XCUITestDriver, ele
|
|
|
144
142
|
* ((IJavaScriptExecutor)driver).ExecuteScript("mobile: touchAndHold", tfLongTap);
|
|
145
143
|
* ```
|
|
146
144
|
*/
|
|
147
|
-
export function mobileTouchAndHold(this:
|
|
145
|
+
export declare function mobileTouchAndHold(this: XCUITestDriver, duration: number, x?: number, y?: number, elementId?: Element | string): Promise<void>;
|
|
148
146
|
/**
|
|
149
147
|
* Performs tap gesture by coordinates on the given element or on the screen.
|
|
150
148
|
*
|
|
151
|
-
* @param
|
|
152
|
-
* @param
|
|
153
|
-
* @param
|
|
154
|
-
* @this {XCUITestDriver}
|
|
155
|
-
* @returns {Promise<void>}
|
|
149
|
+
* @param x - The _x_ coordinate (float value) to tap on. If `elementId` is provided, this is computed relative to the element; otherwise it is computed relative to the active Application element.
|
|
150
|
+
* @param y - The _y_ coordinate (float value) to tap on. If `elementId` is provided, this is computed relative to the element; otherwise it is computed relative to the active Application element.
|
|
151
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to tap on. The Application element will be used if this parameter is not provided.
|
|
156
152
|
*/
|
|
157
|
-
export function mobileTap(this:
|
|
153
|
+
export declare function mobileTap(this: XCUITestDriver, x: number, y: number, elementId?: string | Element): Promise<void>;
|
|
158
154
|
/**
|
|
159
155
|
* Performs drag and drop gesture by coordinates on the given element or on the screen.
|
|
160
156
|
*
|
|
161
|
-
* @param
|
|
162
|
-
* @param
|
|
163
|
-
* @param
|
|
164
|
-
* @param
|
|
165
|
-
* @param
|
|
166
|
-
* @param
|
|
167
|
-
* @returns {Promise<void>}
|
|
157
|
+
* @param duration - The duration (in seconds) of the gesture. Must be between `0.5` and `60.0`, inclusive.
|
|
158
|
+
* @param fromX - The _x_ coordinate (float value) of the starting drag point.
|
|
159
|
+
* @param fromY - The _y_ coordinate (float value) of the starting drag point.
|
|
160
|
+
* @param toX - The _x_ coordinate (float value) of the ending drag point.
|
|
161
|
+
* @param toY - The _y_ coordinate (float value) of the ending drag point.
|
|
162
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to drag. If provided, all coordinates will be calculated relative to this element; otherwise they will be calculated relative to the active Application element.
|
|
168
163
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1500989-clickforduration?language=objc
|
|
169
|
-
* @this {XCUITestDriver}
|
|
170
164
|
* @example
|
|
171
165
|
* ```java
|
|
172
166
|
* JavascriptExecutor js = (JavascriptExecutor) driver;
|
|
@@ -180,35 +174,31 @@ export function mobileTap(this: import("../driver").XCUITestDriver, x: number, y
|
|
|
180
174
|
* js.executeScript("mobile: dragFromToForDuration", params);
|
|
181
175
|
* ```
|
|
182
176
|
*/
|
|
183
|
-
export function mobileDragFromToForDuration(this:
|
|
177
|
+
export declare function mobileDragFromToForDuration(this: XCUITestDriver, duration: number, fromX: number, fromY: number, toX: number, toY: number, elementId?: string | Element): Promise<void>;
|
|
184
178
|
/**
|
|
185
179
|
* Initiates a press-and-hold gesture, drags to another coordinate or an element with a given velocity, and holds for a given duration.
|
|
186
180
|
*
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
189
|
-
* @param
|
|
190
|
-
* @param
|
|
191
|
-
* @param
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
194
|
-
* @param
|
|
195
|
-
* @param
|
|
196
|
-
* @
|
|
181
|
+
* @param pressDuration - The duration (in seconds) of the press-and-hold gesture at the starting point. Must be between `0.5` and `60.0`, inclusive.
|
|
182
|
+
* @param holdDuration - The duration (in seconds) of the hold gesture at the ending point (after dragging). Must be between `0.5` and `60.0`, inclusive.
|
|
183
|
+
* @param velocity - The speed (in pixels-per-second) which to move from the initial position to the end position.
|
|
184
|
+
* @param fromElementId - The internal element identifier (as hexadecimal hash string) to drag from. Absolute screen coordinates are expected if this argument is not provided.
|
|
185
|
+
* @param toElementId - The internal element identifier (as hexadecimal hash string) to drag to. Absolute screen coordinates are expected if this argument is not provided.
|
|
186
|
+
* @param fromX - The _x_ coordinate (float value) of the starting drag point.
|
|
187
|
+
* @param fromY - The _y_ coordinate (float value) of the starting drag point.
|
|
188
|
+
* @param toX - The _x_ coordinate (float value) of the ending drag point.
|
|
189
|
+
* @param toY - The _y_ coordinate (float value) of the ending drag point.
|
|
190
|
+
* @throws {errors.InvalidArgumentError} If toElementId is missing when fromElementId is provided, or if coordinates are missing when fromElementId is not provided
|
|
197
191
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/3551693-pressforduration?language=objc
|
|
198
192
|
* @see https://developer.apple.com/documentation/xctest/xcuicoordinate/3551692-pressforduration?language=objc
|
|
199
|
-
* @this {XCUITestDriver}
|
|
200
193
|
*/
|
|
201
|
-
export function mobileDragFromToWithVelocity(this:
|
|
194
|
+
export declare function mobileDragFromToWithVelocity(this: XCUITestDriver, pressDuration: number, holdDuration: number, velocity: number, fromElementId?: Element | string, toElementId?: Element | string, fromX?: number, fromY?: number, toX?: number, toY?: number): Promise<void>;
|
|
202
195
|
/**
|
|
203
196
|
* Sends one or more taps with one or more touch points.
|
|
204
197
|
*
|
|
205
198
|
* @since 1.17.1
|
|
206
|
-
* @param
|
|
207
|
-
* @param
|
|
208
|
-
* @param
|
|
209
|
-
* The Application element will be used if this parameter is not provided.
|
|
210
|
-
* @returns {Promise<void>}
|
|
211
|
-
* @this {XCUITestDriver}
|
|
199
|
+
* @param numberOfTaps - Number of taps to perform.
|
|
200
|
+
* @param numberOfTouches - Number of touch points to use.
|
|
201
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to perform one or more taps. The Application element will be used if this parameter is not provided.
|
|
212
202
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618671-tapwithnumberoftaps?language=objc
|
|
213
203
|
* @example
|
|
214
204
|
* ```ruby
|
|
@@ -217,33 +207,31 @@ export function mobileDragFromToWithVelocity(this: import("../driver").XCUITestD
|
|
|
217
207
|
* @driver.execute_script 'mobile: tapWithNumberOfTaps', {element: e.ref, numberOfTaps: 2, numberOfTouches: 1}
|
|
218
208
|
* ```
|
|
219
209
|
*/
|
|
220
|
-
export function mobileTapWithNumberOfTaps(this:
|
|
210
|
+
export declare function mobileTapWithNumberOfTaps(this: XCUITestDriver, numberOfTouches?: number, numberOfTaps?: number, elementId?: Element | string | undefined): Promise<void>;
|
|
221
211
|
/**
|
|
222
212
|
* Performs a "force press" on the given element or coordinates.
|
|
223
213
|
*
|
|
224
214
|
* @throws If the target device does not support the "force press" gesture.
|
|
225
|
-
* @param
|
|
226
|
-
* @param
|
|
227
|
-
* @param
|
|
228
|
-
* @param
|
|
229
|
-
* @param
|
|
230
|
-
*
|
|
231
|
-
* @returns {Promise<void>}
|
|
232
|
-
* @this {XCUITestDriver}
|
|
215
|
+
* @param x - The _x_ coordinate of the gesture. If `elementId` is set, this is calculated relative to its position; otherwise it's calculated relative to the active Application.
|
|
216
|
+
* @param y - The _y_ coordinate of the gesture. If `elementId` is set, this is calculated relative to its position; otherwise it's calculated relative to the active Application.
|
|
217
|
+
* @param duration - The duration (in seconds) of the force press. If this is provided, `pressure` must also be provided.
|
|
218
|
+
* @param pressure - A float value defining the pressure of the force press. If this is provided, `duration` must also be provided.
|
|
219
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to perform one or more taps. The Application element will be used if this parameter is not provided.
|
|
220
|
+
* @throws {Error} If the target device does not support the "force press" gesture
|
|
233
221
|
*/
|
|
234
|
-
export function mobileForcePress(this:
|
|
222
|
+
export declare function mobileForcePress(this: XCUITestDriver, x?: number, y?: number, duration?: number, pressure?: number, elementId?: Element | string): Promise<void>;
|
|
235
223
|
/**
|
|
236
224
|
* Performs selection of the next or previous picker wheel value.
|
|
237
225
|
*
|
|
238
226
|
* This might be useful if these values are populated dynamically; you don't know which one to select, or the value selection using the `sendKeys` API does not work (for whatever reason).
|
|
239
227
|
*
|
|
240
228
|
* @throws Upon failure to change the current picker value.
|
|
241
|
-
* @param
|
|
242
|
-
* @param
|
|
243
|
-
* @param
|
|
244
|
-
* @param
|
|
245
|
-
* @param
|
|
246
|
-
* @
|
|
229
|
+
* @param elementId - `PickerWheel`'s internal element ID as hexadecimal hash string. Value selection will be performed on this element. This element must be of type `XCUIElementTypePickerWheel`.
|
|
230
|
+
* @param order - Either `next` to select the value _next_ to the current from the target picker wheel, or `previous` to select the _previous_ value.
|
|
231
|
+
* @param offset - The value in range `[0.01, 0.5]`. It defines how far from picker wheel's center the click should happen. The actual distance is calculated by multiplying this value to the actual picker wheel height. Too small an offset value may not change the picker wheel value at all, and too high a value may cause the wheel to switch two or more values at once. Usually the optimal value is located in range `[0.15, 0.3]`.
|
|
232
|
+
* @param value - If provided WDA will try to automatically scroll in the given direction until the actual picker value reaches the expected one or the amount of scrolling attempts is exceeded.
|
|
233
|
+
* @param maxAttempts - The maximum number of scrolling attempts to reach `value` before an error will be thrown. Only makes sense in combination with `value`.
|
|
234
|
+
* @throws {errors.InvalidArgumentError} If elementId is not provided or if order is invalid
|
|
247
235
|
* @example
|
|
248
236
|
* ```java
|
|
249
237
|
* JavascriptExecutor js = (JavascriptExecutor) driver;
|
|
@@ -254,17 +242,15 @@ export function mobileForcePress(this: import("../driver").XCUITestDriver, x?: n
|
|
|
254
242
|
* js.executeScript("mobile: selectPickerWheelValue", params);
|
|
255
243
|
* ```
|
|
256
244
|
*/
|
|
257
|
-
export function mobileSelectPickerWheelValue(this:
|
|
245
|
+
export declare function mobileSelectPickerWheelValue(this: XCUITestDriver, elementId: Element | string, order: string, offset?: number, value?: string, maxAttempts?: number): Promise<void>;
|
|
258
246
|
/**
|
|
259
247
|
* Performs a rotate gesture on the given element.
|
|
260
248
|
*
|
|
261
249
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618665-rotate?language=objc
|
|
262
|
-
* @param
|
|
263
|
-
* @param
|
|
264
|
-
* @param
|
|
250
|
+
* @param rotation - The rotation gesture (in radians)
|
|
251
|
+
* @param velocity - The velocity (in radians-per-second) of the gesture.
|
|
252
|
+
* @param elementId - The internal element identifier (as hexadecimal hash string) to perform the gesture on.
|
|
265
253
|
* The Application element will be used if this parameter is not provided.
|
|
266
|
-
* @returns {Promise<void>}
|
|
267
|
-
* @this {XCUITestDriver}
|
|
268
254
|
* @example
|
|
269
255
|
* ```java
|
|
270
256
|
* JavascriptExecutor js = (JavascriptExecutor) driver;
|
|
@@ -277,7 +263,5 @@ export function mobileSelectPickerWheelValue(this: import("../driver").XCUITestD
|
|
|
277
263
|
* ));
|
|
278
264
|
* ```
|
|
279
265
|
*/
|
|
280
|
-
export function mobileRotateElement(this:
|
|
281
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
282
|
-
export type Element = import("@appium/types").Element;
|
|
266
|
+
export declare function mobileRotateElement(this: XCUITestDriver, rotation: number, velocity: number, elementId?: Element | string): Promise<void>;
|
|
283
267
|
//# sourceMappingURL=gesture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesture.d.ts","sourceRoot":"","sources":["../../../lib/commands/gesture.
|
|
1
|
+
{"version":3,"file":"gesture.d.ts","sourceRoot":"","sources":["../../../lib/commands/gesture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,cAAc,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAIvC;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE;AAED;;;;;GAKG;AACH,wBAAsB,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