@limrun/appium-xcuitest-driver 10.11.0-lim.3 → 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 +4 -5
- package/build/lib/device/simulator-management.js.map +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-simulator-log.d.ts +1 -1
- package/build/lib/device-log/ios-simulator-log.d.ts.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 +11 -3
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +36 -12
- 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/build/lib/simulator-management.js +3 -3
- package/build/lib/simulator-management.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 +3 -6
- package/lib/doctor/optional-checks.ts +0 -33
- package/lib/driver.ts +38 -13
- package/lib/execute-method-map.ts +0 -9
- package/package.json +6 -5
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iohid.d.ts","sourceRoot":"","sources":["../../../lib/commands/iohid.
|
|
1
|
+
{"version":3,"file":"iohid.d.ts","sourceRoot":"","sources":["../../../lib/commands/iohid.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,YAAY,EAAC,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,GAAG,MAAM,GAC/B,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -14,10 +14,9 @@ const hid_event_1 = require("./hid-event");
|
|
|
14
14
|
* - `kHIDUsage_Csmr_Power` = `0x30` (Power)
|
|
15
15
|
* - `kHIDUsage_Csmr_Snapshot` = `0x65` (Power + Home)
|
|
16
16
|
*
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @this {import('../driver').XCUITestDriver}
|
|
17
|
+
* @param page - The event page identifier
|
|
18
|
+
* @param usage - The event usage identifier (usages are defined per-page)
|
|
19
|
+
* @param durationSeconds - The event duration in float seconds (XCTest uses `0.005` for a single press event)
|
|
21
20
|
*/
|
|
22
21
|
async function mobilePerformIoHidEvent(page, usage, durationSeconds) {
|
|
23
22
|
if (!isHIDPageEvent(page)) {
|
|
@@ -30,12 +29,10 @@ async function mobilePerformIoHidEvent(page, usage, durationSeconds) {
|
|
|
30
29
|
if (Number.isNaN(duration)) {
|
|
31
30
|
throw new driver_1.errors.InvalidArgumentError(`'durationSeconds' argument must be a valid number`);
|
|
32
31
|
}
|
|
33
|
-
|
|
32
|
+
await this.proxyCommand('/wda/performIoHidEvent', 'POST', { page, usage, duration });
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
35
|
* Type guard for {@linkcode HIDUsageEvent}
|
|
37
|
-
* @param {any} value
|
|
38
|
-
* @returns {value is HIDUsageEvent}
|
|
39
36
|
*/
|
|
40
37
|
function isHIDUsageEvent(value) {
|
|
41
38
|
if (typeof value === 'string') {
|
|
@@ -48,9 +45,7 @@ function isHIDUsageEvent(value) {
|
|
|
48
45
|
}
|
|
49
46
|
/**
|
|
50
47
|
* Type guard for {@linkcode HIDPageEvent}
|
|
51
|
-
|
|
52
|
-
* @returns {value is HIDPageEvent}
|
|
53
|
-
**/
|
|
48
|
+
*/
|
|
54
49
|
function isHIDPageEvent(value) {
|
|
55
50
|
if (typeof value === 'string') {
|
|
56
51
|
value = parseInt(value, 10);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iohid.js","sourceRoot":"","sources":["../../../lib/commands/iohid.
|
|
1
|
+
{"version":3,"file":"iohid.js","sourceRoot":"","sources":["../../../lib/commands/iohid.ts"],"names":[],"mappings":";;AAmBA,0DAmBC;AAtCD,0CAAqC;AACrC,2CAAwD;AAGxD;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,uBAAuB,CAE3C,IAAkB,EAClB,KAAa,EACb,eAAgC;IAEhC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,kDAAkD,CAAC,CAAC;IAC5F,CAAC;IACD,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,mDAAmD,CAAC,CAAC;IAC7F,CAAC;IACD,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAC,CAAC,CAAC;AACrF,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,KAAU;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,IAAI,yBAAa,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,KAAU;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,IAAI,wBAAY,CAAC;AAC/B,CAAC"}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { KeyboardKey } from './types';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Hides the keyboard.
|
|
5
|
+
*
|
|
3
6
|
* @deprecated
|
|
4
7
|
*/
|
|
5
|
-
export function hideKeyboard(this:
|
|
8
|
+
export declare function hideKeyboard(this: XCUITestDriver, strategy?: string, ...possibleKeys: string[]): Promise<boolean>;
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
10
|
+
* Hides the keyboard using the specified key names.
|
|
11
|
+
*
|
|
12
|
+
* @param keys - Array of key names to use for dismissing the keyboard
|
|
9
13
|
*/
|
|
10
|
-
export function mobileHideKeyboard(this:
|
|
14
|
+
export declare function mobileHideKeyboard(this: XCUITestDriver, keys?: string[]): Promise<void>;
|
|
11
15
|
/**
|
|
12
|
-
*
|
|
16
|
+
* Checks whether the keyboard is currently shown.
|
|
17
|
+
*
|
|
18
|
+
* @returns `true` if the keyboard is shown, `false` otherwise
|
|
13
19
|
*/
|
|
14
|
-
export function isKeyboardShown(this:
|
|
20
|
+
export declare function isKeyboardShown(this: XCUITestDriver): Promise<boolean>;
|
|
15
21
|
/**
|
|
16
22
|
* Send keys to the given element or to the application under test.
|
|
17
23
|
* This API is not supported on tvOS
|
|
18
24
|
*
|
|
19
25
|
* @since Xcode 15/iOS 17
|
|
20
|
-
* @
|
|
21
|
-
* @param {(Key|string)[]} keys Array of keys to type.
|
|
26
|
+
* @param keys - Array of keys to type.
|
|
22
27
|
* Each item could either be a string, that represents a key itself (see
|
|
23
28
|
* https://developer.apple.com/documentation/xctest/xcuielement/1500604-typekey?language=objc
|
|
24
29
|
* and https://developer.apple.com/documentation/xctest/xcuikeyboardkey?language=objc)
|
|
25
30
|
* or a dictionary, if the key should also be entered with modifiers.
|
|
26
|
-
* @param
|
|
31
|
+
* @param elementId - UUID of the element to send keys to.
|
|
27
32
|
* If the element is not provided then the keys will be sent to the current application.
|
|
28
33
|
*/
|
|
29
|
-
export function mobileKeys(this:
|
|
30
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
31
|
-
export type Key = import("./types").KeyboardKey;
|
|
34
|
+
export declare function mobileKeys(this: XCUITestDriver, keys: (KeyboardKey | string)[], elementId?: string | null): Promise<void>;
|
|
32
35
|
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/keyboard.
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/keyboard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAEzC;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,GAAG,YAAY,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,IAAI,GAAE,MAAM,EAAO,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,EAAE,EAC9B,SAAS,GAAE,MAAM,GAAG,IAAW,GAC9B,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -9,7 +9,8 @@ exports.isKeyboardShown = isKeyboardShown;
|
|
|
9
9
|
exports.mobileKeys = mobileKeys;
|
|
10
10
|
const lodash_1 = __importDefault(require("lodash"));
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Hides the keyboard.
|
|
13
|
+
*
|
|
13
14
|
* @deprecated
|
|
14
15
|
*/
|
|
15
16
|
async function hideKeyboard(strategy, ...possibleKeys) {
|
|
@@ -19,17 +20,19 @@ async function hideKeyboard(strategy, ...possibleKeys) {
|
|
|
19
20
|
return true;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
23
|
+
* Hides the keyboard using the specified key names.
|
|
24
|
+
*
|
|
25
|
+
* @param keys - Array of key names to use for dismissing the keyboard
|
|
24
26
|
*/
|
|
25
27
|
async function mobileHideKeyboard(keys = []) {
|
|
26
|
-
|
|
27
|
-
keys.
|
|
28
|
-
}
|
|
29
|
-
await this.proxyCommand('/wda/keyboard/dismiss', 'POST', { keyNames: keys });
|
|
28
|
+
await this.proxyCommand('/wda/keyboard/dismiss', 'POST', {
|
|
29
|
+
keyNames: keys.includes('done') ? keys : [...keys, 'done'],
|
|
30
|
+
});
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
+
* Checks whether the keyboard is currently shown.
|
|
34
|
+
*
|
|
35
|
+
* @returns `true` if the keyboard is shown, `false` otherwise
|
|
33
36
|
*/
|
|
34
37
|
async function isKeyboardShown() {
|
|
35
38
|
try {
|
|
@@ -45,23 +48,16 @@ async function isKeyboardShown() {
|
|
|
45
48
|
* This API is not supported on tvOS
|
|
46
49
|
*
|
|
47
50
|
* @since Xcode 15/iOS 17
|
|
48
|
-
* @
|
|
49
|
-
* @param {(Key|string)[]} keys Array of keys to type.
|
|
51
|
+
* @param keys - Array of keys to type.
|
|
50
52
|
* Each item could either be a string, that represents a key itself (see
|
|
51
53
|
* https://developer.apple.com/documentation/xctest/xcuielement/1500604-typekey?language=objc
|
|
52
54
|
* and https://developer.apple.com/documentation/xctest/xcuikeyboardkey?language=objc)
|
|
53
55
|
* or a dictionary, if the key should also be entered with modifiers.
|
|
54
|
-
* @param
|
|
56
|
+
* @param elementId - UUID of the element to send keys to.
|
|
55
57
|
* If the element is not provided then the keys will be sent to the current application.
|
|
56
58
|
*/
|
|
57
59
|
async function mobileKeys(keys, elementId = null) {
|
|
58
60
|
const url = `/wda/element/${elementId || 0}/keyboardInput`;
|
|
59
|
-
|
|
61
|
+
await this.proxyCommand(url, 'POST', { keys });
|
|
60
62
|
}
|
|
61
|
-
/**
|
|
62
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
63
|
-
*/
|
|
64
|
-
/**
|
|
65
|
-
* @typedef {import('./types').KeyboardKey} Key
|
|
66
|
-
*/
|
|
67
63
|
//# sourceMappingURL=keyboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.js","sourceRoot":"","sources":["../../../lib/commands/keyboard.
|
|
1
|
+
{"version":3,"file":"keyboard.js","sourceRoot":"","sources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,CAAC;AACjD,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Clears keychains on a simulated device.
|
|
3
4
|
*
|
|
4
5
|
* @throws {Error} If current device is not a Simulator or there was an error
|
|
5
6
|
* while clearing keychains.
|
|
6
|
-
* @this {import('../driver').XCUITestDriver}
|
|
7
7
|
* @group Simulator Only
|
|
8
8
|
*/
|
|
9
|
-
export function mobileClearKeychains(this:
|
|
9
|
+
export declare function mobileClearKeychains(this: XCUITestDriver): Promise<void>;
|
|
10
10
|
//# sourceMappingURL=keychains.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychains.d.ts","sourceRoot":"","sources":["../../../lib/commands/keychains.
|
|
1
|
+
{"version":3,"file":"keychains.d.ts","sourceRoot":"","sources":["../../../lib/commands/keychains.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -2,17 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mobileClearKeychains = mobileClearKeychains;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
|
-
const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Keychain modification');
|
|
6
5
|
/**
|
|
7
6
|
* Clears keychains on a simulated device.
|
|
8
7
|
*
|
|
9
8
|
* @throws {Error} If current device is not a Simulator or there was an error
|
|
10
9
|
* while clearing keychains.
|
|
11
|
-
* @this {import('../driver').XCUITestDriver}
|
|
12
10
|
* @group Simulator Only
|
|
13
11
|
*/
|
|
14
12
|
async function mobileClearKeychains() {
|
|
15
|
-
assertSimulator(this);
|
|
16
|
-
await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).clearKeychains();
|
|
13
|
+
await utils_1.assertSimulator.call(this, 'Keychain modification').clearKeychains();
|
|
17
14
|
}
|
|
18
15
|
//# sourceMappingURL=keychains.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychains.js","sourceRoot":"","sources":["../../../lib/commands/keychains.
|
|
1
|
+
{"version":3,"file":"keychains.js","sourceRoot":"","sources":["../../../lib/commands/keychains.ts"],"names":[],"mappings":";;AAUA,oDAIC;AAdD,oCAAyC;AAGzC;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB;IAGxC,MAAM,uBAAe,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,cAAc,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { KeyboardOptions, LanguageOptions, LocaleOptions } from './types';
|
|
1
3
|
/**
|
|
2
4
|
* Change localization settings on the currently booted simulator
|
|
3
5
|
*
|
|
@@ -5,13 +7,12 @@
|
|
|
5
7
|
* Currently running applications will be unchanged. This means, for example, that the keyboard should be hidden and shown again in order to observe the changed layout, and corresponding apps must be restarted in order to observe their interface using the newly set locale/language.
|
|
6
8
|
*
|
|
7
9
|
* The driver performs no strict checking of the arguments (such as locale names). Be aware that an incorrect or invalid string may cause unexpected behavior.
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
10
|
+
* @param keyboard - Keyboard options
|
|
11
|
+
* @param language - Language options
|
|
12
|
+
* @param locale - Locale options
|
|
11
13
|
* @throws {Error} If there was a failure while setting the preferences
|
|
12
|
-
* @returns
|
|
14
|
+
* @returns `true` if any of settings has been successfully changed
|
|
13
15
|
* @group Simulator Only
|
|
14
|
-
* @this {import('../driver').XCUITestDriver}
|
|
15
16
|
*/
|
|
16
|
-
export function mobileConfigureLocalization(this:
|
|
17
|
+
export declare function mobileConfigureLocalization(this: XCUITestDriver, keyboard?: KeyboardOptions, language?: LanguageOptions, locale?: LocaleOptions): Promise<boolean>;
|
|
17
18
|
//# sourceMappingURL=localization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../lib/commands/localization.
|
|
1
|
+
{"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../lib/commands/localization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAE,eAAe,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAE7E;;;;;;;;;;;;;GAaG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,cAAc,EACpB,QAAQ,CAAC,EAAE,eAAe,EAC1B,QAAQ,CAAC,EAAE,eAAe,EAC1B,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,OAAO,CAAC,CAclB"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mobileConfigureLocalization = mobileConfigureLocalization;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
|
-
const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Localization configuration');
|
|
6
5
|
/**
|
|
7
6
|
* Change localization settings on the currently booted simulator
|
|
8
7
|
*
|
|
@@ -10,21 +9,21 @@ const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Locali
|
|
|
10
9
|
* Currently running applications will be unchanged. This means, for example, that the keyboard should be hidden and shown again in order to observe the changed layout, and corresponding apps must be restarted in order to observe their interface using the newly set locale/language.
|
|
11
10
|
*
|
|
12
11
|
* The driver performs no strict checking of the arguments (such as locale names). Be aware that an incorrect or invalid string may cause unexpected behavior.
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
12
|
+
* @param keyboard - Keyboard options
|
|
13
|
+
* @param language - Language options
|
|
14
|
+
* @param locale - Locale options
|
|
16
15
|
* @throws {Error} If there was a failure while setting the preferences
|
|
17
|
-
* @returns
|
|
16
|
+
* @returns `true` if any of settings has been successfully changed
|
|
18
17
|
* @group Simulator Only
|
|
19
|
-
* @this {import('../driver').XCUITestDriver}
|
|
20
18
|
*/
|
|
21
19
|
async function mobileConfigureLocalization(keyboard, language, locale) {
|
|
22
|
-
|
|
20
|
+
;
|
|
23
21
|
const localizationOptions = { locale, keyboard };
|
|
24
22
|
if (language) {
|
|
25
23
|
// Assign skipSyncUiDialogTranslation: true option in order to avoid shutting down the WDA session
|
|
26
24
|
localizationOptions.language = Object.assign(language, { skipSyncUiDialogTranslation: true });
|
|
27
25
|
}
|
|
28
|
-
return await
|
|
26
|
+
return await utils_1.assertSimulator.call(this, 'Localization configuration')
|
|
27
|
+
.configureLocalization(localizationOptions);
|
|
29
28
|
}
|
|
30
29
|
//# sourceMappingURL=localization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.js","sourceRoot":"","sources":["../../../lib/commands/localization.
|
|
1
|
+
{"version":3,"file":"localization.js","sourceRoot":"","sources":["../../../lib/commands/localization.ts"],"names":[],"mappings":";;AAkBA,kEAmBC;AArCD,oCAAyC;AAIzC;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,2BAA2B,CAE/C,QAA0B,EAC1B,QAA0B,EAC1B,MAAsB;IAEtB,CAAC;IAED,MAAM,mBAAmB,GAIrB,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC;IACvB,IAAI,QAAQ,EAAE,CAAC;QACb,kGAAkG;QAClG,mBAAmB,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAC,2BAA2B,EAAE,IAAI,EAAC,CAAC,CAAC;IAC9F,CAAC;IACD,OAAO,MAAM,uBAAe,CAAC,IAAI,CAAC,IAAI,EAAE,4BAA4B,CAAC;SAClE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { Location } from '@appium/types';
|
|
3
|
+
import type { LocationWithAltitude } from './types';
|
|
1
4
|
/**
|
|
2
5
|
* Returns location of the device under test.
|
|
3
6
|
* The device under test must allow the location services for WDA
|
|
@@ -11,31 +14,25 @@
|
|
|
11
14
|
* "mobile:getSimulatedLocation" if the simulated location has been previously set
|
|
12
15
|
* "mobile:setSimulatedLocation" already.
|
|
13
16
|
*
|
|
14
|
-
* @returns
|
|
17
|
+
* @returns Location with altitude
|
|
15
18
|
* @throws {Error} If the device under test returns an error message.
|
|
16
19
|
* i.e.: tvOS returns unsupported error
|
|
17
|
-
* @this {XCUITestDriver}
|
|
18
20
|
*/
|
|
19
|
-
export function getGeoLocation(this:
|
|
21
|
+
export declare function getGeoLocation(this: XCUITestDriver): Promise<LocationWithAltitude>;
|
|
20
22
|
/**
|
|
21
23
|
* Set location of the device under test.
|
|
22
24
|
*
|
|
23
25
|
* iOS 17+ real device environment will be via "mobile:setSimulatedLocation" as
|
|
24
26
|
* setting simulated location for XCTest session.
|
|
25
27
|
*
|
|
26
|
-
* @param
|
|
27
|
-
* @this {XCUITestDriver}
|
|
28
|
+
* @param location - Location with latitude and longitude
|
|
28
29
|
*/
|
|
29
|
-
export function setGeoLocation(this:
|
|
30
|
+
export declare function setGeoLocation(this: XCUITestDriver, location: Partial<Location>): Promise<Location>;
|
|
30
31
|
/**
|
|
31
32
|
* Reset the location service on real device.
|
|
32
33
|
*
|
|
33
34
|
* @throws {Error} If the device is simulator and iOS version is below 17,
|
|
34
35
|
* or 'resetLocation' raises an error.
|
|
35
|
-
* @this {XCUITestDriver}
|
|
36
36
|
*/
|
|
37
|
-
export function mobileResetLocationService(this:
|
|
38
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
39
|
-
export type WDALocationInfo = import("./types").WDALocationInfo;
|
|
40
|
-
export type Location = import("@appium/types").Location;
|
|
37
|
+
export declare function mobileResetLocationService(this: XCUITestDriver): Promise<void>;
|
|
41
38
|
//# sourceMappingURL=location.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../lib/commands/location.
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../lib/commands/location.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AAGnE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkCxF;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAC1B,OAAO,CAAC,QAAQ,CAAC,CA6BnB;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBpF"}
|
|
@@ -21,10 +21,9 @@ const utils_1 = require("../utils");
|
|
|
21
21
|
* "mobile:getSimulatedLocation" if the simulated location has been previously set
|
|
22
22
|
* "mobile:setSimulatedLocation" already.
|
|
23
23
|
*
|
|
24
|
-
* @returns
|
|
24
|
+
* @returns Location with altitude
|
|
25
25
|
* @throws {Error} If the device under test returns an error message.
|
|
26
26
|
* i.e.: tvOS returns unsupported error
|
|
27
|
-
* @this {XCUITestDriver}
|
|
28
27
|
*/
|
|
29
28
|
async function getGeoLocation() {
|
|
30
29
|
// Currently we proxy the setGeoLocation to mobile:setSimulatedLocation for iOS 17+.
|
|
@@ -43,7 +42,7 @@ async function getGeoLocation() {
|
|
|
43
42
|
// '/wda/device/location' returns current device location information,
|
|
44
43
|
// but '/wda/simulatedLocation' returns `null` values until the WDA process
|
|
45
44
|
// sets a simulated location. After setting the value, both returns the same values.
|
|
46
|
-
const { authorizationStatus, latitude, longitude, altitude } =
|
|
45
|
+
const { authorizationStatus, latitude, longitude, altitude } = await this.proxyCommand('/wda/device/location', 'GET');
|
|
47
46
|
// '3' is 'Always' in the privacy
|
|
48
47
|
// https://developer.apple.com/documentation/corelocation/clauthorizationstatus
|
|
49
48
|
if (authorizationStatus !== enum_1.AuthorizationStatus.authorizedAlways) {
|
|
@@ -61,17 +60,16 @@ async function getGeoLocation() {
|
|
|
61
60
|
* iOS 17+ real device environment will be via "mobile:setSimulatedLocation" as
|
|
62
61
|
* setting simulated location for XCTest session.
|
|
63
62
|
*
|
|
64
|
-
* @param
|
|
65
|
-
* @this {XCUITestDriver}
|
|
63
|
+
* @param location - Location with latitude and longitude
|
|
66
64
|
*/
|
|
67
65
|
async function setGeoLocation(location) {
|
|
68
|
-
|
|
66
|
+
const { latitude, longitude } = location;
|
|
69
67
|
if (!support_1.util.hasValue(latitude) || !support_1.util.hasValue(longitude)) {
|
|
70
68
|
throw new driver_1.errors.InvalidArgumentError(`Both latitude and longitude should be set`);
|
|
71
69
|
}
|
|
72
70
|
if (this.isSimulator()) {
|
|
73
|
-
await
|
|
74
|
-
return
|
|
71
|
+
await this.device.setGeolocation(`${latitude}`, `${longitude}`);
|
|
72
|
+
return { latitude, longitude, altitude: 0 };
|
|
75
73
|
}
|
|
76
74
|
if ((0, utils_1.isIos17OrNewer)(this.opts)) {
|
|
77
75
|
this.log.info(`Proxying to mobile:setSimulatedLocation method for iOS 17+`);
|
|
@@ -89,14 +87,13 @@ async function setGeoLocation(location) {
|
|
|
89
87
|
service.close();
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
|
-
return
|
|
90
|
+
return { latitude, longitude, altitude: 0 };
|
|
93
91
|
}
|
|
94
92
|
/**
|
|
95
93
|
* Reset the location service on real device.
|
|
96
94
|
*
|
|
97
95
|
* @throws {Error} If the device is simulator and iOS version is below 17,
|
|
98
96
|
* or 'resetLocation' raises an error.
|
|
99
|
-
* @this {XCUITestDriver}
|
|
100
97
|
*/
|
|
101
98
|
async function mobileResetLocationService() {
|
|
102
99
|
if ((0, utils_1.isIos17OrNewer)(this.opts)) {
|
|
@@ -119,9 +116,4 @@ async function mobileResetLocationService() {
|
|
|
119
116
|
service.close();
|
|
120
117
|
}
|
|
121
118
|
}
|
|
122
|
-
/**
|
|
123
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
124
|
-
* @typedef {import('./types').WDALocationInfo} WDALocationInfo
|
|
125
|
-
* @typedef {import('@appium/types').Location} Location
|
|
126
|
-
*/
|
|
127
119
|
//# sourceMappingURL=location.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../lib/commands/location.
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../lib/commands/location.ts"],"names":[],"mappings":";;AA2BA,wCAkCC;AAUD,wCAgCC;AAQD,gEAsBC;AArID,yDAA2C;AAC3C,0CAAqC;AACrC,4CAAoC;AACpC,iCAA2C;AAC3C,oCAA0C;AAM1C;;;;;;;;;;;;;;;;GAgBG;AACI,KAAK,UAAU,cAAc;IAClC,oFAAoF;IACpF,mFAAmF;IACnF,IAAI,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,MAAM,EAAC,QAAQ,EAAE,SAAS,EAAC,GAAG,MAAM,IAAI,CAAC,0BAA0B,EAAE,CAAC;QACtE,IAAI,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yFAAyF;gBACtG,qEAAqE,CAAC,CAAC;YACzE,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAC,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC,GAAG,C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AAC,kBAAkB,CAC/B,yDAAyD,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK;YAC1E,mBAAmB,GAAG,CAAC,OAAO,EAAE,CACnC,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Lock the device (and optionally unlock the device after a certain amount of time)
|
|
3
4
|
*
|
|
4
|
-
* @param
|
|
5
|
+
* @param seconds - The number of seconds after which to unlock the device. Set to `0` or leave empty to require manual unlock (do not automatically unlock).
|
|
5
6
|
* @defaultValue 0
|
|
6
|
-
* @this {XCUITestDriver}
|
|
7
7
|
*/
|
|
8
|
-
export function lock(this:
|
|
8
|
+
export declare function lock(this: XCUITestDriver, seconds?: number | string): Promise<void>;
|
|
9
9
|
/**
|
|
10
10
|
* Unlock the device
|
|
11
|
-
*
|
|
12
|
-
* @this {XCUITestDriver}
|
|
13
11
|
*/
|
|
14
|
-
export function unlock(this:
|
|
12
|
+
export declare function unlock(this: XCUITestDriver): Promise<void>;
|
|
15
13
|
/**
|
|
16
14
|
* Determine whether the device is locked
|
|
17
15
|
*
|
|
18
|
-
* @
|
|
19
|
-
* @returns {Promise<boolean>} `true` if the device is locked, `false` otherwise
|
|
16
|
+
* @returns `true` if the device is locked, `false` otherwise
|
|
20
17
|
*/
|
|
21
|
-
export function isLocked(this:
|
|
22
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
18
|
+
export declare function isLocked(this: XCUITestDriver): Promise<boolean>;
|
|
23
19
|
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/commands/lock.
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/commands/lock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;;GAKG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,cAAc,EACpB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAErE"}
|
|
@@ -10,9 +10,8 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
|
10
10
|
/**
|
|
11
11
|
* Lock the device (and optionally unlock the device after a certain amount of time)
|
|
12
12
|
*
|
|
13
|
-
* @param
|
|
13
|
+
* @param seconds - The number of seconds after which to unlock the device. Set to `0` or leave empty to require manual unlock (do not automatically unlock).
|
|
14
14
|
* @defaultValue 0
|
|
15
|
-
* @this {XCUITestDriver}
|
|
16
15
|
*/
|
|
17
16
|
async function lock(seconds) {
|
|
18
17
|
await this.proxyCommand('/wda/lock', 'POST');
|
|
@@ -28,8 +27,6 @@ async function lock(seconds) {
|
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Unlock the device
|
|
31
|
-
*
|
|
32
|
-
* @this {XCUITestDriver}
|
|
33
30
|
*/
|
|
34
31
|
async function unlock() {
|
|
35
32
|
await this.proxyCommand('/wda/unlock', 'POST');
|
|
@@ -37,13 +34,9 @@ async function unlock() {
|
|
|
37
34
|
/**
|
|
38
35
|
* Determine whether the device is locked
|
|
39
36
|
*
|
|
40
|
-
* @
|
|
41
|
-
* @returns {Promise<boolean>} `true` if the device is locked, `false` otherwise
|
|
37
|
+
* @returns `true` if the device is locked, `false` otherwise
|
|
42
38
|
*/
|
|
43
39
|
async function isLocked() {
|
|
44
|
-
return
|
|
40
|
+
return await this.proxyCommand('/wda/locked', 'GET');
|
|
45
41
|
}
|
|
46
|
-
/**
|
|
47
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
48
|
-
*/
|
|
49
42
|
//# sourceMappingURL=lock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../lib/commands/lock.
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../lib/commands/lock.ts"],"names":[],"mappings":";;;;;AASA,oBAgBC;AAKD,wBAEC;AAOD,4BAEC;AAzCD,wDAAyB;AAGzB;;;;;GAKG;AACI,KAAK,UAAU,IAAI,CAExB,OAAyB;IAEzB,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO;IACT,CAAC;IAED,MAAM,kBAAC,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACnC,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,MAAM;IAC1B,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,QAAQ;IAC5B,OAAO,MAAM,IAAI,CAAC,YAAY,CAAe,aAAa,EAAE,KAAK,CAAC,CAAC;AACrE,CAAC"}
|