@limrun/appium-xcuitest-driver 10.4.3-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 +2600 -0
- package/LICENSE +201 -0
- package/README.md +55 -0
- package/build/index.d.ts +5 -0
- package/build/index.js +41 -0
- package/build/lib/app-infos-cache.d.ts +62 -0
- package/build/lib/app-infos-cache.d.ts.map +1 -0
- package/build/lib/app-infos-cache.js +180 -0
- package/build/lib/app-infos-cache.js.map +1 -0
- package/build/lib/app-utils.d.ts +89 -0
- package/build/lib/app-utils.d.ts.map +1 -0
- package/build/lib/app-utils.js +657 -0
- package/build/lib/app-utils.js.map +1 -0
- package/build/lib/commands/active-app-info.d.ts +9 -0
- package/build/lib/commands/active-app-info.d.ts.map +1 -0
- package/build/lib/commands/active-app-info.js +14 -0
- package/build/lib/commands/active-app-info.js.map +1 -0
- package/build/lib/commands/advanced-battery-types.d.ts +444 -0
- package/build/lib/commands/advanced-battery-types.d.ts.map +1 -0
- package/build/lib/commands/advanced-battery-types.js +8 -0
- package/build/lib/commands/advanced-battery-types.js.map +1 -0
- package/build/lib/commands/alert.d.ts +45 -0
- package/build/lib/commands/alert.d.ts.map +1 -0
- package/build/lib/commands/alert.js +87 -0
- package/build/lib/commands/alert.js.map +1 -0
- package/build/lib/commands/app-management.d.ts +153 -0
- package/build/lib/commands/app-management.d.ts.map +1 -0
- package/build/lib/commands/app-management.js +323 -0
- package/build/lib/commands/app-management.js.map +1 -0
- package/build/lib/commands/app-strings.d.ts +16 -0
- package/build/lib/commands/app-strings.d.ts.map +1 -0
- package/build/lib/commands/app-strings.js +30 -0
- package/build/lib/commands/app-strings.js.map +1 -0
- package/build/lib/commands/appearance.d.ts +22 -0
- package/build/lib/commands/appearance.d.ts.map +1 -0
- package/build/lib/commands/appearance.js +74 -0
- package/build/lib/commands/appearance.js.map +1 -0
- package/build/lib/commands/audit.d.ts +43 -0
- package/build/lib/commands/audit.d.ts.map +1 -0
- package/build/lib/commands/audit.js +31 -0
- package/build/lib/commands/audit.js.map +1 -0
- package/build/lib/commands/battery.d.ts +13 -0
- package/build/lib/commands/battery.d.ts.map +1 -0
- package/build/lib/commands/battery.js +49 -0
- package/build/lib/commands/battery.js.map +1 -0
- package/build/lib/commands/bidi/constants.d.ts +6 -0
- package/build/lib/commands/bidi/constants.d.ts.map +1 -0
- package/build/lib/commands/bidi/constants.js +10 -0
- package/build/lib/commands/bidi/constants.js.map +1 -0
- package/build/lib/commands/bidi/models.d.ts +9 -0
- package/build/lib/commands/bidi/models.d.ts.map +1 -0
- package/build/lib/commands/bidi/models.js +54 -0
- package/build/lib/commands/bidi/models.js.map +1 -0
- package/build/lib/commands/bidi/types.d.ts +26 -0
- package/build/lib/commands/bidi/types.d.ts.map +1 -0
- package/build/lib/commands/bidi/types.js +4 -0
- package/build/lib/commands/bidi/types.js.map +1 -0
- package/build/lib/commands/biometric.d.ts +32 -0
- package/build/lib/commands/biometric.d.ts.map +1 -0
- package/build/lib/commands/biometric.js +54 -0
- package/build/lib/commands/biometric.js.map +1 -0
- package/build/lib/commands/certificate.d.ts +50 -0
- package/build/lib/commands/certificate.d.ts.map +1 -0
- package/build/lib/commands/certificate.js +454 -0
- package/build/lib/commands/certificate.js.map +1 -0
- package/build/lib/commands/clipboard.d.ts +21 -0
- package/build/lib/commands/clipboard.d.ts.map +1 -0
- package/build/lib/commands/clipboard.js +36 -0
- package/build/lib/commands/clipboard.js.map +1 -0
- package/build/lib/commands/condition.d.ts +102 -0
- package/build/lib/commands/condition.d.ts.map +1 -0
- package/build/lib/commands/condition.js +146 -0
- package/build/lib/commands/condition.js.map +1 -0
- package/build/lib/commands/content-size.d.ts +30 -0
- package/build/lib/commands/content-size.d.ts.map +1 -0
- package/build/lib/commands/content-size.js +67 -0
- package/build/lib/commands/content-size.js.map +1 -0
- package/build/lib/commands/context.d.ts +191 -0
- package/build/lib/commands/context.d.ts.map +1 -0
- package/build/lib/commands/context.js +625 -0
- package/build/lib/commands/context.js.map +1 -0
- package/build/lib/commands/deviceInfo.d.ts +12 -0
- package/build/lib/commands/deviceInfo.d.ts.map +1 -0
- package/build/lib/commands/deviceInfo.js +25 -0
- package/build/lib/commands/deviceInfo.js.map +1 -0
- package/build/lib/commands/element.d.ts +108 -0
- package/build/lib/commands/element.d.ts.map +1 -0
- package/build/lib/commands/element.js +395 -0
- package/build/lib/commands/element.js.map +1 -0
- package/build/lib/commands/enum.d.ts +105 -0
- package/build/lib/commands/enum.d.ts.map +1 -0
- package/build/lib/commands/enum.js +113 -0
- package/build/lib/commands/enum.js.map +1 -0
- package/build/lib/commands/execute.d.ts +33 -0
- package/build/lib/commands/execute.d.ts.map +1 -0
- package/build/lib/commands/execute.js +142 -0
- package/build/lib/commands/execute.js.map +1 -0
- package/build/lib/commands/file-movement.d.ts +90 -0
- package/build/lib/commands/file-movement.d.ts.map +1 -0
- package/build/lib/commands/file-movement.js +477 -0
- package/build/lib/commands/file-movement.js.map +1 -0
- package/build/lib/commands/find.d.ts +21 -0
- package/build/lib/commands/find.d.ts.map +1 -0
- package/build/lib/commands/find.js +199 -0
- package/build/lib/commands/find.js.map +1 -0
- package/build/lib/commands/general.d.ts +137 -0
- package/build/lib/commands/general.d.ts.map +1 -0
- package/build/lib/commands/general.js +270 -0
- package/build/lib/commands/general.js.map +1 -0
- package/build/lib/commands/geolocation.d.ts +57 -0
- package/build/lib/commands/geolocation.d.ts.map +1 -0
- package/build/lib/commands/geolocation.js +58 -0
- package/build/lib/commands/geolocation.js.map +1 -0
- package/build/lib/commands/gesture.d.ts +283 -0
- package/build/lib/commands/gesture.d.ts.map +1 -0
- package/build/lib/commands/gesture.js +565 -0
- package/build/lib/commands/gesture.js.map +1 -0
- package/build/lib/commands/hid-event.d.ts +2773 -0
- package/build/lib/commands/hid-event.d.ts.map +1 -0
- package/build/lib/commands/hid-event.js +1633 -0
- package/build/lib/commands/hid-event.js.map +1 -0
- package/build/lib/commands/increase-contrast.d.ts +24 -0
- package/build/lib/commands/increase-contrast.d.ts.map +1 -0
- package/build/lib/commands/increase-contrast.js +49 -0
- package/build/lib/commands/increase-contrast.js.map +1 -0
- package/build/lib/commands/iohid.d.ts +1372 -0
- package/build/lib/commands/iohid.d.ts.map +1 -0
- package/build/lib/commands/iohid.js +63 -0
- package/build/lib/commands/iohid.js.map +1 -0
- package/build/lib/commands/keyboard.d.ts +32 -0
- package/build/lib/commands/keyboard.d.ts.map +1 -0
- package/build/lib/commands/keyboard.js +67 -0
- package/build/lib/commands/keyboard.js.map +1 -0
- package/build/lib/commands/keychains.d.ts +10 -0
- package/build/lib/commands/keychains.d.ts.map +1 -0
- package/build/lib/commands/keychains.js +22 -0
- package/build/lib/commands/keychains.js.map +1 -0
- package/build/lib/commands/localization.d.ts +17 -0
- package/build/lib/commands/localization.d.ts.map +1 -0
- package/build/lib/commands/localization.js +34 -0
- package/build/lib/commands/localization.js.map +1 -0
- package/build/lib/commands/location.d.ts +40 -0
- package/build/lib/commands/location.d.ts.map +1 -0
- package/build/lib/commands/location.js +121 -0
- package/build/lib/commands/location.js.map +1 -0
- package/build/lib/commands/lock.d.ts +23 -0
- package/build/lib/commands/lock.d.ts.map +1 -0
- package/build/lib/commands/lock.js +49 -0
- package/build/lib/commands/lock.js.map +1 -0
- package/build/lib/commands/log.d.ts +68 -0
- package/build/lib/commands/log.d.ts.map +1 -0
- package/build/lib/commands/log.js +287 -0
- package/build/lib/commands/log.js.map +1 -0
- package/build/lib/commands/memory.d.ts +11 -0
- package/build/lib/commands/memory.d.ts.map +1 -0
- package/build/lib/commands/memory.js +49 -0
- package/build/lib/commands/memory.js.map +1 -0
- package/build/lib/commands/navigation.d.ts +44 -0
- package/build/lib/commands/navigation.d.ts.map +1 -0
- package/build/lib/commands/navigation.js +121 -0
- package/build/lib/commands/navigation.js.map +1 -0
- package/build/lib/commands/notifications.d.ts +28 -0
- package/build/lib/commands/notifications.d.ts.map +1 -0
- package/build/lib/commands/notifications.js +64 -0
- package/build/lib/commands/notifications.js.map +1 -0
- package/build/lib/commands/pasteboard.d.ts +23 -0
- package/build/lib/commands/pasteboard.d.ts.map +1 -0
- package/build/lib/commands/pasteboard.js +43 -0
- package/build/lib/commands/pasteboard.js.map +1 -0
- package/build/lib/commands/pcap.d.ts +54 -0
- package/build/lib/commands/pcap.d.ts.map +1 -0
- package/build/lib/commands/pcap.js +149 -0
- package/build/lib/commands/pcap.js.map +1 -0
- package/build/lib/commands/performance.d.ts +85 -0
- package/build/lib/commands/performance.d.ts.map +1 -0
- package/build/lib/commands/performance.js +331 -0
- package/build/lib/commands/performance.js.map +1 -0
- package/build/lib/commands/permissions.d.ts +36 -0
- package/build/lib/commands/permissions.d.ts.map +1 -0
- package/build/lib/commands/permissions.js +80 -0
- package/build/lib/commands/permissions.js.map +1 -0
- package/build/lib/commands/proxy-helper.d.ts +15 -0
- package/build/lib/commands/proxy-helper.d.ts.map +1 -0
- package/build/lib/commands/proxy-helper.js +117 -0
- package/build/lib/commands/proxy-helper.js.map +1 -0
- package/build/lib/commands/record-audio.d.ts +69 -0
- package/build/lib/commands/record-audio.d.ts.map +1 -0
- package/build/lib/commands/record-audio.js +228 -0
- package/build/lib/commands/record-audio.js.map +1 -0
- package/build/lib/commands/recordscreen.d.ts +89 -0
- package/build/lib/commands/recordscreen.d.ts.map +1 -0
- package/build/lib/commands/recordscreen.js +326 -0
- package/build/lib/commands/recordscreen.js.map +1 -0
- package/build/lib/commands/screenshots.d.ts +16 -0
- package/build/lib/commands/screenshots.d.ts.map +1 -0
- package/build/lib/commands/screenshots.js +129 -0
- package/build/lib/commands/screenshots.js.map +1 -0
- package/build/lib/commands/simctl.d.ts +27 -0
- package/build/lib/commands/simctl.d.ts.map +1 -0
- package/build/lib/commands/simctl.js +65 -0
- package/build/lib/commands/simctl.js.map +1 -0
- package/build/lib/commands/source.d.ts +16 -0
- package/build/lib/commands/source.d.ts.map +1 -0
- package/build/lib/commands/source.js +128 -0
- package/build/lib/commands/source.js.map +1 -0
- package/build/lib/commands/timeouts.d.ts +53 -0
- package/build/lib/commands/timeouts.d.ts.map +1 -0
- package/build/lib/commands/timeouts.js +71 -0
- package/build/lib/commands/timeouts.js.map +1 -0
- package/build/lib/commands/types.d.ts +539 -0
- package/build/lib/commands/types.d.ts.map +1 -0
- package/build/lib/commands/types.js +3 -0
- package/build/lib/commands/types.js.map +1 -0
- package/build/lib/commands/web.d.ts +297 -0
- package/build/lib/commands/web.d.ts.map +1 -0
- package/build/lib/commands/web.js +1029 -0
- package/build/lib/commands/web.js.map +1 -0
- package/build/lib/commands/xctest-record-screen.d.ts +92 -0
- package/build/lib/commands/xctest-record-screen.d.ts.map +1 -0
- package/build/lib/commands/xctest-record-screen.js +193 -0
- package/build/lib/commands/xctest-record-screen.js.map +1 -0
- package/build/lib/commands/xctest.d.ts +71 -0
- package/build/lib/commands/xctest.d.ts.map +1 -0
- package/build/lib/commands/xctest.js +257 -0
- package/build/lib/commands/xctest.js.map +1 -0
- package/build/lib/css-converter.d.ts +10 -0
- package/build/lib/css-converter.d.ts.map +1 -0
- package/build/lib/css-converter.js +258 -0
- package/build/lib/css-converter.js.map +1 -0
- package/build/lib/desired-caps.d.ts +506 -0
- package/build/lib/desired-caps.d.ts.map +1 -0
- package/build/lib/desired-caps.js +400 -0
- package/build/lib/desired-caps.js.map +1 -0
- package/build/lib/device-connections-factory.d.ts +13 -0
- package/build/lib/device-connections-factory.d.ts.map +1 -0
- package/build/lib/device-connections-factory.js +244 -0
- package/build/lib/device-connections-factory.js.map +1 -0
- package/build/lib/device-log/helpers.d.ts +10 -0
- package/build/lib/device-log/helpers.d.ts.map +1 -0
- package/build/lib/device-log/helpers.js +37 -0
- package/build/lib/device-log/helpers.js.map +1 -0
- package/build/lib/device-log/ios-crash-log.d.ts +34 -0
- package/build/lib/device-log/ios-crash-log.d.ts.map +1 -0
- package/build/lib/device-log/ios-crash-log.js +141 -0
- package/build/lib/device-log/ios-crash-log.js.map +1 -0
- package/build/lib/device-log/ios-device-log.d.ts +19 -0
- package/build/lib/device-log/ios-device-log.d.ts.map +1 -0
- package/build/lib/device-log/ios-device-log.js +42 -0
- package/build/lib/device-log/ios-device-log.js.map +1 -0
- package/build/lib/device-log/ios-log.d.ts +24 -0
- package/build/lib/device-log/ios-log.d.ts.map +1 -0
- package/build/lib/device-log/ios-log.js +50 -0
- package/build/lib/device-log/ios-log.js.map +1 -0
- package/build/lib/device-log/ios-performance-log.d.ts +18 -0
- package/build/lib/device-log/ios-performance-log.d.ts.map +1 -0
- package/build/lib/device-log/ios-performance-log.js +43 -0
- package/build/lib/device-log/ios-performance-log.js.map +1 -0
- package/build/lib/device-log/ios-simulator-log.d.ts +38 -0
- package/build/lib/device-log/ios-simulator-log.d.ts.map +1 -0
- package/build/lib/device-log/ios-simulator-log.js +184 -0
- package/build/lib/device-log/ios-simulator-log.js.map +1 -0
- package/build/lib/device-log/line-consuming-log.d.ts +9 -0
- package/build/lib/device-log/line-consuming-log.d.ts.map +1 -0
- package/build/lib/device-log/line-consuming-log.js +16 -0
- package/build/lib/device-log/line-consuming-log.js.map +1 -0
- package/build/lib/device-log/safari-console-log.d.ts +67 -0
- package/build/lib/device-log/safari-console-log.d.ts.map +1 -0
- package/build/lib/device-log/safari-console-log.js +81 -0
- package/build/lib/device-log/safari-console-log.js.map +1 -0
- package/build/lib/device-log/safari-network-log.d.ts +75 -0
- package/build/lib/device-log/safari-network-log.d.ts.map +1 -0
- package/build/lib/device-log/safari-network-log.js +47 -0
- package/build/lib/device-log/safari-network-log.js.map +1 -0
- package/build/lib/doctor/checks.d.ts +3 -0
- package/build/lib/doctor/checks.d.ts.map +1 -0
- package/build/lib/doctor/checks.js +39 -0
- package/build/lib/doctor/checks.js.map +1 -0
- package/build/lib/doctor/optional-checks.d.ts +46 -0
- package/build/lib/doctor/optional-checks.d.ts.map +1 -0
- package/build/lib/doctor/optional-checks.js +129 -0
- package/build/lib/doctor/optional-checks.js.map +1 -0
- package/build/lib/doctor/required-checks.d.ts +42 -0
- package/build/lib/doctor/required-checks.d.ts.map +1 -0
- package/build/lib/doctor/required-checks.js +94 -0
- package/build/lib/doctor/required-checks.js.map +1 -0
- package/build/lib/doctor/utils.d.ts +8 -0
- package/build/lib/doctor/utils.d.ts.map +1 -0
- package/build/lib/doctor/utils.js +21 -0
- package/build/lib/doctor/utils.js.map +1 -0
- package/build/lib/driver.d.ts +2429 -0
- package/build/lib/driver.d.ts.map +1 -0
- package/build/lib/driver.js +1967 -0
- package/build/lib/driver.js.map +1 -0
- package/build/lib/execute-method-map.d.ts +552 -0
- package/build/lib/execute-method-map.d.ts.map +1 -0
- package/build/lib/execute-method-map.js +586 -0
- package/build/lib/execute-method-map.js.map +1 -0
- package/build/lib/ios-fs-helpers.d.ts +75 -0
- package/build/lib/ios-fs-helpers.d.ts.map +1 -0
- package/build/lib/ios-fs-helpers.js +370 -0
- package/build/lib/ios-fs-helpers.js.map +1 -0
- package/build/lib/ios-generic-simulators.d.ts +6 -0
- package/build/lib/ios-generic-simulators.d.ts.map +1 -0
- package/build/lib/ios-generic-simulators.js +14 -0
- package/build/lib/ios-generic-simulators.js.map +1 -0
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +6 -0
- package/build/lib/logger.js.map +1 -0
- package/build/lib/method-map.d.ts +229 -0
- package/build/lib/method-map.d.ts.map +1 -0
- package/build/lib/method-map.js +200 -0
- package/build/lib/method-map.js.map +1 -0
- package/build/lib/real-device-clients/base-device-client.d.ts +22 -0
- package/build/lib/real-device-clients/base-device-client.d.ts.map +1 -0
- package/build/lib/real-device-clients/base-device-client.js +14 -0
- package/build/lib/real-device-clients/base-device-client.js.map +1 -0
- package/build/lib/real-device-clients/py-ios-device-client.d.ts +21 -0
- package/build/lib/real-device-clients/py-ios-device-client.d.ts.map +1 -0
- package/build/lib/real-device-clients/py-ios-device-client.js +125 -0
- package/build/lib/real-device-clients/py-ios-device-client.js.map +1 -0
- package/build/lib/real-device-management.d.ts +53 -0
- package/build/lib/real-device-management.d.ts.map +1 -0
- package/build/lib/real-device-management.js +128 -0
- package/build/lib/real-device-management.js.map +1 -0
- package/build/lib/real-device.d.ts +112 -0
- package/build/lib/real-device.d.ts.map +1 -0
- package/build/lib/real-device.js +352 -0
- package/build/lib/real-device.js.map +1 -0
- package/build/lib/simulator-management.d.ts +96 -0
- package/build/lib/simulator-management.d.ts.map +1 -0
- package/build/lib/simulator-management.js +278 -0
- package/build/lib/simulator-management.js.map +1 -0
- package/build/lib/stubs.d.ts +3 -0
- package/build/lib/stubs.d.ts.map +1 -0
- package/build/lib/stubs.js +3 -0
- package/build/lib/stubs.js.map +1 -0
- package/build/lib/types.d.ts +31 -0
- package/build/lib/types.d.ts.map +1 -0
- package/build/lib/types.js +3 -0
- package/build/lib/types.js.map +1 -0
- package/build/lib/utils.d.ts +191 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +549 -0
- package/build/lib/utils.js.map +1 -0
- package/build/lib/xcrun.d.ts +3 -0
- package/build/lib/xcrun.d.ts.map +1 -0
- package/build/lib/xcrun.js +17 -0
- package/build/lib/xcrun.js.map +1 -0
- package/index.js +7 -0
- package/lib/app-infos-cache.js +187 -0
- package/lib/app-utils.js +710 -0
- package/lib/commands/active-app-info.js +12 -0
- package/lib/commands/advanced-battery-types.ts +454 -0
- package/lib/commands/alert.js +88 -0
- package/lib/commands/app-management.js +346 -0
- package/lib/commands/app-strings.js +30 -0
- package/lib/commands/appearance.js +71 -0
- package/lib/commands/audit.js +31 -0
- package/lib/commands/battery.js +45 -0
- package/lib/commands/bidi/constants.ts +6 -0
- package/lib/commands/bidi/models.ts +55 -0
- package/lib/commands/bidi/types.ts +31 -0
- package/lib/commands/biometric.js +53 -0
- package/lib/commands/certificate.js +497 -0
- package/lib/commands/clipboard.js +35 -0
- package/lib/commands/condition.js +155 -0
- package/lib/commands/content-size.js +68 -0
- package/lib/commands/context.js +705 -0
- package/lib/commands/deviceInfo.js +27 -0
- package/lib/commands/element.js +423 -0
- package/lib/commands/enum.ts +108 -0
- package/lib/commands/execute.js +153 -0
- package/lib/commands/file-movement.js +510 -0
- package/lib/commands/find.js +205 -0
- package/lib/commands/general.js +278 -0
- package/lib/commands/geolocation.js +56 -0
- package/lib/commands/gesture.js +596 -0
- package/lib/commands/hid-event.ts +1634 -0
- package/lib/commands/increase-contrast.js +50 -0
- package/lib/commands/iohid.js +64 -0
- package/lib/commands/keyboard.js +62 -0
- package/lib/commands/keychains.js +18 -0
- package/lib/commands/localization.js +30 -0
- package/lib/commands/location.js +131 -0
- package/lib/commands/lock.js +46 -0
- package/lib/commands/log.js +327 -0
- package/lib/commands/memory.js +51 -0
- package/lib/commands/navigation.js +125 -0
- package/lib/commands/notifications.js +66 -0
- package/lib/commands/pasteboard.js +42 -0
- package/lib/commands/pcap.js +168 -0
- package/lib/commands/performance.js +392 -0
- package/lib/commands/permissions.js +85 -0
- package/lib/commands/proxy-helper.js +122 -0
- package/lib/commands/record-audio.js +264 -0
- package/lib/commands/recordscreen.js +391 -0
- package/lib/commands/screenshots.js +137 -0
- package/lib/commands/simctl.js +71 -0
- package/lib/commands/source.js +131 -0
- package/lib/commands/timeouts.js +68 -0
- package/lib/commands/types.ts +648 -0
- package/lib/commands/web.js +1113 -0
- package/lib/commands/xctest-record-screen.js +204 -0
- package/lib/commands/xctest.js +285 -0
- package/lib/css-converter.js +311 -0
- package/lib/desired-caps.js +396 -0
- package/lib/device-connections-factory.js +269 -0
- package/lib/device-log/helpers.ts +40 -0
- package/lib/device-log/ios-crash-log.ts +166 -0
- package/lib/device-log/ios-device-log.ts +51 -0
- package/lib/device-log/ios-log.ts +70 -0
- package/lib/device-log/ios-performance-log.ts +50 -0
- package/lib/device-log/ios-simulator-log.ts +202 -0
- package/lib/device-log/line-consuming-log.ts +16 -0
- package/lib/device-log/safari-console-log.ts +117 -0
- package/lib/device-log/safari-network-log.ts +120 -0
- package/lib/doctor/checks.ts +3 -0
- package/lib/doctor/optional-checks.ts +173 -0
- package/lib/doctor/required-checks.ts +120 -0
- package/lib/doctor/utils.ts +18 -0
- package/lib/driver.js +2316 -0
- package/lib/execute-method-map.ts +585 -0
- package/lib/ios-fs-helpers.js +355 -0
- package/lib/ios-generic-simulators.js +11 -0
- package/lib/logger.js +5 -0
- package/lib/method-map.js +196 -0
- package/lib/real-device-clients/base-device-client.ts +34 -0
- package/lib/real-device-clients/py-ios-device-client.ts +149 -0
- package/lib/real-device-management.js +133 -0
- package/lib/real-device.js +347 -0
- package/lib/simulator-management.js +324 -0
- package/lib/stubs.ts +3 -0
- package/lib/types.ts +33 -0
- package/lib/utils.js +551 -0
- package/lib/xcrun.js +16 -0
- package/package.json +175 -0
- package/scripts/build-docs.js +56 -0
- package/scripts/build-wda.js +42 -0
- package/scripts/download-wda-sim.mjs +68 -0
- package/scripts/image-mounter.mjs +239 -0
- package/scripts/open-wda.mjs +15 -0
- package/scripts/tunnel-creation.mjs +359 -0
- package/scripts/utils.js +16 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import {fs, util} from 'appium/support';
|
|
3
|
+
import {errors} from 'appium/driver';
|
|
4
|
+
import {services} from 'appium-ios-device';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import B from 'bluebird';
|
|
7
|
+
import {
|
|
8
|
+
SUPPORTED_EXTENSIONS,
|
|
9
|
+
onPostConfigureApp,
|
|
10
|
+
onDownloadApp,
|
|
11
|
+
} from '../app-utils';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Installs the given application to the device under test.
|
|
15
|
+
*
|
|
16
|
+
* Please ensure the app is built for a correct architecture and is signed with a proper developer signature (for real devices) prior to calling this.
|
|
17
|
+
* @param {string} app - See docs for `appium:app` capability
|
|
18
|
+
* @param {number} [timeoutMs] - The maximum time to wait until app install is finished (in ms) on real devices.
|
|
19
|
+
* If not provided, then the value of `appium:appPushTimeout` capability is used. If the capability is not provided then the default is 240000ms (4 minutes).
|
|
20
|
+
* @param {boolean} [checkVersion] - If the application installation follows currently installed application's version status if provided.
|
|
21
|
+
* No checking occurs if no this option.
|
|
22
|
+
* @privateRemarks Link to capability docs
|
|
23
|
+
* @returns {Promise<void>}
|
|
24
|
+
* @this {XCUITestDriver}
|
|
25
|
+
*/
|
|
26
|
+
export async function mobileInstallApp(app, timeoutMs, checkVersion) {
|
|
27
|
+
const srcAppPath = await this.helpers.configureApp(app, {
|
|
28
|
+
onPostProcess: onPostConfigureApp.bind(this),
|
|
29
|
+
onDownload: onDownloadApp.bind(this),
|
|
30
|
+
supportedExtensions: SUPPORTED_EXTENSIONS,
|
|
31
|
+
});
|
|
32
|
+
this.log.info(
|
|
33
|
+
`Installing '${srcAppPath}' to the ${this.isRealDevice() ? 'real device' : 'Simulator'} ` +
|
|
34
|
+
`with UDID '${this.device.udid}'`,
|
|
35
|
+
);
|
|
36
|
+
if (!(await fs.exists(srcAppPath))) {
|
|
37
|
+
throw this.log.errorWithException(
|
|
38
|
+
`The application at '${srcAppPath}' does not exist or is not accessible`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const bundleId = await this.appInfosCache.extractBundleId(srcAppPath);
|
|
43
|
+
if (checkVersion) {
|
|
44
|
+
const {install} = await this.checkAutInstallationState({
|
|
45
|
+
enforceAppInstall: false,
|
|
46
|
+
fullReset: false,
|
|
47
|
+
noReset: false,
|
|
48
|
+
bundleId,
|
|
49
|
+
app: srcAppPath,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (!install) {
|
|
53
|
+
this.log.info(`Skipping the installation of '${bundleId}'`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
await this.device.installApp(
|
|
59
|
+
srcAppPath,
|
|
60
|
+
bundleId,
|
|
61
|
+
{
|
|
62
|
+
timeoutMs: timeoutMs ?? this.opts.appPushTimeout
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
this.log.info(`Installation of '${srcAppPath}' succeeded`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Checks whether the given application is installed on the device under test.
|
|
70
|
+
* Offload app is handled as not installed.
|
|
71
|
+
*
|
|
72
|
+
* @param {string} bundleId - The bundle identifier of the application to be checked
|
|
73
|
+
* @returns {Promise<boolean>} `true` if the application is installed; `false` otherwise
|
|
74
|
+
* @this {XCUITestDriver}
|
|
75
|
+
*/
|
|
76
|
+
export async function mobileIsAppInstalled(bundleId) {
|
|
77
|
+
const installed = await this.device.isAppInstalled(bundleId);
|
|
78
|
+
this.log.info(`App '${bundleId}' is${installed ? '' : ' not'} installed`);
|
|
79
|
+
return installed;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Removes/uninstalls the given application from the device under test.
|
|
84
|
+
* Offload app data could also be removed.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} bundleId - The bundle identifier of the application to be removed
|
|
87
|
+
* @returns {Promise<boolean>} `true` if the application has been removed successfully; `false` otherwise
|
|
88
|
+
* @this {XCUITestDriver}
|
|
89
|
+
*/
|
|
90
|
+
export async function mobileRemoveApp(bundleId) {
|
|
91
|
+
this.log.info(
|
|
92
|
+
`Uninstalling the application with bundle identifier '${bundleId}' ` +
|
|
93
|
+
`from the ${this.isRealDevice() ? 'real device' : 'Simulator'} with UDID '${this.device.udid}'`,
|
|
94
|
+
);
|
|
95
|
+
try {
|
|
96
|
+
await this.device.removeApp(bundleId);
|
|
97
|
+
this.log.info(`Removal of '${bundleId}' succeeded`);
|
|
98
|
+
return true;
|
|
99
|
+
} catch (err) {
|
|
100
|
+
this.log.warn(`Cannot remove '${bundleId}'. Original error: ${err.message}`);
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Executes the given app on the device under test.
|
|
107
|
+
*
|
|
108
|
+
* If the app is already running it will be activated. If the app is not installed or cannot be launched then an exception is thrown.
|
|
109
|
+
* @param {string} bundleId - The bundle identifier of the application to be launched
|
|
110
|
+
* @param {string|string[]} [args] - One or more command line arguments for the app. If the app is already running then this argument is ignored.
|
|
111
|
+
* @param {object} [environment] - Environment variables mapping for the app. If the app is already running then this argument is ignored.
|
|
112
|
+
* @returns {Promise<void>}
|
|
113
|
+
* @this {XCUITestDriver}
|
|
114
|
+
*/
|
|
115
|
+
export async function mobileLaunchApp(bundleId, args, environment) {
|
|
116
|
+
/** @type { {arguments?: any[], environment?: any, bundleId: string} } */
|
|
117
|
+
const launchOptions = {bundleId};
|
|
118
|
+
if (args) {
|
|
119
|
+
launchOptions.arguments = Array.isArray(args) ? args : [args];
|
|
120
|
+
}
|
|
121
|
+
if (environment) {
|
|
122
|
+
launchOptions.environment = environment;
|
|
123
|
+
}
|
|
124
|
+
await this.proxyCommand('/wda/apps/launch', 'POST', launchOptions);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Terminates the given app on the device under test.
|
|
129
|
+
*
|
|
130
|
+
* This command performs termination via [XCTest's `terminate`](https://developer.apple.com/documentation/xctest/xcuiapplication/1500637-terminate) API. If the app is not installed an exception is thrown. If the app is not running then nothing is done.
|
|
131
|
+
* @param {string} bundleId - The bundle identifier of the application to be terminated
|
|
132
|
+
* @returns {Promise<boolean>} `true` if the app has been terminated successfully; `false` otherwise
|
|
133
|
+
* @this {XCUITestDriver}
|
|
134
|
+
*/
|
|
135
|
+
export async function mobileTerminateApp(bundleId) {
|
|
136
|
+
return /** @type {boolean} */ (
|
|
137
|
+
await this.proxyCommand('/wda/apps/terminate', 'POST', {bundleId})
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Activate the given app on the device under test.
|
|
143
|
+
*
|
|
144
|
+
* This pushes the app to the foreground if it is running in the background. An exception is thrown if the app is not install or isn't running. Nothing is done if the app is already in the foreground.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} bundleId - The bundle identifier of the application to be activated
|
|
147
|
+
* @returns {Promise<void>}
|
|
148
|
+
* @this {XCUITestDriver}
|
|
149
|
+
*/
|
|
150
|
+
export async function mobileActivateApp(bundleId) {
|
|
151
|
+
await this.proxyCommand('/wda/apps/activate', 'POST', {bundleId});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Kill the given app on the real device under test by instruments service.
|
|
156
|
+
*
|
|
157
|
+
* If the app is not running or kill failed, then nothing is done.
|
|
158
|
+
*
|
|
159
|
+
* @remarks `appium-xcuitest-driver` v4.4 does not require `py-ios-device` to be installed.
|
|
160
|
+
* @privateRemarks See implementation at https://github.com/YueChen-C/py-ios-device/blob/51f4683c5c3c385a015858ada07a5f1c62d3cf57/ios_device/cli/base.py#L220
|
|
161
|
+
* @see https://github.com/YueChen-C/py-ios-device
|
|
162
|
+
* @param {string} bundleId - The bundle identifier of the application to be killed
|
|
163
|
+
* @returns {Promise<boolean>} `true` if the app has been killed successfully; `false` otherwise
|
|
164
|
+
* @group Real Device Only
|
|
165
|
+
* @this {XCUITestDriver}
|
|
166
|
+
*/
|
|
167
|
+
export async function mobileKillApp(bundleId) {
|
|
168
|
+
if (!this.isRealDevice()) {
|
|
169
|
+
throw new errors.UnsupportedOperationError('A real device is required');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return await /** @type {import('../real-device').RealDevice} */ (this.device).terminateApp(
|
|
173
|
+
bundleId, String(this.opts.platformVersion)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Queries the state of an installed application from the device under test.
|
|
179
|
+
*
|
|
180
|
+
* If the app with the given `bundleId` is not installed, an exception will be thrown.
|
|
181
|
+
*
|
|
182
|
+
* @param {string} bundleId - The bundle identifier of the application to be queried
|
|
183
|
+
* @returns {Promise<AppState>} The actual application state code
|
|
184
|
+
* @see https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
|
|
185
|
+
* @this {XCUITestDriver}
|
|
186
|
+
*/
|
|
187
|
+
export async function mobileQueryAppState(bundleId) {
|
|
188
|
+
return /** @type {AppState} */ (await this.proxyCommand('/wda/apps/state', 'POST', {bundleId}));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @param {string} appPath
|
|
193
|
+
* @param {object} opts
|
|
194
|
+
* @this {XCUITestDriver}
|
|
195
|
+
*/
|
|
196
|
+
export async function installApp(appPath, {timeoutMs, strategy} = {}) {
|
|
197
|
+
// @ts-ignore Probably a TS bug
|
|
198
|
+
await this.mobileInstallApp(appPath, timeoutMs, strategy);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @param {string} bundleId
|
|
203
|
+
* @param {object} opts
|
|
204
|
+
* @this {XCUITestDriver}
|
|
205
|
+
*/
|
|
206
|
+
export async function activateApp(bundleId, opts = {}) {
|
|
207
|
+
const {environment, arguments: args} = opts;
|
|
208
|
+
// @ts-ignore Probably a TS bug
|
|
209
|
+
return await this.mobileLaunchApp(bundleId, args, environment);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @param {string} bundleId
|
|
214
|
+
* @this {XCUITestDriver}
|
|
215
|
+
*/
|
|
216
|
+
export async function isAppInstalled(bundleId) {
|
|
217
|
+
return await this.mobileIsAppInstalled(bundleId);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @param {string} bundleId
|
|
222
|
+
* @this {XCUITestDriver}
|
|
223
|
+
* @returns {Promise<boolean>}
|
|
224
|
+
*/
|
|
225
|
+
export async function terminateApp(bundleId) {
|
|
226
|
+
return await this.mobileTerminateApp(bundleId);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @param {string} bundleId
|
|
231
|
+
* @this {XCUITestDriver}
|
|
232
|
+
*/
|
|
233
|
+
export async function queryAppState(bundleId) {
|
|
234
|
+
return await this.mobileQueryAppState(bundleId);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* List applications installed on the real device under test
|
|
239
|
+
*
|
|
240
|
+
* Read [Pushing/Pulling files](https://appium.io/docs/en/writing-running-appium/ios/ios-xctest-file-movement/) for more details.
|
|
241
|
+
* @param {'User'|'System'} applicationType - The type of applications to list.
|
|
242
|
+
* @returns {Promise<Record<string,any>[]>} A list of apps where each item is a mapping of bundle identifiers to maps of platform-specific app properties.
|
|
243
|
+
* @remarks Having `UIFileSharingEnabled` set to `true` in the return app properties map means this app supports file upload/download in its `documents` container.
|
|
244
|
+
* @group Real Device Only
|
|
245
|
+
*/
|
|
246
|
+
export async function mobileListApps(applicationType = 'User') {
|
|
247
|
+
if (!this.isRealDevice()) {
|
|
248
|
+
throw new errors.NotImplementedError(`This extension is only supported on real devices`);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const service = await services.startInstallationProxyService(this.device.udid);
|
|
252
|
+
try {
|
|
253
|
+
return await service.listApplications({applicationType});
|
|
254
|
+
} finally {
|
|
255
|
+
service.close();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Deletes application data files, so it could start from the clean state next time
|
|
261
|
+
* it is launched.
|
|
262
|
+
* This API only works on a Simulator.
|
|
263
|
+
*
|
|
264
|
+
* @param {string} bundleId Application bundle identifier
|
|
265
|
+
* @this {XCUITestDriver}
|
|
266
|
+
* @returns {Promise<boolean>} true if any files from the app's data container have been deleted
|
|
267
|
+
*/
|
|
268
|
+
export async function mobileClearApp(bundleId) {
|
|
269
|
+
if (this.isRealDevice()) {
|
|
270
|
+
throw new errors.NotImplementedError(
|
|
271
|
+
`This extension is only supported on simulators. ` +
|
|
272
|
+
`The only known way to clear app data on real devices ` +
|
|
273
|
+
`would be to uninstall the app then perform a fresh install of it.`
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const simctl = /** @type {import('../driver').Simulator} */ (this.device).simctl;
|
|
278
|
+
const dataRoot = await simctl.getAppContainer(bundleId, 'data');
|
|
279
|
+
this.log.debug(`Got the data container root of ${bundleId} at '${dataRoot}'`);
|
|
280
|
+
if (!await fs.exists(dataRoot)) {
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
await this.mobileTerminateApp(bundleId);
|
|
285
|
+
const items = await fs.readdir(dataRoot);
|
|
286
|
+
if (!items.length) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
await B.all(items.map((item) => fs.rimraf(path.join(dataRoot, item))));
|
|
291
|
+
this.log.info(
|
|
292
|
+
`Cleaned up ${util.pluralize('item', items.length, true)} from ${bundleId}'s data container`
|
|
293
|
+
);
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Close app (simulate device home button). It is possible to restore
|
|
299
|
+
* the app after the timeout or keep it minimized based on the parameter value.
|
|
300
|
+
*
|
|
301
|
+
* @param {number|{timeout: number?}} [seconds]
|
|
302
|
+
* - any positive number of seconds: come back after X seconds
|
|
303
|
+
* - any negative number of seconds or zero: never come back
|
|
304
|
+
* - undefined/null: never come back
|
|
305
|
+
* - {timeout: 5000}: come back after 5 seconds
|
|
306
|
+
* - {timeout: null}, {timeout: -2}: never come back
|
|
307
|
+
* @this {XCUITestDriver}
|
|
308
|
+
*/
|
|
309
|
+
export async function background(seconds) {
|
|
310
|
+
const homescreen = '/wda/homescreen';
|
|
311
|
+
const deactivateApp = '/wda/deactivateApp';
|
|
312
|
+
|
|
313
|
+
let endpoint;
|
|
314
|
+
let params = {};
|
|
315
|
+
const selectEndpoint = (timeoutSeconds) => {
|
|
316
|
+
if (!util.hasValue(timeoutSeconds)) {
|
|
317
|
+
endpoint = homescreen;
|
|
318
|
+
} else if (!isNaN(timeoutSeconds)) {
|
|
319
|
+
const duration = parseFloat(timeoutSeconds);
|
|
320
|
+
if (duration >= 0) {
|
|
321
|
+
params = {duration};
|
|
322
|
+
endpoint = deactivateApp;
|
|
323
|
+
} else {
|
|
324
|
+
endpoint = homescreen;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
if (seconds && !_.isNumber(seconds) && _.has(seconds, 'timeout')) {
|
|
329
|
+
const timeout = seconds.timeout;
|
|
330
|
+
selectEndpoint(isNaN(Number(timeout)) ? timeout : parseFloat(String(timeout)) / 1000.0);
|
|
331
|
+
} else {
|
|
332
|
+
selectEndpoint(seconds);
|
|
333
|
+
}
|
|
334
|
+
if (!endpoint) {
|
|
335
|
+
throw new errors.InvalidArgumentError(
|
|
336
|
+
`Argument value is expected to be a valid number. ` +
|
|
337
|
+
`${JSON.stringify(seconds)} has been provided instead`,
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
return await this.proxyCommand(endpoint, 'POST', params, endpoint !== homescreen);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
345
|
+
* @typedef {import('./enum').AppState} AppState
|
|
346
|
+
*/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {parseLocalizableStrings} from '../app-utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Return the language-specific strings for an app
|
|
5
|
+
*
|
|
6
|
+
* @param {string} language - The language abbreviation to fetch app strings mapping for.
|
|
7
|
+
* If no language is provided then strings for the 'en language would be returned
|
|
8
|
+
* @param {string|null} [stringFile=null] - Relative path to the corresponding .strings
|
|
9
|
+
* file starting from the corresponding .lproj folder, e.g., `base/main.strings`. If omitted,
|
|
10
|
+
* then Appium will make its best guess where the file is.
|
|
11
|
+
*
|
|
12
|
+
* @returns {Promise<import('@appium/types').StringRecord<string>>} A record of localized keys to localized text
|
|
13
|
+
*
|
|
14
|
+
* @this {XCUITestDriver}
|
|
15
|
+
*/
|
|
16
|
+
export async function getStrings(language, stringFile = null) {
|
|
17
|
+
this.log.debug(`Gettings strings for language '${language}' and string file '${stringFile}'`);
|
|
18
|
+
return await parseLocalizableStrings.bind(this)(
|
|
19
|
+
{
|
|
20
|
+
...this.opts,
|
|
21
|
+
language,
|
|
22
|
+
stringFile,
|
|
23
|
+
strictMode: true,
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
30
|
+
*/
|
|
@@ -0,0 +1,71 @@
|
|
|
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('../driver').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('../driver').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
|
+
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import log from '../logger.js';
|
|
2
|
+
import { isIos18OrNewer } from '../utils.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Reads the battery information from the device under test.
|
|
6
|
+
*
|
|
7
|
+
* This endpoint only returns reliable result on real devices.
|
|
8
|
+
*
|
|
9
|
+
* @returns {Promise<import('./types').BatteryInfo & {advanced: Record<string, any>}>}
|
|
10
|
+
* @this {import('../driver').XCUITestDriver}
|
|
11
|
+
*/
|
|
12
|
+
export async function mobileGetBatteryInfo() {
|
|
13
|
+
let batteryInfoFromShimService;
|
|
14
|
+
if (isIos18OrNewer(this.opts) && this.isRealDevice()) {
|
|
15
|
+
let remoteXPCConnection;
|
|
16
|
+
try {
|
|
17
|
+
const {Services} = await import('appium-ios-remotexpc');
|
|
18
|
+
let { diagnosticsService, remoteXPC } = await Services.startDiagnosticsService(this.device.udid);
|
|
19
|
+
remoteXPCConnection = remoteXPC;
|
|
20
|
+
batteryInfoFromShimService = await diagnosticsService.ioregistry({
|
|
21
|
+
ioClass: 'IOPMPowerSource',
|
|
22
|
+
returnRawJson: true,
|
|
23
|
+
});
|
|
24
|
+
} catch (err) {
|
|
25
|
+
log.error(`Failed to get battery info from DiagnosticsService: ${err.message}`);
|
|
26
|
+
} finally {
|
|
27
|
+
if (remoteXPCConnection) {
|
|
28
|
+
log.info(`Closing remoteXPC connection for device ${this.device.udid}`);
|
|
29
|
+
await remoteXPCConnection.close();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const batteryInfoFromWda = /** @type {import('./types').BatteryInfo}} */ (
|
|
35
|
+
await this.proxyCommand('/wda/batteryInfo', 'GET')
|
|
36
|
+
);
|
|
37
|
+
return {
|
|
38
|
+
...batteryInfoFromWda,
|
|
39
|
+
advanced: batteryInfoFromShimService || {},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @typedef {import('./types').BatteryInfo} BatteryInfo
|
|
45
|
+
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const BIDI_EVENT_NAME = 'bidiEvent';
|
|
2
|
+
const DOMAIN = 'xcuitest';
|
|
3
|
+
export const CONTEXT_UPDATED_EVENT = `appium:${DOMAIN}.contextUpdated`;
|
|
4
|
+
/** @deprecated Use {@link CONTEXT_UPDATED_EVENT} instead */
|
|
5
|
+
export const CONTEXT_UPDATED_EVENT_OBSOLETE = 'appium.contextUpdated';
|
|
6
|
+
export const LOG_ENTRY_ADDED_EVENT = 'log.entryAdded';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { LogEntryAddedEvent, ContextUpdatedEvent, BiDiLogLevel } from './types';
|
|
2
|
+
import { NATIVE_WIN } from '../../utils';
|
|
3
|
+
import { CONTEXT_UPDATED_EVENT, CONTEXT_UPDATED_EVENT_OBSOLETE, LOG_ENTRY_ADDED_EVENT } from './constants';
|
|
4
|
+
import type { LogEntry } from '../types';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
|
|
7
|
+
function toContextUpdatedEvent(method: string, contextName: string): ContextUpdatedEvent {
|
|
8
|
+
return {
|
|
9
|
+
method,
|
|
10
|
+
params: {
|
|
11
|
+
name: contextName,
|
|
12
|
+
type: contextName === NATIVE_WIN ? 'NATIVE' : 'WEB',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const makeContextUpdatedEvent = (contextName: string) => toContextUpdatedEvent(
|
|
18
|
+
CONTEXT_UPDATED_EVENT, contextName
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use {@link makeContextUpdatedEvent} instead
|
|
23
|
+
*/
|
|
24
|
+
export const makeObsoleteContextUpdatedEvent = (contextName: string) => toContextUpdatedEvent(
|
|
25
|
+
CONTEXT_UPDATED_EVENT_OBSOLETE, contextName
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export function makeLogEntryAddedEvent(entry: LogEntry, context: string, type: string): LogEntryAddedEvent {
|
|
29
|
+
return {
|
|
30
|
+
context,
|
|
31
|
+
method: LOG_ENTRY_ADDED_EVENT,
|
|
32
|
+
params: {
|
|
33
|
+
type,
|
|
34
|
+
level: adjustLogLevel(entry.level),
|
|
35
|
+
source: {
|
|
36
|
+
realm: '',
|
|
37
|
+
},
|
|
38
|
+
text: entry.message,
|
|
39
|
+
timestamp: entry.timestamp,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function adjustLogLevel(originalLevel: string): BiDiLogLevel {
|
|
45
|
+
const originalLevelLc = _.toLower(originalLevel);
|
|
46
|
+
switch (originalLevelLc) {
|
|
47
|
+
case 'debug':
|
|
48
|
+
case 'info':
|
|
49
|
+
case 'warn':
|
|
50
|
+
case 'error':
|
|
51
|
+
return originalLevelLc as BiDiLogLevel;
|
|
52
|
+
default:
|
|
53
|
+
return 'info';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface BiDiEvent<TParams> {
|
|
2
|
+
method: string;
|
|
3
|
+
params: TParams;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
interface LogEntrySource {
|
|
7
|
+
realm: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type BiDiLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
11
|
+
|
|
12
|
+
interface LogEntryAddedEventParams {
|
|
13
|
+
type: string;
|
|
14
|
+
level: BiDiLogLevel;
|
|
15
|
+
source: LogEntrySource;
|
|
16
|
+
text: string;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
|
|
21
|
+
export interface LogEntryAddedEvent extends BiDiEvent<LogEntryAddedEventParams> {
|
|
22
|
+
context: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ContentUpdatedParams {
|
|
26
|
+
name: string;
|
|
27
|
+
type: 'NATIVE' | 'WEB';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// https://github.com/appium/appium/issues/20741
|
|
31
|
+
export interface ContextUpdatedEvent extends BiDiEvent<ContentUpdatedParams> {}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import {assertSimulator as _assertSimulator} from '../utils';
|
|
3
|
+
|
|
4
|
+
const assertSimulator = _.partial(_assertSimulator, 'Biometric enrollment');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Enrolls biometric authentication on a simulated device.
|
|
8
|
+
*
|
|
9
|
+
* @param {boolean} isEnabled - Whether to enable/disable biometric enrollment.
|
|
10
|
+
* @throws {Error} If enrollment fails or the device is not a Simulator.
|
|
11
|
+
* @group Simulator Only
|
|
12
|
+
* @this {XCUITestDriver}
|
|
13
|
+
*/
|
|
14
|
+
export async function mobileEnrollBiometric(isEnabled = true) {
|
|
15
|
+
assertSimulator(this);
|
|
16
|
+
|
|
17
|
+
await /** @type {import('../driver').Simulator} */ (this.device).enrollBiometric(isEnabled);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Emulates biometric match or non-match event on a simulated device.
|
|
22
|
+
*
|
|
23
|
+
* The biometric feature is expected to be already enrolled via {@linkcode mobileEnrollBiometric|mobile: enrollBiometric} before executing this.
|
|
24
|
+
*
|
|
25
|
+
* @param {import('./types').BiometricFeature} type - The biometric feature name.
|
|
26
|
+
* @param {boolean} match - If `true`, simulate biometic match. If `false`, simulate biometric non-match.
|
|
27
|
+
* @throws {Error} If matching fails or the device is not a Simulator.
|
|
28
|
+
* @group Simulator Only
|
|
29
|
+
* @this {XCUITestDriver}
|
|
30
|
+
*/
|
|
31
|
+
export async function mobileSendBiometricMatch(type = 'touchId', match = true) {
|
|
32
|
+
assertSimulator(this);
|
|
33
|
+
|
|
34
|
+
await /** @type {import('../driver').Simulator} */ (this.device).sendBiometricMatch(match, type);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Checks whether the biometric feature is currently enrolled on a simulated device.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Promise<boolean>} `true` if biometric is enrolled.
|
|
41
|
+
* @throws {Error} If the detection fails or the device is not a Simulator.
|
|
42
|
+
* @group Simulator Only
|
|
43
|
+
* @this {XCUITestDriver}
|
|
44
|
+
*/
|
|
45
|
+
export async function mobileIsBiometricEnrolled() {
|
|
46
|
+
assertSimulator(this);
|
|
47
|
+
|
|
48
|
+
return await /** @type {import('../driver').Simulator} */ (this.device).isBiometricEnrolled();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
53
|
+
*/
|