@limrun/appium-xcuitest-driver 10.11.0-lim.4 → 10.14.6-lim.1
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 +94 -0
- package/build/lib/commands/active-app-info.d.ts +4 -3
- package/build/lib/commands/active-app-info.d.ts.map +1 -1
- package/build/lib/commands/active-app-info.js +2 -3
- package/build/lib/commands/active-app-info.js.map +1 -1
- package/build/lib/commands/alert.d.ts +26 -31
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +20 -29
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +99 -76
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +83 -73
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/app-strings.d.ts +6 -7
- package/build/lib/commands/app-strings.d.ts.map +1 -1
- package/build/lib/commands/app-strings.js +3 -8
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +7 -9
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +13 -19
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/audit.d.ts +5 -33
- package/build/lib/commands/audit.d.ts.map +1 -1
- package/build/lib/commands/audit.js +3 -16
- package/build/lib/commands/audit.js.map +1 -1
- package/build/lib/commands/battery.d.ts +4 -4
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +3 -7
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/biometric.d.ts +12 -14
- package/build/lib/commands/biometric.d.ts.map +1 -1
- package/build/lib/commands/biometric.js +10 -19
- package/build/lib/commands/biometric.js.map +1 -1
- package/build/lib/commands/certificate.d.ts +14 -19
- package/build/lib/commands/certificate.d.ts.map +1 -1
- package/build/lib/commands/certificate.js +24 -31
- package/build/lib/commands/certificate.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +9 -11
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +8 -13
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/condition.d.ts +9 -72
- package/build/lib/commands/condition.d.ts.map +1 -1
- package/build/lib/commands/condition.js +5 -66
- package/build/lib/commands/condition.js.map +1 -1
- package/build/lib/commands/content-size.d.ts +16 -19
- package/build/lib/commands/content-size.d.ts.map +1 -1
- package/build/lib/commands/content-size.js +14 -22
- package/build/lib/commands/content-size.js.map +1 -1
- 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 +123 -108
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/device-info.d.ts +13 -0
- package/build/lib/commands/device-info.d.ts.map +1 -0
- package/build/lib/commands/device-info.js +20 -0
- package/build/lib/commands/device-info.js.map +1 -0
- package/build/lib/commands/element.d.ts +83 -67
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +111 -134
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +10 -22
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +13 -29
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-movement.d.ts +31 -42
- package/build/lib/commands/file-movement.d.ts.map +1 -1
- package/build/lib/commands/file-movement.js +146 -205
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/commands/find.d.ts +20 -12
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +27 -65
- package/build/lib/commands/find.js.map +1 -1
- 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 +67 -54
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +16 -36
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +8 -25
- package/build/lib/commands/geolocation.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/increase-contrast.d.ts +10 -13
- package/build/lib/commands/increase-contrast.d.ts.map +1 -1
- package/build/lib/commands/increase-contrast.js +8 -16
- package/build/lib/commands/increase-contrast.js.map +1 -1
- package/build/lib/commands/iohid.d.ts +6 -1359
- package/build/lib/commands/iohid.d.ts.map +1 -1
- package/build/lib/commands/iohid.js +5 -10
- package/build/lib/commands/iohid.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +16 -13
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +14 -18
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/keychains.d.ts +2 -2
- package/build/lib/commands/keychains.d.ts.map +1 -1
- package/build/lib/commands/keychains.js +1 -4
- package/build/lib/commands/keychains.js.map +1 -1
- package/build/lib/commands/localization.d.ts +7 -6
- package/build/lib/commands/localization.d.ts.map +1 -1
- package/build/lib/commands/localization.js +7 -8
- package/build/lib/commands/localization.js.map +1 -1
- package/build/lib/commands/location.d.ts +8 -11
- package/build/lib/commands/location.d.ts.map +1 -1
- package/build/lib/commands/location.js +7 -15
- package/build/lib/commands/location.js.map +1 -1
- package/build/lib/commands/lock.d.ts +6 -10
- package/build/lib/commands/lock.d.ts.map +1 -1
- package/build/lib/commands/lock.js +3 -10
- package/build/lib/commands/lock.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/memory.d.ts +4 -5
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +3 -8
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +14 -26
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +22 -32
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/notifications.d.ts +10 -10
- package/build/lib/commands/notifications.d.ts.map +1 -1
- package/build/lib/commands/notifications.js +8 -12
- package/build/lib/commands/notifications.js.map +1 -1
- package/build/lib/commands/pasteboard.d.ts +9 -10
- package/build/lib/commands/pasteboard.d.ts.map +1 -1
- package/build/lib/commands/pasteboard.js +8 -13
- package/build/lib/commands/pasteboard.js.map +1 -1
- package/build/lib/commands/pcap.d.ts +18 -38
- package/build/lib/commands/pcap.d.ts.map +1 -1
- package/build/lib/commands/pcap.js +9 -14
- package/build/lib/commands/pcap.js.map +1 -1
- package/build/lib/commands/performance.d.ts +36 -55
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +93 -86
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +15 -17
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +12 -18
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/proxy-helper.d.ts +11 -11
- package/build/lib/commands/proxy-helper.d.ts.map +1 -1
- package/build/lib/commands/proxy-helper.js +15 -24
- package/build/lib/commands/proxy-helper.js.map +1 -1
- package/build/lib/commands/record-audio.d.ts +25 -52
- package/build/lib/commands/record-audio.d.ts.map +1 -1
- package/build/lib/commands/record-audio.js +17 -19
- package/build/lib/commands/record-audio.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +31 -62
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +29 -28
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +15 -9
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +16 -16
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/simctl.d.ts +16 -22
- package/build/lib/commands/simctl.d.ts.map +1 -1
- package/build/lib/commands/simctl.js +13 -17
- package/build/lib/commands/simctl.js.map +1 -1
- package/build/lib/commands/source.d.ts +10 -8
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js +11 -14
- package/build/lib/commands/source.js.map +1 -1
- package/build/lib/commands/timeouts.d.ts +25 -32
- package/build/lib/commands/timeouts.d.ts.map +1 -1
- package/build/lib/commands/timeouts.js +19 -15
- package/build/lib/commands/timeouts.js.map +1 -1
- package/build/lib/commands/types.d.ts +80 -0
- package/build/lib/commands/types.d.ts.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 +216 -175
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/commands/xctest-record-screen.d.ts +17 -47
- package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
- package/build/lib/commands/xctest-record-screen.js +28 -59
- package/build/lib/commands/xctest-record-screen.js.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/desired-caps.js +1 -1
- package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -1
- package/build/lib/device/log/ios-simulator-log.js +2 -0
- package/build/lib/device/log/ios-simulator-log.js.map +1 -1
- package/build/lib/device/simulator-management.d.ts.map +1 -1
- package/build/lib/device/simulator-management.js +0 -2
- package/build/lib/device/simulator-management.js.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts +0 -9
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js +1 -30
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/driver.d.ts +6 -5
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +16 -14
- 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 -9
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/active-app-info.ts +15 -0
- package/lib/commands/alert.ts +98 -0
- package/lib/commands/app-management.ts +414 -0
- package/lib/commands/{app-strings.js → app-strings.ts} +10 -9
- package/lib/commands/appearance.ts +70 -0
- package/lib/commands/audit.ts +25 -0
- package/lib/commands/{battery.js → battery.ts} +10 -12
- package/lib/commands/biometric.ts +52 -0
- package/lib/commands/{certificate.js → certificate.ts} +55 -50
- package/lib/commands/clipboard.ts +37 -0
- package/lib/commands/{condition.js → condition.ts} +21 -77
- package/lib/commands/content-size.ts +67 -0
- package/lib/commands/{context.js → context.ts} +174 -146
- package/lib/commands/device-info.ts +24 -0
- package/lib/commands/element.ts +419 -0
- package/lib/commands/{execute.js → execute.ts} +42 -38
- package/lib/commands/{file-movement.js → file-movement.ts} +212 -235
- package/lib/commands/find.ts +277 -0
- package/lib/commands/{general.js → general.ts} +102 -77
- package/lib/commands/geolocation.ts +55 -0
- package/lib/commands/{gesture.js → gesture.ts} +225 -183
- package/lib/commands/increase-contrast.ts +49 -0
- package/lib/commands/{iohid.js → iohid.ts} +15 -13
- package/lib/commands/keyboard.ts +70 -0
- package/lib/commands/keychains.ts +16 -0
- package/lib/commands/{localization.js → localization.ts} +22 -12
- package/lib/commands/{location.js → location.ts} +19 -22
- package/lib/commands/lock.ts +43 -0
- package/lib/commands/{log.js → log.ts} +68 -68
- package/lib/commands/{memory.js → memory.ts} +9 -9
- package/lib/commands/{navigation.js → navigation.ts} +42 -39
- package/lib/commands/{notifications.js → notifications.ts} +22 -14
- package/lib/commands/pasteboard.ts +44 -0
- package/lib/commands/{pcap.js → pcap.ts} +28 -28
- package/lib/commands/{performance.js → performance.ts} +133 -114
- package/lib/commands/permissions.ts +90 -0
- package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
- package/lib/commands/{record-audio.js → record-audio.ts} +35 -33
- package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
- package/lib/commands/{screenshots.js → screenshots.ts} +27 -21
- package/lib/commands/simctl.ts +82 -0
- package/lib/commands/{source.js → source.ts} +23 -20
- package/lib/commands/timeouts.ts +95 -0
- package/lib/commands/types.ts +86 -0
- package/lib/commands/{web.js → web.ts} +314 -264
- package/lib/commands/{xctest-record-screen.js → xctest-record-screen.ts} +54 -71
- package/lib/commands/{xctest.js → xctest.ts} +78 -71
- package/lib/desired-caps.ts +1 -1
- package/lib/device/log/ios-simulator-log.ts +2 -0
- package/lib/device/simulator-management.ts +0 -2
- package/lib/doctor/optional-checks.ts +0 -33
- package/lib/driver.ts +19 -17
- package/lib/execute-method-map.ts +0 -9
- package/package.json +6 -6
- package/lib/commands/active-app-info.js +0 -12
- package/lib/commands/alert.js +0 -88
- package/lib/commands/app-management.js +0 -346
- package/lib/commands/appearance.js +0 -71
- package/lib/commands/audit.js +0 -31
- package/lib/commands/biometric.js +0 -52
- package/lib/commands/clipboard.js +0 -35
- package/lib/commands/content-size.js +0 -68
- package/lib/commands/deviceInfo.js +0 -27
- package/lib/commands/element.js +0 -423
- package/lib/commands/find.js +0 -205
- package/lib/commands/geolocation.js +0 -56
- package/lib/commands/increase-contrast.js +0 -50
- package/lib/commands/keyboard.js +0 -62
- package/lib/commands/keychains.js +0 -17
- package/lib/commands/lock.js +0 -46
- package/lib/commands/pasteboard.js +0 -43
- package/lib/commands/permissions.js +0 -85
- package/lib/commands/simctl.js +0 -71
- package/lib/commands/timeouts.js +0 -68
|
@@ -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
|
-
*
|
|
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}'`);
|
|
@@ -164,22 +186,22 @@ async function setUrl(url) {
|
|
|
164
186
|
this.setCurrentUrl(url);
|
|
165
187
|
// make sure to clear out any leftover web frames
|
|
166
188
|
this.curWebFrames = [];
|
|
167
|
-
await
|
|
189
|
+
await this.remote.navToUrl(url);
|
|
168
190
|
return;
|
|
169
191
|
}
|
|
170
192
|
if (this.isRealDevice()) {
|
|
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;AACxD,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,mBAAmB,CAAuB,SAAS,GAAG,IAAI;IAC9E,MAAM,IAAI,CAAC,qBAAqB,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ErC,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,57 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* resetSimulatedLocation} has been called.
|
|
9
|
-
*/
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
export interface GeolocationInfo {
|
|
3
|
+
/** Measurement of distance north or south of the Equator, or `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode mobileResetSimulatedLocation} has been called. */
|
|
4
|
+
latitude: number | null;
|
|
5
|
+
/** Measurement of distance east or west of the prime meridian, or `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode mobileResetSimulatedLocation} has been called. */
|
|
6
|
+
longitude: number | null;
|
|
7
|
+
}
|
|
10
8
|
/**
|
|
11
9
|
* Retrieves the simulated geolocation value.
|
|
12
10
|
* Only works since Xcode 14.3/iOS 16.4
|
|
13
11
|
*
|
|
14
|
-
* @returns
|
|
15
|
-
* @throws
|
|
12
|
+
* @returns The current simulated geolocation
|
|
13
|
+
* @throws If the device under test does not support geolocation simulation.
|
|
16
14
|
* @since 4.18
|
|
17
|
-
* @this {XCUITestDriver}
|
|
18
15
|
*/
|
|
19
|
-
export function mobileGetSimulatedLocation(this:
|
|
16
|
+
export declare function mobileGetSimulatedLocation(this: XCUITestDriver): Promise<GeolocationInfo>;
|
|
20
17
|
/**
|
|
21
18
|
* Sets simulated geolocation value.
|
|
22
19
|
* Only works since Xcode 14.3/iOS 16.4
|
|
23
20
|
*
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @
|
|
27
|
-
* @throws {Error} If the device under test does not support gelolocation simulation.
|
|
21
|
+
* @param latitude - Latitude value
|
|
22
|
+
* @param longitude - Longitude value
|
|
23
|
+
* @throws If the device under test does not support geolocation simulation.
|
|
28
24
|
* @since 4.18
|
|
29
|
-
* @this {XCUITestDriver}
|
|
30
25
|
*/
|
|
31
|
-
export function mobileSetSimulatedLocation(this:
|
|
26
|
+
export declare function mobileSetSimulatedLocation(this: XCUITestDriver, latitude: number, longitude: number): Promise<void>;
|
|
32
27
|
/**
|
|
33
28
|
* Resets simulated geolocation value.
|
|
34
29
|
* Only works since Xcode 14.3/iOS 16.4.
|
|
35
30
|
* ! Do not forget to reset the simulated geolocation value after your automated test is finished.
|
|
36
31
|
* ! If the value is not reset explicitly then the simulated one will remain until the next device restart.
|
|
37
32
|
*
|
|
38
|
-
* @
|
|
39
|
-
* @throws {Error} If the device under test does not support gelolocation simulation.
|
|
33
|
+
* @throws If the device under test does not support geolocation simulation.
|
|
40
34
|
* @since 4.18
|
|
41
|
-
* @this {XCUITestDriver}
|
|
42
35
|
*/
|
|
43
|
-
export function mobileResetSimulatedLocation(this:
|
|
44
|
-
export type GeolocationInfo = {
|
|
45
|
-
/**
|
|
46
|
-
* Measurement of distance north or south of the Equator, or
|
|
47
|
-
* `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode * resetSimulatedLocation} has been called.
|
|
48
|
-
*/
|
|
49
|
-
latitude: number | null;
|
|
50
|
-
/**
|
|
51
|
-
* Measurement of distance east or west of the prime meridian, or
|
|
52
|
-
* `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode * resetSimulatedLocation} has been called.
|
|
53
|
-
*/
|
|
54
|
-
longitude: number | null;
|
|
55
|
-
};
|
|
56
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
36
|
+
export declare function mobileResetSimulatedLocation(this: XCUITestDriver): Promise<void>;
|
|
57
37
|
//# sourceMappingURL=geolocation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../lib/commands/geolocation.
|
|
1
|
+
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../lib/commands/geolocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,iNAAiN;IACjN,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sNAAsN;IACtN,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {Object} GeolocationInfo
|
|
4
|
-
* @property {number|null} latitude Measurement of distance north or south of the Equator, or
|
|
5
|
-
* `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode
|
|
6
|
-
* resetSimulatedLocation} has been called.
|
|
7
|
-
* @property {number|null} longitude Measurement of distance east or west of the prime meridian, or
|
|
8
|
-
* `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode
|
|
9
|
-
* resetSimulatedLocation} has been called.
|
|
10
|
-
*/
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.mobileGetSimulatedLocation = mobileGetSimulatedLocation;
|
|
13
4
|
exports.mobileSetSimulatedLocation = mobileSetSimulatedLocation;
|
|
@@ -16,10 +7,9 @@ exports.mobileResetSimulatedLocation = mobileResetSimulatedLocation;
|
|
|
16
7
|
* Retrieves the simulated geolocation value.
|
|
17
8
|
* Only works since Xcode 14.3/iOS 16.4
|
|
18
9
|
*
|
|
19
|
-
* @returns
|
|
20
|
-
* @throws
|
|
10
|
+
* @returns The current simulated geolocation
|
|
11
|
+
* @throws If the device under test does not support geolocation simulation.
|
|
21
12
|
* @since 4.18
|
|
22
|
-
* @this {XCUITestDriver}
|
|
23
13
|
*/
|
|
24
14
|
async function mobileGetSimulatedLocation() {
|
|
25
15
|
return await this.proxyCommand('/wda/simulatedLocation', 'GET');
|
|
@@ -28,15 +18,13 @@ async function mobileGetSimulatedLocation() {
|
|
|
28
18
|
* Sets simulated geolocation value.
|
|
29
19
|
* Only works since Xcode 14.3/iOS 16.4
|
|
30
20
|
*
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @
|
|
34
|
-
* @throws {Error} If the device under test does not support gelolocation simulation.
|
|
21
|
+
* @param latitude - Latitude value
|
|
22
|
+
* @param longitude - Longitude value
|
|
23
|
+
* @throws If the device under test does not support geolocation simulation.
|
|
35
24
|
* @since 4.18
|
|
36
|
-
* @this {XCUITestDriver}
|
|
37
25
|
*/
|
|
38
26
|
async function mobileSetSimulatedLocation(latitude, longitude) {
|
|
39
|
-
|
|
27
|
+
await this.proxyCommand('/wda/simulatedLocation', 'POST', { latitude, longitude });
|
|
40
28
|
}
|
|
41
29
|
/**
|
|
42
30
|
* Resets simulated geolocation value.
|
|
@@ -44,15 +32,10 @@ async function mobileSetSimulatedLocation(latitude, longitude) {
|
|
|
44
32
|
* ! Do not forget to reset the simulated geolocation value after your automated test is finished.
|
|
45
33
|
* ! If the value is not reset explicitly then the simulated one will remain until the next device restart.
|
|
46
34
|
*
|
|
47
|
-
* @
|
|
48
|
-
* @throws {Error} If the device under test does not support gelolocation simulation.
|
|
35
|
+
* @throws If the device under test does not support geolocation simulation.
|
|
49
36
|
* @since 4.18
|
|
50
|
-
* @this {XCUITestDriver}
|
|
51
37
|
*/
|
|
52
38
|
async function mobileResetSimulatedLocation() {
|
|
53
|
-
|
|
39
|
+
await this.proxyCommand('/wda/simulatedLocation', 'DELETE');
|
|
54
40
|
}
|
|
55
|
-
/**
|
|
56
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
57
|
-
*/
|
|
58
41
|
//# sourceMappingURL=geolocation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.
|
|
1
|
+
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.ts"],"names":[],"mappings":";;AAiBA,gEAIC;AAWD,gEAMC;AAWD,oEAIC;AA5CD;;;;;;;GAOG;AACI,KAAK,UAAU,0BAA0B;IAG9C,OAAO,MAAM,IAAI,CAAC,YAAY,CAAuB,wBAAwB,EAAE,KAAK,CAAC,CAAC;AACxF,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,0BAA0B,CAE9C,QAAgB,EAChB,SAAiB;IAEjB,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAC,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,4BAA4B;IAGhD,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC"}
|