appium-xcuitest-driver 10.13.3 → 10.14.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/general.d.ts +84 -80
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +66 -53
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/log.d.ts +42 -44
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +32 -53
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +1 -1
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/xctest.d.ts +37 -37
- package/build/lib/commands/xctest.d.ts.map +1 -1
- package/build/lib/commands/xctest.js +38 -50
- package/build/lib/commands/xctest.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/{general.js → general.ts} +101 -76
- package/lib/commands/{log.js → log.ts} +68 -68
- package/lib/commands/{xctest.js → xctest.ts} +78 -71
- package/lib/execute-method-map.ts +0 -1
- package/npm-shrinkwrap.json +9 -9
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [10.14.0](https://github.com/appium/appium-xcuitest-driver/compare/v10.13.4...v10.14.0) (2025-12-30)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add documentation for customActions ([#2690](https://github.com/appium/appium-xcuitest-driver/issues/2690)) ([c8a0473](https://github.com/appium/appium-xcuitest-driver/commit/c8a04730a62353752a5142dab04115e3afe155db))
|
|
6
|
+
|
|
7
|
+
## [10.13.4](https://github.com/appium/appium-xcuitest-driver/compare/v10.13.3...v10.13.4) (2025-12-30)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* 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))
|
|
12
|
+
|
|
1
13
|
## [10.13.3](https://github.com/appium/appium-xcuitest-driver/compare/v10.13.2...v10.13.3) (2025-12-28)
|
|
2
14
|
|
|
3
15
|
### 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
|
-
*
|
|
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:
|
|
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
|
|
9
|
-
* @this {XCUITestDriver}
|
|
16
|
+
* @param match - Whether the match should be a success or failure
|
|
10
17
|
*/
|
|
11
|
-
export function touchId(this:
|
|
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
|
-
* @
|
|
22
|
+
* @param isEnabled - Whether to enable or disable the touch ID program
|
|
18
23
|
*/
|
|
19
|
-
export function toggleEnrollTouchId(this:
|
|
24
|
+
export declare function toggleEnrollTouchId(this: XCUITestDriver, isEnabled?: boolean): Promise<void>;
|
|
20
25
|
/**
|
|
21
|
-
* Get the window size
|
|
22
|
-
*
|
|
23
|
-
* @returns
|
|
26
|
+
* Get the window size.
|
|
27
|
+
*
|
|
28
|
+
* @returns The window size (width and height)
|
|
24
29
|
*/
|
|
25
|
-
export function getWindowSize(this:
|
|
30
|
+
export declare function getWindowSize(this: XCUITestDriver): Promise<Size>;
|
|
26
31
|
/**
|
|
27
32
|
* Retrieves the actual device time.
|
|
28
33
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @returns
|
|
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:
|
|
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
|
|
38
|
-
* @returns
|
|
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:
|
|
46
|
+
export declare function mobileGetDeviceTime(this: XCUITestDriver, format?: string): Promise<string>;
|
|
42
47
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
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:
|
|
55
|
+
export declare function getWindowRect(this: XCUITestDriver): Promise<Rect>;
|
|
48
56
|
/**
|
|
49
|
-
*
|
|
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:
|
|
64
|
+
export declare function removeApp(this: XCUITestDriver, bundleId: string): Promise<boolean>;
|
|
52
65
|
/**
|
|
53
|
-
*
|
|
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:
|
|
72
|
+
export declare function launchApp(this: XCUITestDriver): Promise<void>;
|
|
56
73
|
/**
|
|
57
|
-
*
|
|
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:
|
|
80
|
+
export declare function closeApp(this: XCUITestDriver): Promise<void>;
|
|
60
81
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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:
|
|
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
|
-
*
|
|
80
|
-
* @
|
|
95
|
+
*
|
|
96
|
+
* @returns The viewport rectangle
|
|
81
97
|
*/
|
|
82
|
-
export function getViewportRect(this:
|
|
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
|
-
* @
|
|
88
|
-
* @returns {Promise<ScreenInfo>}
|
|
103
|
+
* @returns Screen information including dimensions, scale, and status bar size
|
|
89
104
|
*/
|
|
90
|
-
export function getScreenInfo(this:
|
|
105
|
+
export declare function getScreenInfo(this: XCUITestDriver): Promise<ScreenInfo>;
|
|
91
106
|
/**
|
|
92
|
-
*
|
|
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:
|
|
111
|
+
export declare function getStatusBarHeight(this: XCUITestDriver): Promise<number>;
|
|
95
112
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
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:
|
|
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
|
|
111
|
-
* @param
|
|
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:
|
|
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
|
|
121
|
-
|
|
122
|
-
|
|
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.
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../lib/commands/general.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAK9C;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAK/D;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/E;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/F;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,MAAM,SAAwB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAsCjB;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,MAAM,SAAwB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,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
|
27
27
|
const teen_process_1 = require("teen_process");
|
|
28
28
|
const MOMENT_FORMAT_ISO8601 = 'YYYY-MM-DDTHH:mm:ssZ';
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
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
|
|
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
|
-
* @
|
|
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
|
-
*
|
|
60
|
-
* @returns
|
|
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
|
|
70
|
-
* @returns
|
|
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
|
|
113
|
-
* @returns
|
|
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
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
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
|
|
139
|
+
return (await this.proxyCommand('/window/rect', 'GET'));
|
|
135
140
|
}
|
|
136
141
|
/**
|
|
137
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
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
|
|
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
|
-
*
|
|
182
|
-
* @
|
|
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
|
-
* @
|
|
203
|
-
* @returns {Promise<ScreenInfo>}
|
|
224
|
+
* @returns Screen information including dimensions, scale, and status bar size
|
|
204
225
|
*/
|
|
205
226
|
async function getScreenInfo() {
|
|
206
|
-
return
|
|
227
|
+
return (await this.proxyCommand('/wda/screen', 'GET'));
|
|
207
228
|
}
|
|
208
229
|
/**
|
|
209
|
-
*
|
|
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
|
-
*
|
|
217
|
-
*
|
|
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
|
|
234
|
-
* @param
|
|
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
|
|
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.
|
|
1
|
+
{"version":3,"file":"general.js","sourceRoot":"","sources":["../../../lib/commands/general.ts"],"names":[],"mappings":";;;;;AAoBA,wBAKC;AAOD,0BAEC;AAOD,kDAEC;AAOD,sCAGC;AAQD,sCAyCC;AAUD,kDAKC;AAUD,sCAYC;AAUD,8BAEC;AASD,8BAKC;AASD,4BAKC;AAWD,wBAgBC;AASD,0CAcC;AAQD,sCAEC;AAOD,gDAGC;AAQD,kDAGC;AAeD,8CAYC;AASD,8CAKC;AA7SD,oDAAuB;AACvB,0CAAqC;AACrC,sEAAqC;AACrC,yDAA4C;AAC5C,+CAAkC;AAMlC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD;;;;;;;GAOG;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;;;;GAIG;AACI,KAAK,UAAU,OAAO,CAAuB,KAAK,GAAG,IAAI;IAC9D,MAAM,IAAI,CAAC,wBAAwB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACx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,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
|
|
4
|
-
* @param
|
|
5
|
-
* @
|
|
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:
|
|
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
|
-
*
|
|
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:
|
|
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.
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
46
|
-
* @
|
|
47
|
-
* @param
|
|
48
|
-
* @
|
|
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
|
|
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.
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../lib/commands/log.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAC,YAAY,EAAyB,MAAM,eAAe,CAAC;AAExE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAU9C,KAAK,sBAAsB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAE/D,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,QAAQ,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