appium-xcuitest-driver 10.13.3 → 10.13.4

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [10.13.4](https://github.com/appium/appium-xcuitest-driver/compare/v10.13.3...v10.13.4) (2025-12-30)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * Migrate various command modules to typescript (part 4) ([#2689](https://github.com/appium/appium-xcuitest-driver/issues/2689)) ([e7da99b](https://github.com/appium/appium-xcuitest-driver/commit/e7da99b79461927b785ec518475ee604c163fdc9))
6
+
1
7
  ## [10.13.3](https://github.com/appium/appium-xcuitest-driver/compare/v10.13.2...v10.13.3) (2025-12-28)
2
8
 
3
9
  ### Miscellaneous Chores
@@ -1,102 +1,121 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { Viewport, ScreenInfo, ButtonName } from './types';
3
+ import type { Size, Rect } from '@appium/types';
1
4
  /**
2
- * @this {XCUITestDriver}
5
+ * Gets the currently active element.
6
+ *
7
+ * In web context, returns the active element from the DOM.
8
+ * In native context, returns the active element from the current view.
9
+ *
10
+ * @returns The active element
3
11
  */
4
- export function active(this: import("../driver").XCUITestDriver): Promise<any>;
12
+ export declare function active(this: XCUITestDriver): Promise<any>;
5
13
  /**
6
- * Trigger a touch/fingerprint match or match failure
14
+ * Trigger a touch/fingerprint match or match failure.
7
15
  *
8
- * @param {boolean} match - whether the match should be a success or failure
9
- * @this {XCUITestDriver}
16
+ * @param match - Whether the match should be a success or failure
10
17
  */
11
- export function touchId(this: import("../driver").XCUITestDriver, match?: boolean): Promise<void>;
18
+ export declare function touchId(this: XCUITestDriver, match?: boolean): Promise<void>;
12
19
  /**
13
- * Toggle whether the device is enrolled in the touch ID program
14
- *
15
- * @param {boolean} isEnabled - whether to enable or disable the touch ID program
20
+ * Toggle whether the device is enrolled in the touch ID program.
16
21
  *
17
- * @this {XCUITestDriver}
22
+ * @param isEnabled - Whether to enable or disable the touch ID program
18
23
  */
19
- export function toggleEnrollTouchId(this: import("../driver").XCUITestDriver, isEnabled?: boolean): Promise<void>;
24
+ export declare function toggleEnrollTouchId(this: XCUITestDriver, isEnabled?: boolean): Promise<void>;
20
25
  /**
21
- * Get the window size
22
- * @this {XCUITestDriver}
23
- * @returns {Promise<import('@appium/types').Size>}
26
+ * Get the window size.
27
+ *
28
+ * @returns The window size (width and height)
24
29
  */
25
- export function getWindowSize(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Size>;
30
+ export declare function getWindowSize(this: XCUITestDriver): Promise<Size>;
26
31
  /**
27
32
  * Retrieves the actual device time.
28
33
  *
29
- * @param {string} format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
30
- * @returns {Promise<string>} Formatted datetime string or the raw command output (if formatting fails)
31
- * @this {XCUITestDriver}
34
+ * @param format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
35
+ * @returns Formatted datetime string or the raw command output (if formatting fails)
32
36
  */
33
- export function getDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
37
+ export declare function getDeviceTime(this: XCUITestDriver, format?: string): Promise<string>;
34
38
  /**
35
- * Retrieves the current device time
39
+ * Retrieves the current device time.
40
+ *
41
+ * This is a wrapper around {@linkcode getDeviceTime}.
36
42
  *
37
- * @param {string} format - See {@linkcode getDeviceTime.format}
38
- * @returns {Promise<string>} Formatted datetime string or the raw command output if formatting fails
39
- * @this {XCUITestDriver}
43
+ * @param format - See {@linkcode getDeviceTime.format}
44
+ * @returns Formatted datetime string or the raw command output if formatting fails
40
45
  */
41
- export function mobileGetDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
46
+ export declare function mobileGetDeviceTime(this: XCUITestDriver, format?: string): Promise<string>;
42
47
  /**
43
- * For W3C
44
- * @this {XCUITestDriver}
45
- * @return {Promise<import('@appium/types').Rect>}
48
+ * Gets the window rectangle (position and size).
49
+ *
50
+ * For W3C compatibility. In web context, returns the browser window dimensions.
51
+ * In native context, returns the device window dimensions.
52
+ *
53
+ * @returns The window rectangle
46
54
  */
47
- export function getWindowRect(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Rect>;
55
+ export declare function getWindowRect(this: XCUITestDriver): Promise<Rect>;
48
56
  /**
49
- * @this {XCUITestDriver}
57
+ * Removes/uninstalls the given application from the device under test.
58
+ *
59
+ * This is a wrapper around {@linkcode mobileRemoveApp mobile: removeApp}.
60
+ *
61
+ * @param bundleId - The bundle identifier of the application to be removed
62
+ * @returns `true` if the application has been removed successfully; `false` otherwise
50
63
  */
51
- export function removeApp(this: import("../driver").XCUITestDriver, bundleId: any): Promise<boolean>;
64
+ export declare function removeApp(this: XCUITestDriver, bundleId: string): Promise<boolean>;
52
65
  /**
53
- * @this {XCUITestDriver}
66
+ * Launches the app.
67
+ *
68
+ * @deprecated This API has been deprecated and is not supported anymore.
69
+ * Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
70
+ * @throws {Error} Always throws an error indicating the API is deprecated
54
71
  */
55
- export function launchApp(this: import("../driver").XCUITestDriver): Promise<void>;
72
+ export declare function launchApp(this: XCUITestDriver): Promise<void>;
56
73
  /**
57
- * @this {XCUITestDriver}
74
+ * Closes the app.
75
+ *
76
+ * @deprecated This API has been deprecated and is not supported anymore.
77
+ * Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
78
+ * @throws {Error} Always throws an error indicating the API is deprecated
58
79
  */
59
- export function closeApp(this: import("../driver").XCUITestDriver): Promise<void>;
80
+ export declare function closeApp(this: XCUITestDriver): Promise<void>;
60
81
  /**
61
- * @this {XCUITestDriver}
62
- * @param {string} url
63
- * @returns {Promise<void>}
82
+ * Sets the URL for the current session.
83
+ *
84
+ * In web context, navigates to the URL using the remote debugger.
85
+ * In native context on real devices, uses the proxy command.
86
+ * In native context on simulators, uses simctl to open the URL.
87
+ *
88
+ * @param url - The URL to navigate to
64
89
  */
65
- export function setUrl(this: import("../driver").XCUITestDriver, url: string): Promise<void>;
66
- export class setUrl {
67
- /**
68
- * @this {XCUITestDriver}
69
- * @param {string} url
70
- * @returns {Promise<void>}
71
- */
72
- constructor(this: import("../driver").XCUITestDriver, url: string);
73
- curWebFrames: any[] | undefined;
74
- }
90
+ export declare function setUrl(this: XCUITestDriver, url: string): Promise<void>;
75
91
  /**
76
92
  * Retrieves the viewport dimensions.
77
93
  *
78
94
  * The viewport is the device's screen size with status bar size subtracted if the latter is present/visible.
79
- * @returns {Promise<import('./types').Viewport>}
80
- * @this {XCUITestDriver}
95
+ *
96
+ * @returns The viewport rectangle
81
97
  */
82
- export function getViewportRect(this: import("../driver").XCUITestDriver): Promise<import("./types").Viewport>;
98
+ export declare function getViewportRect(this: XCUITestDriver): Promise<Viewport>;
83
99
  /**
84
100
  * Get information about the screen.
85
101
  *
86
102
  * @privateRemarks memoized in constructor
87
- * @this {XCUITestDriver}
88
- * @returns {Promise<ScreenInfo>}
103
+ * @returns Screen information including dimensions, scale, and status bar size
89
104
  */
90
- export function getScreenInfo(this: import("../driver").XCUITestDriver): Promise<ScreenInfo>;
105
+ export declare function getScreenInfo(this: XCUITestDriver): Promise<ScreenInfo>;
91
106
  /**
92
- * @this {XCUITestDriver}
107
+ * Gets the status bar height.
108
+ *
109
+ * @returns The height of the status bar in logical pixels
93
110
  */
94
- export function getStatusBarHeight(this: import("../driver").XCUITestDriver): Promise<number>;
111
+ export declare function getStatusBarHeight(this: XCUITestDriver): Promise<number>;
95
112
  /**
96
- * memoized in constructor
97
- * @this {XCUITestDriver}
113
+ * Gets the device pixel ratio.
114
+ *
115
+ * @privateRemarks memoized in constructor
116
+ * @returns The device pixel ratio (scale factor)
98
117
  */
99
- export function getDevicePixelRatio(this: import("../driver").XCUITestDriver): Promise<number>;
118
+ export declare function getDevicePixelRatio(this: XCUITestDriver): Promise<number>;
100
119
  /**
101
120
  * Emulates press action on the given physical device button.
102
121
  *
@@ -107,31 +126,16 @@ export function getDevicePixelRatio(this: import("../driver").XCUITestDriver): P
107
126
  *
108
127
  * Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
109
128
  *
110
- * @param {import('./types').ButtonName} name - The name of the button to be pressed.
111
- * @param {number} [durationSeconds] - The duration of the button press in seconds (float).
112
- * @this {XCUITestDriver}
129
+ * @param name - The name of the button to be pressed
130
+ * @param durationSeconds - The duration of the button press in seconds (float)
113
131
  */
114
- export function mobilePressButton(this: import("../driver").XCUITestDriver, name: import("./types").ButtonName, durationSeconds?: number): Promise<unknown>;
132
+ export declare function mobilePressButton(this: XCUITestDriver, name: ButtonName, durationSeconds?: number): Promise<void>;
115
133
  /**
116
134
  * Process a string as speech and send it to Siri.
117
135
  *
118
136
  * Presents the Siri UI, if it is not currently active, and accepts a string which is then processed as if it were recognized speech. See [the documentation of `activateWithVoiceRecognitionText`](https://developer.apple.com/documentation/xctest/xcuisiriservice/2852140-activatewithvoicerecognitiontext?language=objc) for more details.
119
-
120
- * @param {string} text - Text to be sent to Siri
121
- * @returns {Promise<void>}
122
- * @this {XCUITestDriver}
123
- */
124
- export function mobileSiriCommand(this: import("../driver").XCUITestDriver, text: string): Promise<void>;
125
- export type PressButtonOptions = {
126
- /**
127
- * - The name of the button to be pressed.
128
- */
129
- name: string;
130
- /**
131
- * - Duration in float seconds.
132
- */
133
- durationSeconds?: number | undefined;
134
- };
135
- export type XCUITestDriver = import("../driver").XCUITestDriver;
136
- export type ScreenInfo = import("./types").ScreenInfo;
137
+ *
138
+ * @param text - Text to be sent to Siri
139
+ */
140
+ export declare function mobileSiriCommand(this: XCUITestDriver, text: string): Promise<void>;
137
141
  //# sourceMappingURL=general.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../lib/commands/general.js"],"names":[],"mapp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E,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7E;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAc7E;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9E;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG/E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,UAAU,EAChB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzF"}
@@ -27,7 +27,12 @@ const appium_ios_device_1 = require("appium-ios-device");
27
27
  const teen_process_1 = require("teen_process");
28
28
  const MOMENT_FORMAT_ISO8601 = 'YYYY-MM-DDTHH:mm:ssZ';
29
29
  /**
30
- * @this {XCUITestDriver}
30
+ * Gets the currently active element.
31
+ *
32
+ * In web context, returns the active element from the DOM.
33
+ * In native context, returns the active element from the current view.
34
+ *
35
+ * @returns The active element
31
36
  */
32
37
  async function active() {
33
38
  if (this.isWebContext()) {
@@ -36,28 +41,25 @@ async function active() {
36
41
  return await this.proxyCommand(`/element/active`, 'GET');
37
42
  }
38
43
  /**
39
- * Trigger a touch/fingerprint match or match failure
44
+ * Trigger a touch/fingerprint match or match failure.
40
45
  *
41
- * @param {boolean} match - whether the match should be a success or failure
42
- * @this {XCUITestDriver}
46
+ * @param match - Whether the match should be a success or failure
43
47
  */
44
48
  async function touchId(match = true) {
45
49
  await this.mobileSendBiometricMatch('touchId', match);
46
50
  }
47
51
  /**
48
- * Toggle whether the device is enrolled in the touch ID program
49
- *
50
- * @param {boolean} isEnabled - whether to enable or disable the touch ID program
52
+ * Toggle whether the device is enrolled in the touch ID program.
51
53
  *
52
- * @this {XCUITestDriver}
54
+ * @param isEnabled - Whether to enable or disable the touch ID program
53
55
  */
54
56
  async function toggleEnrollTouchId(isEnabled = true) {
55
57
  await this.mobileEnrollBiometric(isEnabled);
56
58
  }
57
59
  /**
58
- * Get the window size
59
- * @this {XCUITestDriver}
60
- * @returns {Promise<import('@appium/types').Size>}
60
+ * Get the window size.
61
+ *
62
+ * @returns The window size (width and height)
61
63
  */
62
64
  async function getWindowSize() {
63
65
  const { width, height } = await this.getWindowRect();
@@ -66,9 +68,8 @@ async function getWindowSize() {
66
68
  /**
67
69
  * Retrieves the actual device time.
68
70
  *
69
- * @param {string} format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
70
- * @returns {Promise<string>} Formatted datetime string or the raw command output (if formatting fails)
71
- * @this {XCUITestDriver}
71
+ * @param format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
72
+ * @returns Formatted datetime string or the raw command output (if formatting fails)
72
73
  */
73
74
  async function getDeviceTime(format = MOMENT_FORMAT_ISO8601) {
74
75
  this.log.info('Attempting to capture iOS device date and time');
@@ -107,19 +108,23 @@ async function getDeviceTime(format = MOMENT_FORMAT_ISO8601) {
107
108
  return utc.format(format);
108
109
  }
109
110
  /**
110
- * Retrieves the current device time
111
+ * Retrieves the current device time.
112
+ *
113
+ * This is a wrapper around {@linkcode getDeviceTime}.
111
114
  *
112
- * @param {string} format - See {@linkcode getDeviceTime.format}
113
- * @returns {Promise<string>} Formatted datetime string or the raw command output if formatting fails
114
- * @this {XCUITestDriver}
115
+ * @param format - See {@linkcode getDeviceTime.format}
116
+ * @returns Formatted datetime string or the raw command output if formatting fails
115
117
  */
116
118
  async function mobileGetDeviceTime(format = MOMENT_FORMAT_ISO8601) {
117
119
  return await this.getDeviceTime(format);
118
120
  }
119
121
  /**
120
- * For W3C
121
- * @this {XCUITestDriver}
122
- * @return {Promise<import('@appium/types').Rect>}
122
+ * Gets the window rectangle (position and size).
123
+ *
124
+ * For W3C compatibility. In web context, returns the browser window dimensions.
125
+ * In native context, returns the device window dimensions.
126
+ *
127
+ * @returns The window rectangle
123
128
  */
124
129
  async function getWindowRect() {
125
130
  if (this.isWebContext()) {
@@ -131,32 +136,49 @@ async function getWindowRect() {
131
136
  '}';
132
137
  return await this.executeAtom('execute_script', [script]);
133
138
  }
134
- return /** @type {import('@appium/types').Rect} */ (await this.proxyCommand('/window/rect', 'GET'));
139
+ return (await this.proxyCommand('/window/rect', 'GET'));
135
140
  }
136
141
  /**
137
- * @this {XCUITestDriver}
142
+ * Removes/uninstalls the given application from the device under test.
143
+ *
144
+ * This is a wrapper around {@linkcode mobileRemoveApp mobile: removeApp}.
145
+ *
146
+ * @param bundleId - The bundle identifier of the application to be removed
147
+ * @returns `true` if the application has been removed successfully; `false` otherwise
138
148
  */
139
149
  async function removeApp(bundleId) {
140
150
  return await this.mobileRemoveApp(bundleId);
141
151
  }
142
152
  /**
143
- * @this {XCUITestDriver}
153
+ * Launches the app.
154
+ *
155
+ * @deprecated This API has been deprecated and is not supported anymore.
156
+ * Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
157
+ * @throws {Error} Always throws an error indicating the API is deprecated
144
158
  */
145
159
  async function launchApp() {
146
160
  throw new Error(`The launchApp API has been deprecated and is not supported anymore. ` +
147
161
  `Consider using corresponding 'mobile:' extensions to manage the state of the app under test.`);
148
162
  }
149
163
  /**
150
- * @this {XCUITestDriver}
164
+ * Closes the app.
165
+ *
166
+ * @deprecated This API has been deprecated and is not supported anymore.
167
+ * Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
168
+ * @throws {Error} Always throws an error indicating the API is deprecated
151
169
  */
152
170
  async function closeApp() {
153
171
  throw new Error(`The closeApp API has been deprecated and is not supported anymore. ` +
154
172
  `Consider using corresponding 'mobile:' extensions to manage the state of the app under test.`);
155
173
  }
156
174
  /**
157
- * @this {XCUITestDriver}
158
- * @param {string} url
159
- * @returns {Promise<void>}
175
+ * Sets the URL for the current session.
176
+ *
177
+ * In web context, navigates to the URL using the remote debugger.
178
+ * In native context on real devices, uses the proxy command.
179
+ * In native context on simulators, uses simctl to open the URL.
180
+ *
181
+ * @param url - The URL to navigate to
160
182
  */
161
183
  async function setUrl(url) {
162
184
  this.log.debug(`Attempting to set url '${url}'`);
@@ -171,15 +193,15 @@ async function setUrl(url) {
171
193
  await this.proxyCommand('/url', 'POST', { url });
172
194
  }
173
195
  else {
174
- await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.openUrl(url);
196
+ await this.device.simctl.openUrl(url);
175
197
  }
176
198
  }
177
199
  /**
178
200
  * Retrieves the viewport dimensions.
179
201
  *
180
202
  * The viewport is the device's screen size with status bar size subtracted if the latter is present/visible.
181
- * @returns {Promise<import('./types').Viewport>}
182
- * @this {XCUITestDriver}
203
+ *
204
+ * @returns The viewport rectangle
183
205
  */
184
206
  async function getViewportRect() {
185
207
  const scale = await this.getDevicePixelRatio();
@@ -199,22 +221,25 @@ async function getViewportRect() {
199
221
  * Get information about the screen.
200
222
  *
201
223
  * @privateRemarks memoized in constructor
202
- * @this {XCUITestDriver}
203
- * @returns {Promise<ScreenInfo>}
224
+ * @returns Screen information including dimensions, scale, and status bar size
204
225
  */
205
226
  async function getScreenInfo() {
206
- return /** @type {ScreenInfo} */ (await this.proxyCommand('/wda/screen', 'GET'));
227
+ return (await this.proxyCommand('/wda/screen', 'GET'));
207
228
  }
208
229
  /**
209
- * @this {XCUITestDriver}
230
+ * Gets the status bar height.
231
+ *
232
+ * @returns The height of the status bar in logical pixels
210
233
  */
211
234
  async function getStatusBarHeight() {
212
235
  const { statusBarSize } = await this.getScreenInfo();
213
236
  return statusBarSize.height;
214
237
  }
215
238
  /**
216
- * memoized in constructor
217
- * @this {XCUITestDriver}
239
+ * Gets the device pixel ratio.
240
+ *
241
+ * @privateRemarks memoized in constructor
242
+ * @returns The device pixel ratio (scale factor)
218
243
  */
219
244
  async function getDevicePixelRatio() {
220
245
  const { scale } = await this.getScreenInfo();
@@ -230,9 +255,8 @@ async function getDevicePixelRatio() {
230
255
  *
231
256
  * Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
232
257
  *
233
- * @param {import('./types').ButtonName} name - The name of the button to be pressed.
234
- * @param {number} [durationSeconds] - The duration of the button press in seconds (float).
235
- * @this {XCUITestDriver}
258
+ * @param name - The name of the button to be pressed
259
+ * @param durationSeconds - The duration of the button press in seconds (float)
236
260
  */
237
261
  async function mobilePressButton(name, durationSeconds) {
238
262
  if (!name) {
@@ -247,10 +271,8 @@ async function mobilePressButton(name, durationSeconds) {
247
271
  * Process a string as speech and send it to Siri.
248
272
  *
249
273
  * Presents the Siri UI, if it is not currently active, and accepts a string which is then processed as if it were recognized speech. See [the documentation of `activateWithVoiceRecognitionText`](https://developer.apple.com/documentation/xctest/xcuisiriservice/2852140-activatewithvoicerecognitiontext?language=objc) for more details.
250
-
251
- * @param {string} text - Text to be sent to Siri
252
- * @returns {Promise<void>}
253
- * @this {XCUITestDriver}
274
+ *
275
+ * @param text - Text to be sent to Siri
254
276
  */
255
277
  async function mobileSiriCommand(text) {
256
278
  if (!text) {
@@ -258,13 +280,4 @@ async function mobileSiriCommand(text) {
258
280
  }
259
281
  await this.proxyCommand('/wda/siri/activate', 'POST', { text });
260
282
  }
261
- /**
262
- * @typedef {Object} PressButtonOptions
263
- * @property {string} name - The name of the button to be pressed.
264
- * @property {number} [durationSeconds] - Duration in float seconds.
265
- */
266
- /**
267
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
268
- * @typedef {import('./types').ScreenInfo} ScreenInfo
269
- */
270
283
  //# sourceMappingURL=general.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"general.js","sourceRoot":"","sources":["../../../lib/commands/general.js"],"names":[],"mappings":";;;;;AAWA,wBAKC;AAQD,0BAEC;AAQD,kDAEC;AAOD,sCAGC;AASD,sCAsCC;AASD,kDAEC;AAOD,sCAcC;AAKD,8BAEC;AAKD,8BAKC;AAKD,4BAKC;AAOD,wBAgBC;AASD,0CAcC;AASD,sCAEC;AAKD,gDAGC;AAMD,kDAGC;AAgBD,8CAQC;AAWD,8CAKC;AA1QD,oDAAuB;AACvB,0CAAqC;AACrC,sEAAqC;AACrC,yDAA4C;AAC5C,+CAAkC;AAElC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD;;GAEG;AACI,KAAK,UAAU,MAAM;IAC1B,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,OAAO,CAAC,KAAK,GAAG,IAAI;IACxC,MAAM,IAAI,CAAC,wBAAwB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC;AACC;;;;;;GAMG;AACE,KAAK,UAAU,mBAAmB,CAAC,SAAS,GAAG,IAAI;IACxD,MAAM,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,aAAa;IACjC,MAAM,EAAC,KAAK,EAAE,MAAM,EAAC,GAAG,MAAM,IA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Ae,CAAC;AACvE,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,kBAAkB;IACtC,MAAM,EAAC,aAAa,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IACnD,OAAO,aAAa,CAAC,MAAM,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB;IACvC,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,iBAAiB,CAErC,IAAgB,EAChB,eAAwB;IAExB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,oCAAoC,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAC,CAAC,CAAC;AAChG,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,iBAAiB,CAAuB,IAAY;IACxE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;AAChE,CAAC"}
@@ -1,68 +1,66 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { LogEntry, LogListener } from './types';
3
+ import type { LogDefRecord } from '@appium/types';
4
+ import type { EventEmitter } from 'node:events';
5
+ type XCUITestDriverLogTypes = keyof typeof SUPPORTED_LOG_TYPES;
6
+ interface BiDiListenerProperties {
7
+ type: string;
8
+ srcEventName?: string;
9
+ context?: string;
10
+ entryTransformer?: (x: any) => LogEntry;
11
+ }
12
+ /**
13
+ * @privateRemarks The return types for these getters should be specified
14
+ */
15
+ declare const SUPPORTED_LOG_TYPES: LogDefRecord;
16
+ export declare const supportedLogTypes: LogDefRecord;
1
17
  /**
18
+ * Extracts logs of the specified type from the logs container.
2
19
  *
3
- * @param {XCUITestDriverLogTypes} logType
4
- * @param {Partial<Record<XCUITestDriverLogTypes,{getLogs(): Promise<any>}>>} [logsContainer]
5
- * @this {XCUITestDriver}
20
+ * @param logType - The type of log to extract
21
+ * @param logsContainer - Container holding log objects
22
+ * @returns The extracted logs
23
+ * @throws {Error} If logs are not available or the log type is not found
6
24
  */
7
- export function extractLogs(this: import("../driver").XCUITestDriver, logType: XCUITestDriverLogTypes, logsContainer?: Partial<Record<XCUITestDriverLogTypes, {
25
+ export declare function extractLogs(this: XCUITestDriver, logType: XCUITestDriverLogTypes, logsContainer?: Partial<Record<XCUITestDriverLogTypes, {
8
26
  getLogs(): Promise<any>;
9
27
  }>>): Promise<any>;
10
28
  /**
11
- * @this {XCUITestDriver}
29
+ * Starts capturing iOS system logs.
30
+ *
31
+ * Initializes and starts capturing syslog and crashlog. Optionally starts Safari console and network logs
32
+ * if the corresponding capabilities are enabled.
33
+ *
34
+ * @returns `true` if syslog capture started successfully; `false` otherwise
12
35
  */
13
- export function startLogCapture(this: import("../driver").XCUITestDriver): Promise<boolean>;
14
- export class startLogCapture {
15
- logs: import("../driver").DriverLogs;
16
- }
36
+ export declare function startLogCapture(this: XCUITestDriver): Promise<boolean>;
17
37
  /**
18
38
  * Starts an iOS system logs broadcast websocket.
19
39
  *
20
- * The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
40
+ * The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
21
41
  *
22
42
  * If the websocket is already running, this command does nothing.
23
43
  *
24
- * Each connected webcoket listener will receive syslog lines as soon as they are visible to Appium.
44
+ * Each connected websocket listener will receive syslog lines as soon as they are visible to Appium.
25
45
  * @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
26
- * @returns {Promise<void>}
27
- * @this {XCUITestDriver}
28
46
  */
29
- export function mobileStartLogsBroadcast(this: import("../driver").XCUITestDriver): Promise<void>;
30
- export class mobileStartLogsBroadcast {
31
- _syslogWebsocketListener: ((logRecord: {
32
- message: string;
33
- }) => void) | null;
34
- }
47
+ export declare function mobileStartLogsBroadcast(this: XCUITestDriver): Promise<void>;
35
48
  /**
36
- * Stops the syslog broadcasting wesocket server previously started by `mobile: startLogsBroadcast`.
49
+ * Stops the syslog broadcasting websocket server previously started by `mobile: startLogsBroadcast`.
50
+ *
37
51
  * If no websocket server is running, this command does nothing.
38
- * @this {XCUITestDriver}
39
- * @returns {Promise<void>}
40
52
  */
41
- export function mobileStopLogsBroadcast(this: import("../driver").XCUITestDriver): Promise<void>;
53
+ export declare function mobileStopLogsBroadcast(this: XCUITestDriver): Promise<void>;
42
54
  /**
55
+ * Assigns a BiDi log listener to the given log emitter.
56
+ *
43
57
  * https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
44
58
  *
45
- * @template {import('node:events').EventEmitter} EE
46
- * @this {XCUITestDriver}
47
- * @param {EE} logEmitter
48
- * @param {BiDiListenerProperties} properties
49
- * @returns {[EE, import('./types').LogListener]}
50
- */
51
- export function assignBiDiLogListener<EE extends import("node:events").EventEmitter>(this: import("../driver").XCUITestDriver, logEmitter: EE, properties: BiDiListenerProperties): [EE, import("./types").LogListener];
52
- export const supportedLogTypes: import("@appium/types").LogDefRecord;
53
- export type XCUITestDriver = import("../driver").XCUITestDriver;
54
- export type XCUITestDriverLogTypes = keyof typeof SUPPORTED_LOG_TYPES;
55
- export type AppiumServer = import("@appium/types").AppiumServer;
56
- export type BiDiListenerProperties = {
57
- type: string;
58
- srcEventName?: string | undefined;
59
- context?: string | undefined;
60
- entryTransformer?: ((x: any) => import("./types").LogEntry) | undefined;
61
- };
62
- /**
63
- * @type {import('@appium/types').LogDefRecord}
64
- * @privateRemarks The return types for these getters should be specified
59
+ * @template EE extends EventEmitter
60
+ * @param logEmitter - The event emitter to attach the listener to
61
+ * @param properties - Configuration for the BiDi listener
62
+ * @returns A tuple containing the log emitter and the listener function
65
63
  */
66
- declare const SUPPORTED_LOG_TYPES: import("@appium/types").LogDefRecord;
64
+ export declare function assignBiDiLogListener<EE extends EventEmitter>(this: XCUITestDriver, logEmitter: EE, properties: BiDiListenerProperties): [EE, LogListener];
67
65
  export {};
68
66
  //# sourceMappingURL=log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../lib/commands/log.js"],"names":[],"mappings":"AAqEA;;;;;GAKG;AACH,+EAJW,sBAAsB,kBACtB,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAC;IAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;CAAC,CAAC,CAAC,gBAwB3E;AAED;;GAEG;AACH,4FAqFC;;IApFC,qCAA2B;;AAsF7B;;;;;;;;;;;GAWG;AACH,oFAHa,OAAO,CAAC,IAAI,CAAC,CA8DzB;;IA5BK;;uBAIC;;AA0BP;;;;;GAKG;AACH,mFAFa,OAAO,CAAC,IAAI,CAAC,CAUzB;AAED;;;;;;;;GAQG;AACH,sCANkD,EAAE,SAAvC,OAAQ,aAAa,EAAE,YAAa,wDAEtC,EAAE,cACF,sBAAsB,GACpB,CAAC,EAAE,EAAE,OAAO,SAAS,EAAE,WAAW,CAAC,CAe/C;AAxOD,qEAAqD;6BAwPxC,OAAO,WAAW,EAAE,cAAc;qCAClC,MAAM,OAAO,mBAAmB;2BAChC,OAAO,eAAe,EAAE,YAAY;;UAKnC,MAAM;;;oCAGS,OAAO,SA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