@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,204 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import {fs, util} from 'appium/support';
|
|
3
|
+
import {encodeBase64OrUpload} from '../utils';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
|
|
6
|
+
const MOV_EXT = '.mov';
|
|
7
|
+
const FEATURE_NAME = 'xctest_screen_record';
|
|
8
|
+
const DOMAIN_IDENTIFIER = 'com.apple.testmanagerd';
|
|
9
|
+
const DOMAIN_TYPE = 'appDataContainer';
|
|
10
|
+
const USERNAME = 'mobile';
|
|
11
|
+
const SUBDIRECTORY = 'Attachments';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {Object} XcTestScreenRecordingInfo
|
|
15
|
+
* @property {string} uuid Unique identifier of the video being recorded
|
|
16
|
+
* @property {number} fps FPS value
|
|
17
|
+
* @property {number} codec Video codec, where 0 is h264
|
|
18
|
+
* @property {number} startedAt The timestamp when the screen recording has started in float Unix seconds
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} XcTestScreenRecordingType
|
|
23
|
+
* @property {string} payload Base64-encoded content of the recorded media
|
|
24
|
+
* file if `remotePath` parameter is empty or null or an empty string otherwise.
|
|
25
|
+
* The media is expected to a be a valid QuickTime movie (.mov).
|
|
26
|
+
* @typedef {XcTestScreenRecordingInfo & XcTestScreenRecordingType} XcTestScreenRecording
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @this {XCUITestDriver}
|
|
31
|
+
* @param {string} uuid Unique identifier of the video being recorded
|
|
32
|
+
* @returns {Promise<string>} The full path to the screen recording movie
|
|
33
|
+
*/
|
|
34
|
+
async function retrieveRecodingFromSimulator(uuid) {
|
|
35
|
+
const device = /** @type {import('../driver').Simulator} */ (this.device);
|
|
36
|
+
const dataRoot = /** @type {string} */ (device.getDir());
|
|
37
|
+
// On Simulators the path looks like
|
|
38
|
+
// $HOME/Library/Developer/CoreSimulator/Devices/F8E1968A-8443-4A9A-AB86-27C54C36A2F6/data/Containers/Data/InternalDaemon/4E3FE8DF-AD0A-41DA-B6EC-C35E5798C219/Attachments/A044DAF7-4A58-4CD5-95C3-29B4FE80C377
|
|
39
|
+
const internalDaemonRoot = path.resolve(dataRoot, 'Containers', 'Data', 'InternalDaemon');
|
|
40
|
+
const videoPaths = await fs.glob(`*/Attachments/${uuid}`, {
|
|
41
|
+
cwd: internalDaemonRoot,
|
|
42
|
+
absolute: true,
|
|
43
|
+
});
|
|
44
|
+
if (_.isEmpty(videoPaths)) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`Unable to locate XCTest screen recording identified by '${uuid}' for the Simulator ${device.udid}`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
const videoPath = videoPaths[0];
|
|
50
|
+
const {size} = await fs.stat(videoPath);
|
|
51
|
+
this.log.debug(`Located the video at '${videoPath}' (${util.toReadableSizeString(size)})`);
|
|
52
|
+
return videoPath;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @this {XCUITestDriver}
|
|
57
|
+
* @param {string} uuid Unique identifier of the video being recorded
|
|
58
|
+
* @returns {Promise<string>} The full path to the screen recording movie
|
|
59
|
+
*/
|
|
60
|
+
async function retrieveRecodingFromRealDevice(uuid) {
|
|
61
|
+
const device = /** @type {import('../real-device').RealDevice} */ (this.device);
|
|
62
|
+
|
|
63
|
+
const fileNames = await device.devicectl.listFiles(DOMAIN_TYPE, DOMAIN_IDENTIFIER, {
|
|
64
|
+
username: USERNAME,
|
|
65
|
+
subdirectory: SUBDIRECTORY,
|
|
66
|
+
});
|
|
67
|
+
if (!fileNames.includes(uuid)) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Unable to locate XCTest screen recording identified by '${uuid}' for the device ${this.opts.udid}`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const videoPath = path.join(/** @type {string} */ (this.opts.tmpDir), `${uuid}${MOV_EXT}`);
|
|
73
|
+
await device.devicectl.pullFile(`${SUBDIRECTORY}/${uuid}`, videoPath, {
|
|
74
|
+
username: USERNAME,
|
|
75
|
+
domainIdentifier: DOMAIN_IDENTIFIER,
|
|
76
|
+
domainType: DOMAIN_TYPE,
|
|
77
|
+
});
|
|
78
|
+
const {size} = await fs.stat(videoPath);
|
|
79
|
+
this.log.debug(`Pulled the video to '${videoPath}' (${util.toReadableSizeString(size)})`);
|
|
80
|
+
return videoPath;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @this {XCUITestDriver}
|
|
85
|
+
* @param {string} uuid Unique identifier of the video being recorded
|
|
86
|
+
* @returns {Promise<string>} The full path to the screen recording movie
|
|
87
|
+
*/
|
|
88
|
+
async function retrieveXcTestScreenRecording(uuid) {
|
|
89
|
+
return this.isRealDevice()
|
|
90
|
+
? await retrieveRecodingFromRealDevice.bind(this)(uuid)
|
|
91
|
+
: await retrieveRecodingFromSimulator.bind(this)(uuid);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Start a new screen recording via XCTest.
|
|
96
|
+
*
|
|
97
|
+
* Even though the feature is available for real devices
|
|
98
|
+
* there is no possibility to delete stored video files yet,
|
|
99
|
+
* which may lead to internal storage overload.
|
|
100
|
+
* That is why it was put under a security feature flag.
|
|
101
|
+
*
|
|
102
|
+
* If the recording is already running this API is a noop.
|
|
103
|
+
*
|
|
104
|
+
* @since Xcode 15/iOS 17
|
|
105
|
+
* @param {number} [fps] FPS value
|
|
106
|
+
* @param {number} [codec] Video codec, where 0 is h264, 1 is HEVC
|
|
107
|
+
* @returns {Promise<XcTestScreenRecordingInfo>} The information
|
|
108
|
+
* about a newly created or a running the screen recording.
|
|
109
|
+
* @throws {Error} If screen recording has failed to start.
|
|
110
|
+
* @this {XCUITestDriver}
|
|
111
|
+
*/
|
|
112
|
+
export async function mobileStartXctestScreenRecording(fps, codec) {
|
|
113
|
+
if (this.isRealDevice()) {
|
|
114
|
+
// This feature might be used to abuse real devices as there is no
|
|
115
|
+
// reliable way (yet) to cleanup video recordings stored there
|
|
116
|
+
// by the testmanagerd daemon
|
|
117
|
+
this.assertFeatureEnabled(FEATURE_NAME);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const opts = {};
|
|
121
|
+
if (_.isInteger(codec)) {
|
|
122
|
+
opts.codec = codec;
|
|
123
|
+
}
|
|
124
|
+
if (_.isInteger(fps)) {
|
|
125
|
+
opts.fps = fps;
|
|
126
|
+
}
|
|
127
|
+
const response = /** @type {XcTestScreenRecordingInfo} */ (
|
|
128
|
+
await this.proxyCommand('/wda/video/start', 'POST', opts)
|
|
129
|
+
);
|
|
130
|
+
this.log.info(`Started a new screen recording: ${JSON.stringify(response)}`);
|
|
131
|
+
return response;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves information about the current running screen recording.
|
|
136
|
+
* If no screen recording is running then `null` is returned.
|
|
137
|
+
*
|
|
138
|
+
* @returns {Promise<XcTestScreenRecordingInfo?>}
|
|
139
|
+
*/
|
|
140
|
+
export async function mobileGetXctestScreenRecordingInfo() {
|
|
141
|
+
return /** @type {XcTestScreenRecordingInfo?} */ (
|
|
142
|
+
await this.proxyCommand('/wda/video', 'GET')
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Stop screen recording previously started by mobileStartXctestScreenRecording API.
|
|
148
|
+
*
|
|
149
|
+
* An error is thrown if no screen recording is running.
|
|
150
|
+
*
|
|
151
|
+
* The resulting movie is returned as base-64 string or is uploaded to
|
|
152
|
+
* a remote location if corresponding options have been provided.
|
|
153
|
+
*
|
|
154
|
+
* The resulting movie is automatically deleted FOR SIMULATORS ONLY.
|
|
155
|
+
* In order to clean it up from a real device it is necessary to properly
|
|
156
|
+
* shut down XCTest by calling `GET /wda/shutdown` API to the WebDriverAgent server running
|
|
157
|
+
* on the device directly or by doing factory reset.
|
|
158
|
+
*
|
|
159
|
+
* @since Xcode 15/iOS 17
|
|
160
|
+
* @param {string} [remotePath] The path to the remote location, where the resulting video should be
|
|
161
|
+
* uploaded.
|
|
162
|
+
* The following protocols are supported: `http`, `https`, `ftp`. Null or empty
|
|
163
|
+
* string value (the default setting) means the content of resulting file
|
|
164
|
+
* should be encoded as Base64 and passed as the endpoint response value. An
|
|
165
|
+
* exception will be thrown if the generated media file is too big to fit into
|
|
166
|
+
* the available process memory.
|
|
167
|
+
* @param {string} [user] The name of the user for the remote authentication.
|
|
168
|
+
* Only works if `remotePath` is provided.
|
|
169
|
+
* @param {string} [pass] The password for the remote authentication.
|
|
170
|
+
* Only works if `remotePath` is provided.
|
|
171
|
+
* @param {import('@appium/types').HTTPHeaders} [headers] Additional headers mapping for multipart http(s) uploads
|
|
172
|
+
* @param {string} [fileFieldName] The name of the form field where the file content BLOB should be stored for
|
|
173
|
+
* http(s) uploads
|
|
174
|
+
* @param {Record<string, any> | [string, any][]} [formFields] Additional form fields for multipart http(s) uploads
|
|
175
|
+
* @param {'PUT' | 'POST' | 'PATCH'} [method='PUT'] The http multipart upload method name.
|
|
176
|
+
* Only works if `remotePath` is provided.
|
|
177
|
+
* @returns {Promise<XcTestScreenRecording>}
|
|
178
|
+
* @throws {Error} If there was an error while retrieving the video
|
|
179
|
+
* file or the file content cannot be uploaded to the remote location.
|
|
180
|
+
* @this {XCUITestDriver}
|
|
181
|
+
*/
|
|
182
|
+
export async function mobileStopXctestScreenRecording(remotePath, user, pass, headers, fileFieldName, formFields, method) {
|
|
183
|
+
const screenRecordingInfo = await this.mobileGetXctestScreenRecordingInfo();
|
|
184
|
+
if (!screenRecordingInfo) {
|
|
185
|
+
throw new Error('There is no active screen recording. Did you start one beforehand?');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
this.log.debug(`Stopping the active screen recording: ${JSON.stringify(screenRecordingInfo)}`);
|
|
189
|
+
await this.proxyCommand('/wda/video/stop', 'POST', {});
|
|
190
|
+
const videoPath = await retrieveXcTestScreenRecording.bind(this)(screenRecordingInfo.uuid);
|
|
191
|
+
const result = /** @type {XcTestScreenRecording} */ (screenRecordingInfo);
|
|
192
|
+
try {
|
|
193
|
+
result.payload = await encodeBase64OrUpload(videoPath, remotePath, {
|
|
194
|
+
user, pass, headers, fileFieldName, formFields, method
|
|
195
|
+
});
|
|
196
|
+
} finally {
|
|
197
|
+
await fs.rimraf(videoPath);
|
|
198
|
+
}
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
204
|
+
*/
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import B from 'bluebird';
|
|
2
|
+
import {logger} from 'appium/support';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
import {errors} from 'appium/driver';
|
|
5
|
+
|
|
6
|
+
const XCTEST_TIMEOUT = 360000; // 60 minute timeout
|
|
7
|
+
|
|
8
|
+
const xctestLog = logger.getLogger('XCTest');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Asserts that IDB is present and that launchWithIDB was used
|
|
12
|
+
*
|
|
13
|
+
* @param {XCUITestDriver['opts']} opts Opts object from the driver instance
|
|
14
|
+
*/
|
|
15
|
+
export function assertIDB(opts) {
|
|
16
|
+
if (!this.device?.idb || !opts.launchWithIDB) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
`To use XCTest runner, IDB (https://github.com/facebook/idb) must be installed ` +
|
|
19
|
+
`and sessions must be run with the "launchWithIDB" capability`,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return this.device.idb;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Parse the stdout of XC test log
|
|
27
|
+
* @param {string} stdout A line of standard out from `idb xctest run ...`
|
|
28
|
+
* @returns {XCTestResult[]|string[]} results The final output of the XCTest run
|
|
29
|
+
*/
|
|
30
|
+
export function parseXCTestStdout(stdout) {
|
|
31
|
+
// Parses a 'key' into JSON format
|
|
32
|
+
function parseKey(name) {
|
|
33
|
+
const words = name.split(' ');
|
|
34
|
+
let out = '';
|
|
35
|
+
for (const word of words) {
|
|
36
|
+
out += word.substr(0, 1).toUpperCase() + word.substr(1);
|
|
37
|
+
}
|
|
38
|
+
return out.substr(0, 1).toLowerCase() + out.substr(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Parses a 'value' into JSON format
|
|
42
|
+
function parseValue(value) {
|
|
43
|
+
value = value || '';
|
|
44
|
+
switch (value.toLowerCase()) {
|
|
45
|
+
case 'true':
|
|
46
|
+
return true;
|
|
47
|
+
case 'false':
|
|
48
|
+
return false;
|
|
49
|
+
case '':
|
|
50
|
+
return null;
|
|
51
|
+
default:
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
if (!isNaN(value)) {
|
|
55
|
+
if (!_.isString(value)) {
|
|
56
|
+
return 0;
|
|
57
|
+
} else if (value.indexOf('.') > 0) {
|
|
58
|
+
return parseFloat(value);
|
|
59
|
+
}
|
|
60
|
+
return parseInt(value, 10);
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
if (!stdout) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Parse each line into an array
|
|
69
|
+
const lines = stdout.trim().split('\n');
|
|
70
|
+
|
|
71
|
+
// One single string, just return the string
|
|
72
|
+
if (lines.length === 1 && !lines[0].includes('|')) {
|
|
73
|
+
return [lines[0]];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** @type {XCTestResult[]} */
|
|
77
|
+
const results = [];
|
|
78
|
+
for (const line of lines) {
|
|
79
|
+
// The properties are split up by pipes and each property
|
|
80
|
+
// has the format "Some Key : Some Value"
|
|
81
|
+
const properties = line.split('|');
|
|
82
|
+
|
|
83
|
+
// Parse each property
|
|
84
|
+
/** @type {XCTestResult} */
|
|
85
|
+
const output = /** @type {any} */ ({});
|
|
86
|
+
let entryIndex = 0;
|
|
87
|
+
for (const prop of properties) {
|
|
88
|
+
if (entryIndex === 0) {
|
|
89
|
+
// The first property only contains one string that contains
|
|
90
|
+
// the test name (e.g.: 'XCTesterAppUITests - XCTesterAppUITests.XCTesterAppUITests/testExample')
|
|
91
|
+
output.testName = prop.trim();
|
|
92
|
+
} else if (prop.trim().startsWith('Location')) {
|
|
93
|
+
// The Location property has a value that comes after 'Location' without colon.
|
|
94
|
+
// e.g. Location /path/to/XCTesterAppUITests/XCTesterAppUITests.swift:36
|
|
95
|
+
output.location = prop.substring(prop.indexOf('Location') + 8).trim();
|
|
96
|
+
} else {
|
|
97
|
+
let [key, value] = prop.split(':');
|
|
98
|
+
output[parseKey(key.trim())] = parseValue(value ? value.trim() : '');
|
|
99
|
+
}
|
|
100
|
+
entryIndex++;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// keep backward compatibility
|
|
104
|
+
// old pattern: XCTesterAppUITests - XCTesterAppUITests.XCTesterAppUITests/testExample | Passed: True | Crashed: False | Duration: 1.485 | Failure message: | Location :0
|
|
105
|
+
// latest pattern: XCTesterAppUITests - XCTesterAppUITests.XCTesterAppUITests/testExample | Status: passed | Duration: 1.9255789518356323
|
|
106
|
+
if (!output.passed) {
|
|
107
|
+
output.passed = output.status === 'passed';
|
|
108
|
+
output.crashed = output.status === 'crashed';
|
|
109
|
+
} else if (!output.status) {
|
|
110
|
+
if (output.passed) {
|
|
111
|
+
output.status = 'passed';
|
|
112
|
+
} else if (output.crashed) {
|
|
113
|
+
output.status = 'crashed';
|
|
114
|
+
} else {
|
|
115
|
+
output.status = 'failed';
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Add this line to the results
|
|
120
|
+
results.push(output);
|
|
121
|
+
}
|
|
122
|
+
return results;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @typedef {Error} XCUITestError
|
|
127
|
+
*
|
|
128
|
+
* @property {number} code Subprocess exit code
|
|
129
|
+
* @property {string} signal The signal (SIG*) that caused the process to fail
|
|
130
|
+
* @property {XCTestResult[]} results The output of the failed test (if there is output)
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Run a native XCTest script.
|
|
135
|
+
*
|
|
136
|
+
* Launches a subprocess that runs the XC Test and blocks until it is completed. Parses the stdout of the process and returns its result as an array.
|
|
137
|
+
*
|
|
138
|
+
* **Facebook's [IDB](https://github.com/facebook/idb) tool is required** to run such tests; see [the idb docs](https://fbidb.io/docs/test-execution/) for reference.
|
|
139
|
+
*
|
|
140
|
+
* @param {string} testRunnerBundleId - Test app bundle (e.g.: `io.appium.XCTesterAppUITests.xctrunner`)
|
|
141
|
+
* @param {string} appUnderTestBundleId - App-under-test bundle
|
|
142
|
+
* @param {string} xcTestBundleId - XCTest bundle ID
|
|
143
|
+
* @param {string[]} args - Launch arguments to start the test with (see [reference documentation](https://developer.apple.com/documentation/xctest/xcuiapplication/1500477-launcharguments))
|
|
144
|
+
* @param {'app'|'ui'|'logic'} testType - XC test type
|
|
145
|
+
* @param {import('@appium/types').StringRecord} [env] - Environment variables passed to test
|
|
146
|
+
* @param {number} timeout - Timeout (in ms) for session completion.
|
|
147
|
+
* @throws {XCUITestError} Error thrown if subprocess returns non-zero exit code
|
|
148
|
+
* @returns {Promise<import('./types').RunXCTestResult>} The array of test results
|
|
149
|
+
* @this {XCUITestDriver}
|
|
150
|
+
*/
|
|
151
|
+
export async function mobileRunXCTest(
|
|
152
|
+
testRunnerBundleId,
|
|
153
|
+
appUnderTestBundleId,
|
|
154
|
+
xcTestBundleId,
|
|
155
|
+
args = [],
|
|
156
|
+
testType = 'ui',
|
|
157
|
+
env,
|
|
158
|
+
timeout = XCTEST_TIMEOUT,
|
|
159
|
+
) {
|
|
160
|
+
const subproc = await assertIDB(this.opts).runXCUITest(
|
|
161
|
+
testRunnerBundleId,
|
|
162
|
+
appUnderTestBundleId,
|
|
163
|
+
xcTestBundleId,
|
|
164
|
+
{env, args, testType},
|
|
165
|
+
);
|
|
166
|
+
return await new B((resolve, reject) => {
|
|
167
|
+
let mostRecentLogObject = null;
|
|
168
|
+
let xctestTimeout;
|
|
169
|
+
let lastErrorMessage = null;
|
|
170
|
+
if (timeout > 0) {
|
|
171
|
+
xctestTimeout = setTimeout(
|
|
172
|
+
() =>
|
|
173
|
+
reject(
|
|
174
|
+
new errors.TimeoutError(
|
|
175
|
+
`Timed out after '${timeout}ms' waiting for XCTest to complete`,
|
|
176
|
+
),
|
|
177
|
+
),
|
|
178
|
+
timeout,
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
subproc.on('output', (stdout, stderr) => {
|
|
183
|
+
if (stdout) {
|
|
184
|
+
try {
|
|
185
|
+
mostRecentLogObject = parseXCTestStdout(stdout);
|
|
186
|
+
} catch (err) {
|
|
187
|
+
// Fails if log parsing fails.
|
|
188
|
+
// This is in case IDB changes the way that logs are formatted and
|
|
189
|
+
// it breaks 'parseXCTestStdout'. If that happens we still want the process
|
|
190
|
+
// to finish
|
|
191
|
+
this.log.warn(`Failed to parse logs from test output: '${stdout}'`);
|
|
192
|
+
this.log.debug(err.stack);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (stderr) {
|
|
197
|
+
lastErrorMessage = stderr;
|
|
198
|
+
xctestLog.error(stderr);
|
|
199
|
+
}
|
|
200
|
+
if (stdout) {
|
|
201
|
+
xctestLog.info(stdout);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
subproc.on('exit', (code, signal) => {
|
|
206
|
+
clearTimeout(xctestTimeout);
|
|
207
|
+
if (code !== 0) {
|
|
208
|
+
const err = /** @type {any} */ (new Error(lastErrorMessage || mostRecentLogObject));
|
|
209
|
+
err.code = code;
|
|
210
|
+
if (signal != null) {
|
|
211
|
+
err.signal = signal;
|
|
212
|
+
}
|
|
213
|
+
if (mostRecentLogObject) {
|
|
214
|
+
err.result = mostRecentLogObject;
|
|
215
|
+
}
|
|
216
|
+
return reject(err);
|
|
217
|
+
}
|
|
218
|
+
resolve({
|
|
219
|
+
code,
|
|
220
|
+
signal,
|
|
221
|
+
results: mostRecentLogObject,
|
|
222
|
+
passed: true,
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Installs an XCTest bundle to the device under test.
|
|
230
|
+
*
|
|
231
|
+
* **Facebook's [IDB](https://github.com/facebook/idb) tool is required** for this command to work.
|
|
232
|
+
*
|
|
233
|
+
* @param {string} xctestApp - Path of the XCTest app (URL or filename with extension `.app`)
|
|
234
|
+
* @returns {Promise<void>}
|
|
235
|
+
* @this {XCUITestDriver}
|
|
236
|
+
*/
|
|
237
|
+
export async function mobileInstallXCTestBundle(xctestApp) {
|
|
238
|
+
if (!_.isString(xctestApp)) {
|
|
239
|
+
throw new errors.InvalidArgumentError(
|
|
240
|
+
`'xctestApp' is a required parameter for 'installXCTestBundle' and ` +
|
|
241
|
+
`must be a string. Found '${xctestApp}'`,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
xctestLog.info(`Installing bundle '${xctestApp}'`);
|
|
245
|
+
const idb = assertIDB(this.opts);
|
|
246
|
+
const res = await this.helpers.configureApp(xctestApp, '.xctest');
|
|
247
|
+
await idb.installXCTestBundle(res);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* List XCTest bundles that are installed on the device.
|
|
252
|
+
*
|
|
253
|
+
* **Facebook's [IDB](https://github.com/facebook/idb) tool is required** for this command to work.
|
|
254
|
+
*
|
|
255
|
+
* @returns {Promise<string[]>} List of XCTest bundles (e.g.: `XCTesterAppUITests.XCTesterAppUITests/testLaunchPerformance`)
|
|
256
|
+
* @this {XCUITestDriver}
|
|
257
|
+
*/
|
|
258
|
+
export async function mobileListXCTestBundles() {
|
|
259
|
+
return await assertIDB(this.opts).listXCTestBundles();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* List XCTests in a test bundle
|
|
264
|
+
*
|
|
265
|
+
* **Facebook's [IDB](https://github.com/facebook/idb) tool is required** for this command to work.
|
|
266
|
+
* @param {string} bundle - Bundle ID of the XCTest
|
|
267
|
+
*
|
|
268
|
+
* @returns {Promise<string[]>} The list of xctests in the test bundle (e.g., `['XCTesterAppUITests.XCTesterAppUITests/testExample', 'XCTesterAppUITests.XCTesterAppUITests/testLaunchPerformance']`)
|
|
269
|
+
* @this {XCUITestDriver}
|
|
270
|
+
*/
|
|
271
|
+
export async function mobileListXCTestsInTestBundle(bundle) {
|
|
272
|
+
if (!_.isString(bundle)) {
|
|
273
|
+
throw new errors.InvalidArgumentError(
|
|
274
|
+
`'bundle' is a required parameter for 'listXCTestsInTestBundle' and ` +
|
|
275
|
+
`must be a string. Found '${bundle}'`,
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
const idb = assertIDB(this.opts);
|
|
279
|
+
return await idb.listXCTestsInTestBundle(bundle);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
284
|
+
* @typedef {import('./types').XCTestResult} XCTestResult
|
|
285
|
+
*/
|