@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
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import {util} from 'appium/support';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Set the device's UI appearance style
|
|
6
|
-
*
|
|
7
|
-
* @since iOS 12.0
|
|
8
|
-
* @param {'dark'|'light'} style - The appearance style to set
|
|
9
|
-
* @throws {Error} if the current platform does not support UI appearance changes
|
|
10
|
-
* @this {XCUITestDriver}
|
|
11
|
-
*/
|
|
12
|
-
export async function mobileSetAppearance(style) {
|
|
13
|
-
if (!['light', 'dark'].includes(_.toLower(style))) {
|
|
14
|
-
throw new Error(`The 'style' value is expected to equal either 'light' or 'dark'`);
|
|
15
|
-
}
|
|
16
|
-
if (util.compareVersions(/** @type {string} */ (this.opts.platformVersion), '<', '12.0')) {
|
|
17
|
-
throw new Error('Changing appearance is only supported since iOS 12');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (this.isSimulator()) {
|
|
21
|
-
try {
|
|
22
|
-
return void (await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).setAppearance(style));
|
|
23
|
-
} catch (e) {
|
|
24
|
-
this.log.debug(e.stack);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
return void (await this.proxyCommand('/wda/device/appearance', 'POST', {name: style}, false));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
this.log.debug(e.stack);
|
|
31
|
-
}
|
|
32
|
-
// Fall back to the ugly Siri workaround if the current SDK is too old
|
|
33
|
-
await this.mobileSiriCommand(`Turn ${_.toLower(style) === 'dark' ? 'on' : 'off'} dark mode`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Get the device's UI appearance style.
|
|
38
|
-
*
|
|
39
|
-
* @since Xcode SDK 11
|
|
40
|
-
* @returns {Promise<{style: Style}>}
|
|
41
|
-
* @this {XCUITestDriver}
|
|
42
|
-
*/
|
|
43
|
-
export async function mobileGetAppearance() {
|
|
44
|
-
if (util.compareVersions(/** @type {string} */ (this.opts.platformVersion), '<', '12.0')) {
|
|
45
|
-
return {style: 'unsupported'};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** @type {Style|undefined} */
|
|
49
|
-
let style;
|
|
50
|
-
if (this.isSimulator()) {
|
|
51
|
-
try {
|
|
52
|
-
style = /** @type {Style} */ (
|
|
53
|
-
await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).getAppearance()
|
|
54
|
-
);
|
|
55
|
-
} catch {}
|
|
56
|
-
}
|
|
57
|
-
if (!style) {
|
|
58
|
-
style = /** @type {Style} */ (
|
|
59
|
-
/** @type {any} */ (await this.proxyCommand('/wda/device/info', 'GET'))
|
|
60
|
-
?.userInterfaceStyle ?? 'unknown'
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
style,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
70
|
-
* @typedef {import('./types').Style} Style
|
|
71
|
-
*/
|
package/lib/commands/audit.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} AccessibilityAuditItem
|
|
3
|
-
* @property {string} detailedDescription The detailed description of the found accessibility issue.
|
|
4
|
-
* @property {string} compactDescription The compact description of the found accessibility issue.
|
|
5
|
-
* @property {string|number} auditType The name of the audit type this issue belongs to. Could be
|
|
6
|
-
* a number if the type name is unknown.
|
|
7
|
-
* @property {string} element The description of the element this issue was found for.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Performs accessibility audit of the current application according to the given type or multiple types.
|
|
12
|
-
*
|
|
13
|
-
* @since Xcode 15/iOS 17
|
|
14
|
-
* @param {string[]?} auditTypes - One or more type names to perform the audit for.
|
|
15
|
-
* The full list of available names could be found at
|
|
16
|
-
* https://developer.apple.com/documentation/xctest/xcuiaccessibilityaudittype?language=objc
|
|
17
|
-
* If no type if provided explicitly then XCUIAccessibilityAuditTypeAll is assumed.
|
|
18
|
-
*
|
|
19
|
-
* @returns {Promise<AccessibilityAuditItem[]>} List of found issues or an empty list
|
|
20
|
-
*
|
|
21
|
-
* @this {XCUITestDriver}
|
|
22
|
-
*/
|
|
23
|
-
export async function mobilePerformAccessibilityAudit(auditTypes) {
|
|
24
|
-
return /** @type {AccessibilityAuditItem[]} */ (
|
|
25
|
-
await this.proxyCommand('/wda/performAccessibilityAudit', 'POST', {auditTypes})
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
31
|
-
*/
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {assertSimulator as _assertSimulator} from '../utils';
|
|
2
|
-
|
|
3
|
-
const assertSimulator = (driver) => _assertSimulator.call(driver, 'Biometric enrollment');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Enrolls biometric authentication on a simulated device.
|
|
7
|
-
*
|
|
8
|
-
* @param {boolean} isEnabled - Whether to enable/disable biometric enrollment.
|
|
9
|
-
* @throws {Error} If enrollment fails or the device is not a Simulator.
|
|
10
|
-
* @group Simulator Only
|
|
11
|
-
* @this {XCUITestDriver}
|
|
12
|
-
*/
|
|
13
|
-
export async function mobileEnrollBiometric(isEnabled = true) {
|
|
14
|
-
assertSimulator(this);
|
|
15
|
-
|
|
16
|
-
await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).enrollBiometric(isEnabled);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Emulates biometric match or non-match event on a simulated device.
|
|
21
|
-
*
|
|
22
|
-
* The biometric feature is expected to be already enrolled via {@linkcode mobileEnrollBiometric|mobile: enrollBiometric} before executing this.
|
|
23
|
-
*
|
|
24
|
-
* @param {import('./types').BiometricFeature} type - The biometric feature name.
|
|
25
|
-
* @param {boolean} match - If `true`, simulate biometic match. If `false`, simulate biometric non-match.
|
|
26
|
-
* @throws {Error} If matching fails or the device is not a Simulator.
|
|
27
|
-
* @group Simulator Only
|
|
28
|
-
* @this {XCUITestDriver}
|
|
29
|
-
*/
|
|
30
|
-
export async function mobileSendBiometricMatch(type = 'touchId', match = true) {
|
|
31
|
-
assertSimulator(this);
|
|
32
|
-
|
|
33
|
-
await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).sendBiometricMatch(match, type);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Checks whether the biometric feature is currently enrolled on a simulated device.
|
|
38
|
-
*
|
|
39
|
-
* @returns {Promise<boolean>} `true` if biometric is enrolled.
|
|
40
|
-
* @throws {Error} If the detection fails or the device is not a Simulator.
|
|
41
|
-
* @group Simulator Only
|
|
42
|
-
* @this {XCUITestDriver}
|
|
43
|
-
*/
|
|
44
|
-
export async function mobileIsBiometricEnrolled() {
|
|
45
|
-
assertSimulator(this);
|
|
46
|
-
|
|
47
|
-
return await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).isBiometricEnrolled();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
52
|
-
*/
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sets the primary clipboard's content on the device under test.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} content - The content to be set as base64 encoded string.
|
|
5
|
-
* @param {string} [contentType=plaintext] - The type of the content to set.
|
|
6
|
-
* Only `plaintext`, 'image and 'url' are supported.
|
|
7
|
-
* @this {XCUITestDriver}
|
|
8
|
-
*/
|
|
9
|
-
export async function setClipboard(content, contentType) {
|
|
10
|
-
await this.proxyCommand('/wda/setPasteboard', 'POST', {
|
|
11
|
-
content,
|
|
12
|
-
contentType,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Gets the content of the primary clipboard on the device under test.
|
|
18
|
-
*
|
|
19
|
-
* @param {string} [contentType=plaintext] - The type of the content to get.
|
|
20
|
-
* Only `plaintext`, 'image and 'url' are supported.
|
|
21
|
-
* @returns {Promise<string>} The actual clipboard content encoded into base64 string.
|
|
22
|
-
* An empty string is returned if the clipboard contains no data.
|
|
23
|
-
* @this {XCUITestDriver}
|
|
24
|
-
*/
|
|
25
|
-
export async function getClipboard(contentType) {
|
|
26
|
-
return /** @type {string} */ (
|
|
27
|
-
await this.proxyCommand('/wda/getPasteboard', 'POST', {
|
|
28
|
-
contentType,
|
|
29
|
-
})
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
35
|
-
*/
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import {assertSimulator as _assertSimulator} from '../utils';
|
|
3
|
-
import { errors } from 'appium/driver';
|
|
4
|
-
|
|
5
|
-
const assertSimulator = (driver) => _assertSimulator.call(driver, 'Content size ui command');
|
|
6
|
-
|
|
7
|
-
const CONTENT_SIZE = [
|
|
8
|
-
'extra-small',
|
|
9
|
-
'small',
|
|
10
|
-
'medium',
|
|
11
|
-
'large',
|
|
12
|
-
'extra-large',
|
|
13
|
-
'extra-extra-large',
|
|
14
|
-
'extra-extra-extra-large',
|
|
15
|
-
'accessibility-medium',
|
|
16
|
-
'accessibility-large',
|
|
17
|
-
'accessibility-extra-large',
|
|
18
|
-
'accessibility-extra-extra-large',
|
|
19
|
-
'accessibility-extra-extra-extra-large',
|
|
20
|
-
'increment',
|
|
21
|
-
'decrement'
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Sets content size for the given simulator.
|
|
26
|
-
*
|
|
27
|
-
* @since Xcode 15 (but lower xcode could have this command)
|
|
28
|
-
* @param {ContentSizeAction} size - The content size action to set. Acceptable value is
|
|
29
|
-
* extra-small, small, medium, large, extra-large, extra-extra-large,
|
|
30
|
-
* extra-extra-extra-large, accessibility-medium, accessibility-large,
|
|
31
|
-
* accessibility-extra-large, accessibility-extra-extra-large,
|
|
32
|
-
* accessibility-extra-extra-extra-large with Xcode 16.2.
|
|
33
|
-
* @throws {Error} if the current platform does not support content size appearance changes
|
|
34
|
-
* @this {XCUITestDriver}
|
|
35
|
-
*/
|
|
36
|
-
export async function mobileSetContentSize(size) {
|
|
37
|
-
const simulator = assertSimulator(this);
|
|
38
|
-
|
|
39
|
-
if (!CONTENT_SIZE.includes(_.lowerCase(size))) {
|
|
40
|
-
throw new errors.InvalidArgumentError(
|
|
41
|
-
`The 'size' value is expected to be one of ${CONTENT_SIZE.join(',')}`
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
await simulator.setContentSize(size);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Retrieves the current content size value from the given simulator.
|
|
50
|
-
*
|
|
51
|
-
* @since Xcode 15 (but lower xcode could have this command)
|
|
52
|
-
* @returns {Promise<ContentSizeResult>} the content size value. Possible return value is
|
|
53
|
-
* extra-small, small, medium, large, extra-large, extra-extra-large,
|
|
54
|
-
* extra-extra-extra-large, accessibility-medium, accessibility-large,
|
|
55
|
-
* accessibility-extra-large, accessibility-extra-extra-large,
|
|
56
|
-
* accessibility-extra-extra-extra-large,
|
|
57
|
-
* unknown or unsupported with Xcode 16.2.
|
|
58
|
-
* @this {XCUITestDriver}
|
|
59
|
-
*/
|
|
60
|
-
export async function mobileGetContentSize() {
|
|
61
|
-
return /** @type {ContentSizeResult} */ (await assertSimulator(this).getContentSize());
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
66
|
-
* @typedef {import('./types').ContentSizeAction} ContentSizeAction
|
|
67
|
-
* @typedef {import('./types').ContentSizeResult} ContentSizeResult
|
|
68
|
-
*/
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {utilities} from 'appium-ios-device';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the miscellaneous information about the device under test.
|
|
5
|
-
*
|
|
6
|
-
* Since XCUITest driver v4.2.0, this includes device information via lockdown in a real device.
|
|
7
|
-
*
|
|
8
|
-
* @returns {Promise<DeviceInfo | (DeviceInfo & LockdownInfo)>} The response of `/wda/device/info'`
|
|
9
|
-
* @this {import('../driver').XCUITestDriver}
|
|
10
|
-
*/
|
|
11
|
-
export async function mobileGetDeviceInfo() {
|
|
12
|
-
const infoByWda = /** @type {import('./types').DeviceInfo} */ (
|
|
13
|
-
await this.proxyCommand('/wda/device/info', 'GET')
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
if (this.isRealDevice()) {
|
|
17
|
-
const lockdownInfo = await utilities.getDeviceInfo(this.device.udid);
|
|
18
|
-
return {...infoByWda, ...{lockdownInfo}};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return infoByWda;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @typedef {import('./types').DeviceInfo} DeviceInfo
|
|
26
|
-
* @typedef {import('./types').LockdownInfo} LockdownInfo
|
|
27
|
-
*/
|