@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,202 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import {SubProcess, exec} from 'teen_process';
|
|
3
|
+
import {util} from 'appium/support';
|
|
4
|
+
import { LineConsumingLog } from './line-consuming-log';
|
|
5
|
+
import { transports, createLogger, format, Logger } from 'winston';
|
|
6
|
+
import type { Simulator } from '@limrun/appium-ios-simulator';
|
|
7
|
+
import type { AppiumLogger } from '@appium/types';
|
|
8
|
+
import fs from 'node:fs/promises';
|
|
9
|
+
|
|
10
|
+
const EXECVP_ERROR_PATTERN = /execvp\(\)/;
|
|
11
|
+
const LOG_STREAMING_PROCESS_NAME_PATTERN = /^com\.apple\.xpc\.launchd\.oneshot\.0x[0-f]+\.log$/;
|
|
12
|
+
|
|
13
|
+
const START_TIMEOUT = 10000;
|
|
14
|
+
|
|
15
|
+
export interface IOSSimulatorLogOptions {
|
|
16
|
+
sim: Simulator;
|
|
17
|
+
showLogs?: boolean;
|
|
18
|
+
iosSimulatorLogsPredicate?: string;
|
|
19
|
+
simulatorLogLevel?: string;
|
|
20
|
+
log: AppiumLogger;
|
|
21
|
+
iosSyslogFile?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class IOSSimulatorLog extends LineConsumingLog {
|
|
25
|
+
private readonly sim: Simulator;
|
|
26
|
+
private readonly showLogs: boolean;
|
|
27
|
+
private readonly predicate?: string;
|
|
28
|
+
private readonly logLevel?: string;
|
|
29
|
+
private proc: SubProcess | null;
|
|
30
|
+
private readonly iosSyslogFile?: string;
|
|
31
|
+
private syslogLogger: Logger | null;
|
|
32
|
+
|
|
33
|
+
constructor(opts: IOSSimulatorLogOptions) {
|
|
34
|
+
super({log: opts.log});
|
|
35
|
+
this.sim = opts.sim;
|
|
36
|
+
this.showLogs = !!opts.showLogs;
|
|
37
|
+
this.predicate = opts.iosSimulatorLogsPredicate;
|
|
38
|
+
this.logLevel = opts.simulatorLogLevel;
|
|
39
|
+
this.proc = null;
|
|
40
|
+
this.iosSyslogFile = opts.iosSyslogFile;
|
|
41
|
+
this.syslogLogger = null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
override async startCapture(): Promise<void> {
|
|
45
|
+
if (_.isUndefined(this.sim.udid)) {
|
|
46
|
+
throw new Error(`Log capture requires a sim udid`);
|
|
47
|
+
}
|
|
48
|
+
if (!(await this.sim.isRunning())) {
|
|
49
|
+
throw new Error(`iOS Simulator with udid '${this.sim.udid}' is not running`);
|
|
50
|
+
}
|
|
51
|
+
if (this.iosSyslogFile && this.showLogs) {
|
|
52
|
+
await this.clearExistingSyslog();
|
|
53
|
+
try {
|
|
54
|
+
this.syslogLogger = createLogger({
|
|
55
|
+
level: 'info',
|
|
56
|
+
format: format.combine(format.timestamp(), format.simple()),
|
|
57
|
+
transports: [new transports.File({filename: this.iosSyslogFile})],
|
|
58
|
+
exitOnError: false
|
|
59
|
+
});
|
|
60
|
+
this.log.debug(`iOS syslog will be written to: '${this.iosSyslogFile}'`);
|
|
61
|
+
} catch (e) {
|
|
62
|
+
this.log.warn(`Could not set up iOS syslog logger for '${this.iosSyslogFile}': ${e.message}`);
|
|
63
|
+
this.syslogLogger = null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const spawnArgs = ['log', 'stream', '--style', 'compact'];
|
|
67
|
+
if (this.predicate) {
|
|
68
|
+
spawnArgs.push('--predicate', this.predicate);
|
|
69
|
+
}
|
|
70
|
+
if (this.logLevel) {
|
|
71
|
+
spawnArgs.push('--level', this.logLevel);
|
|
72
|
+
}
|
|
73
|
+
this.log.debug(
|
|
74
|
+
`Starting log capture for iOS Simulator with udid '${this.sim.udid}' ` +
|
|
75
|
+
`via simctl using the following arguments '${util.quote(spawnArgs)}'`
|
|
76
|
+
);
|
|
77
|
+
await this.cleanupObsoleteLogStreams();
|
|
78
|
+
try {
|
|
79
|
+
this.proc = await this.sim.simctl.spawnSubProcess(spawnArgs);
|
|
80
|
+
await this.finishStartingLogCapture();
|
|
81
|
+
} catch (e) {
|
|
82
|
+
this.shutdownSyslogger();
|
|
83
|
+
throw new Error(`Simulator log capture failed. Original error: ${e.message}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
override async stopCapture(): Promise<void> {
|
|
88
|
+
if (!this.proc) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
await this.killLogSubProcess();
|
|
92
|
+
this.proc = null;
|
|
93
|
+
this.shutdownSyslogger();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
override get isCapturing(): boolean {
|
|
97
|
+
return Boolean(this.proc?.isRunning);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private async clearExistingSyslog(): Promise<void> {
|
|
101
|
+
if (this.iosSyslogFile === undefined) {
|
|
102
|
+
this.log.debug('iOS Syslog file path is not defined, skipping deletion.');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
await fs.unlink(this.iosSyslogFile);
|
|
107
|
+
this.log.debug(`Existing iOS Syslog file: '${this.iosSyslogFile}' deleted.`);
|
|
108
|
+
} catch (unlinkErr) {
|
|
109
|
+
if (unlinkErr.code !== 'ENOENT') {
|
|
110
|
+
this.log.warn(`Could not delete existing syslog file '${this.iosSyslogFile}': ${unlinkErr.message}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private shutdownSyslogger(): void {
|
|
116
|
+
if (this.syslogLogger) {
|
|
117
|
+
this.log.debug(`Closing iOS syslog file: '${this.iosSyslogFile}'`);
|
|
118
|
+
const fileTransport = this.syslogLogger.transports.find(
|
|
119
|
+
(t) => (t instanceof transports.File) && (t.filename === this.iosSyslogFile)
|
|
120
|
+
);
|
|
121
|
+
if (fileTransport) {
|
|
122
|
+
fileTransport.end?.();
|
|
123
|
+
this.syslogLogger.remove(fileTransport);
|
|
124
|
+
}
|
|
125
|
+
this.syslogLogger = null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
private onOutput(logRow: string, prefix: string = ''): void {
|
|
130
|
+
this.broadcast(logRow);
|
|
131
|
+
const space = prefix.length > 0 ? ' ' : '';
|
|
132
|
+
if (this.showLogs && !this.iosSyslogFile) {
|
|
133
|
+
this.log.info(`[IOS_SYSLOG_ROW${space}${prefix}] ${logRow}`);
|
|
134
|
+
} else if (this.iosSyslogFile && this.showLogs) {
|
|
135
|
+
this.writeToSyslogFile(`[IOS_SYSLOG_ROW${space}${prefix}] ${logRow}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Writes the given log row to the dedicated iOS syslog file if the logger is active.
|
|
141
|
+
* @param {string} logRow - The log line to write.
|
|
142
|
+
* @private
|
|
143
|
+
*/
|
|
144
|
+
private writeToSyslogFile(logRow: string): void {
|
|
145
|
+
if (this.syslogLogger && this.showLogs) {
|
|
146
|
+
this.syslogLogger.info(logRow);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
private async killLogSubProcess(): Promise<void> {
|
|
151
|
+
if (!this.proc?.isRunning) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
this.log.debug('Stopping iOS log capture');
|
|
155
|
+
try {
|
|
156
|
+
await this.proc.stop('SIGTERM', 1000);
|
|
157
|
+
} catch {
|
|
158
|
+
if (!this.proc.isRunning) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
this.log.warn('Cannot stop log capture process. Sending SIGKILL');
|
|
162
|
+
await this.proc.stop('SIGKILL');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private async finishStartingLogCapture(): Promise<void> {
|
|
167
|
+
if (!this.proc) {
|
|
168
|
+
throw this.log.errorWithException('Could not capture simulator log');
|
|
169
|
+
}
|
|
170
|
+
for (const streamName of ['stdout', 'stderr']) {
|
|
171
|
+
this.proc.on(`line-${streamName}`, (line: string) => {
|
|
172
|
+
this.onOutput(line, ...(streamName === 'stderr' ? ['STDERR'] : []));
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
const startDetector = (stdout: string, stderr: string) => {
|
|
176
|
+
if (EXECVP_ERROR_PATTERN.test(stderr)) {
|
|
177
|
+
throw new Error('iOS log capture process failed to start');
|
|
178
|
+
}
|
|
179
|
+
return Boolean(stdout || stderr);
|
|
180
|
+
};
|
|
181
|
+
await this.proc.start(startDetector, START_TIMEOUT);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private async cleanupObsoleteLogStreams(): Promise<void> {
|
|
185
|
+
const processes = await this.sim.ps();
|
|
186
|
+
const pids = processes
|
|
187
|
+
.filter(({name}) => LOG_STREAMING_PROCESS_NAME_PATTERN.test(name))
|
|
188
|
+
.map(({pid}) => pid);
|
|
189
|
+
if (_.isEmpty(pids)) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
await exec('kill', pids.map(String));
|
|
194
|
+
} catch (e) {
|
|
195
|
+
this.log.warn(
|
|
196
|
+
`Could not terminate one or more obsolete log streams: ${e.stderr || e.message}`
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export default IOSSimulatorLog;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {IOSLog} from './ios-log';
|
|
2
|
+
import { toLogEntry } from './helpers';
|
|
3
|
+
import type { LogEntry } from '../commands/types';
|
|
4
|
+
|
|
5
|
+
type TSerializedEntry = [string, number];
|
|
6
|
+
|
|
7
|
+
export abstract class LineConsumingLog extends IOSLog<string, TSerializedEntry> {
|
|
8
|
+
protected override _serializeEntry(value: string): TSerializedEntry {
|
|
9
|
+
return [value, Date.now()];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
protected override _deserializeEntry(value: TSerializedEntry): LogEntry {
|
|
13
|
+
const [message, timestamp] = value;
|
|
14
|
+
return toLogEntry(message, timestamp);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import type { AppiumLogger } from '@appium/types';
|
|
3
|
+
import {
|
|
4
|
+
toLogEntry,
|
|
5
|
+
DEFAULT_LOG_LEVEL,
|
|
6
|
+
MAX_JSON_LOG_LENGTH,
|
|
7
|
+
MAX_BUFFERED_EVENTS_COUNT
|
|
8
|
+
} from './helpers';
|
|
9
|
+
import { IOSLog } from './ios-log';
|
|
10
|
+
import type { LogEntry } from '../commands/types';
|
|
11
|
+
|
|
12
|
+
const LOG_LEVELS_MAP = {
|
|
13
|
+
error: 'SEVERE',
|
|
14
|
+
warning: 'WARNING',
|
|
15
|
+
log: 'FINE',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export interface SafariConsoleLogOptions {
|
|
19
|
+
showLogs: boolean;
|
|
20
|
+
log: AppiumLogger;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SafariConsoleStacktraceEntry {
|
|
24
|
+
functionName: string;
|
|
25
|
+
url: string;
|
|
26
|
+
scriptId: number;
|
|
27
|
+
lineNumber: number;
|
|
28
|
+
columnNumber: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface SafariConsoleEntry {
|
|
32
|
+
source: string;
|
|
33
|
+
level: string;
|
|
34
|
+
text: string;
|
|
35
|
+
type: string;
|
|
36
|
+
line: number;
|
|
37
|
+
column: number;
|
|
38
|
+
url?: string;
|
|
39
|
+
repeatCount: number;
|
|
40
|
+
stackTrace: SafariConsoleStacktraceEntry[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type TSerializedEntry = [SafariConsoleEntry, number];
|
|
44
|
+
|
|
45
|
+
export class SafariConsoleLog extends IOSLog<SafariConsoleEntry, TSerializedEntry> {
|
|
46
|
+
private readonly _showLogs: boolean;
|
|
47
|
+
|
|
48
|
+
constructor(opts: SafariConsoleLogOptions) {
|
|
49
|
+
super({
|
|
50
|
+
log: opts.log,
|
|
51
|
+
maxBufferSize: MAX_BUFFERED_EVENTS_COUNT,
|
|
52
|
+
});
|
|
53
|
+
this._showLogs = opts.showLogs;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
override async startCapture(): Promise<void> {}
|
|
57
|
+
override async stopCapture(): Promise<void> {}
|
|
58
|
+
override get isCapturing(): boolean {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param err
|
|
65
|
+
* @param entry The output will be like:
|
|
66
|
+
* {
|
|
67
|
+
* "source": "javascript",
|
|
68
|
+
* "level":"error",
|
|
69
|
+
* "text":"ReferenceError: Can't find variable: s_account",
|
|
70
|
+
* "type":"log",
|
|
71
|
+
* "line":2,
|
|
72
|
+
* "column":21,
|
|
73
|
+
* "url":"https://assets.adobedtm.com/b46e318d845250834eda10c5a20827c045a4d76f/scripts/satellite-57866f8b64746d53a8000104-staging.js",
|
|
74
|
+
* "repeatCount":1,
|
|
75
|
+
* "stackTrace":[{
|
|
76
|
+
* "functionName":"global code",
|
|
77
|
+
* "url":"https://assets.adobedtm.com/b46e318d845250834eda10c5a20827c045a4d76f/scripts/satellite-57866f8b64746d53a8000104-staging.js",
|
|
78
|
+
* "scriptId":"6",
|
|
79
|
+
* "lineNumber":2,
|
|
80
|
+
* "columnNumber":21
|
|
81
|
+
* }]
|
|
82
|
+
* }
|
|
83
|
+
*
|
|
84
|
+
* we need, at least, `level` (in accordance with Java levels
|
|
85
|
+
* (https://docs.oracle.com/javase/7/docs/api/java/util/logging/Level.html)),
|
|
86
|
+
* `timestamp`, and `message` to satisfy the java client. In order to
|
|
87
|
+
* provide all the information to the client, `message` is the full
|
|
88
|
+
* object, stringified.
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
onConsoleLogEvent(err?: Error, entry?: SafariConsoleEntry): void {
|
|
92
|
+
if (!entry) {
|
|
93
|
+
this.log.debug(`[SafariConsole] Ignoring empty console log entry: ${err?.message}`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this.broadcast(entry);
|
|
98
|
+
if (this._showLogs) {
|
|
99
|
+
this.log.info(`[SafariConsole] ${_.truncate(JSON.stringify(entry), {length: MAX_JSON_LOG_LENGTH})}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
protected override _serializeEntry(value: SafariConsoleEntry): TSerializedEntry {
|
|
104
|
+
return [value, Date.now()];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
protected override _deserializeEntry(value: TSerializedEntry): LogEntry {
|
|
108
|
+
const [entry, timestamp] = value;
|
|
109
|
+
return toLogEntry(JSON.stringify(entry), timestamp, mapLogLevel(entry.level));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function mapLogLevel(originalLevel: string): string {
|
|
114
|
+
return LOG_LEVELS_MAP[originalLevel] ?? DEFAULT_LOG_LEVEL;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export default SafariConsoleLog;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import { LineConsumingLog } from './line-consuming-log';
|
|
3
|
+
import { MAX_JSON_LOG_LENGTH, MAX_BUFFERED_EVENTS_COUNT } from './helpers';
|
|
4
|
+
import type { AppiumLogger, StringRecord } from '@appium/types';
|
|
5
|
+
|
|
6
|
+
const EVENTS_TO_LOG = [
|
|
7
|
+
'Network.loadingFinished',
|
|
8
|
+
'Network.loadingFailed',
|
|
9
|
+
];
|
|
10
|
+
const MONITORED_EVENTS = [
|
|
11
|
+
'Network.requestWillBeSent',
|
|
12
|
+
'Network.responseReceived',
|
|
13
|
+
...EVENTS_TO_LOG,
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export interface SafariConsoleLogOptions {
|
|
17
|
+
showLogs: boolean;
|
|
18
|
+
log: AppiumLogger;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SafariNetworkResponseTiming {
|
|
22
|
+
startTime: number;
|
|
23
|
+
redirectStart: number;
|
|
24
|
+
redirectEnd: number;
|
|
25
|
+
fetchStart: number;
|
|
26
|
+
domainLookupStart: number;
|
|
27
|
+
domainLookupEnd: number;
|
|
28
|
+
connectStart: number;
|
|
29
|
+
connectEnd: number;
|
|
30
|
+
secureConnectionStart: number;
|
|
31
|
+
requestStart: number;
|
|
32
|
+
responseStart: number;
|
|
33
|
+
responseEnd: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface SafariNetworkResponse {
|
|
37
|
+
url: string;
|
|
38
|
+
status: number;
|
|
39
|
+
statusText: string;
|
|
40
|
+
headers: Record<string, string>;
|
|
41
|
+
mimeType: string;
|
|
42
|
+
timing: SafariNetworkResponseTiming;
|
|
43
|
+
source: string;
|
|
44
|
+
security: StringRecord
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface SafariNetworkLogEntryMetrics {
|
|
48
|
+
requestHeaderBytesSent: number;
|
|
49
|
+
requestBodyBytesSent: number;
|
|
50
|
+
responseHeaderBytesReceived: number;
|
|
51
|
+
isProxyConnection: boolean;
|
|
52
|
+
responseBodyBytesReceived: number;
|
|
53
|
+
responseBodyDecodedSize: number;
|
|
54
|
+
securityConnection: StringRecord;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface SafariNetworkRequest {
|
|
58
|
+
url: string;
|
|
59
|
+
method: string;
|
|
60
|
+
headers: Record<string, string>;
|
|
61
|
+
rereferrerPolicy: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface SafariNetworkRequestInitiator {
|
|
65
|
+
type: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface SafariNetworkLogEntry {
|
|
69
|
+
requestId: string;
|
|
70
|
+
frameId?: string;
|
|
71
|
+
loaderId?: string;
|
|
72
|
+
documentURL?: string;
|
|
73
|
+
request?: SafariNetworkRequest
|
|
74
|
+
timestamp?: number;
|
|
75
|
+
walltime?: number;
|
|
76
|
+
inititator?: SafariNetworkRequestInitiator;
|
|
77
|
+
response?: SafariNetworkResponse;
|
|
78
|
+
type?: string;
|
|
79
|
+
initiator?: string;
|
|
80
|
+
// Safari has a `metrics` object on it's `Network.loadingFinished` event
|
|
81
|
+
metrics?: SafariNetworkLogEntryMetrics;
|
|
82
|
+
errorText?: string;
|
|
83
|
+
// When a network call is cancelled, Safari returns `cancelled` as error text
|
|
84
|
+
// but has a boolean `canceled`.
|
|
85
|
+
canceled?: boolean;
|
|
86
|
+
[key: string]: any; // Allow additional properties
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export class SafariNetworkLog extends LineConsumingLog {
|
|
90
|
+
private readonly _showLogs: boolean;
|
|
91
|
+
|
|
92
|
+
constructor(opts: SafariConsoleLogOptions) {
|
|
93
|
+
super({
|
|
94
|
+
log: opts.log,
|
|
95
|
+
maxBufferSize: MAX_BUFFERED_EVENTS_COUNT,
|
|
96
|
+
});
|
|
97
|
+
this._showLogs = opts.showLogs;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
override async startCapture(): Promise<void> {}
|
|
101
|
+
override async stopCapture(): Promise<void> {}
|
|
102
|
+
override get isCapturing(): boolean {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
onNetworkEvent(err?: Error, entry?: SafariNetworkLogEntry, method?: string): void {
|
|
107
|
+
if (!_.includes(MONITORED_EVENTS, method)) {
|
|
108
|
+
this.log.debug(`[SafariNetwork] Ignoring unmonitored event: ${method}`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const serializedEntry = JSON.stringify({method, event: entry});
|
|
113
|
+
this.broadcast(serializedEntry);
|
|
114
|
+
if (this._showLogs && _.includes(EVENTS_TO_LOG, method)) {
|
|
115
|
+
this.log.info(`[SafariNetwork] ${_.truncate(serializedEntry, {length: MAX_JSON_LOG_LENGTH})}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default SafariNetworkLog;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {resolveExecutablePath} from './utils';
|
|
2
|
+
import {doctor} from 'appium/support';
|
|
3
|
+
import type {IDoctorCheck, AppiumLogger, DoctorCheckResult} from '@appium/types';
|
|
4
|
+
import '@colors/colors';
|
|
5
|
+
import {exec} from 'teen_process';
|
|
6
|
+
|
|
7
|
+
export class OptionalIdbCommandCheck implements IDoctorCheck {
|
|
8
|
+
log!: AppiumLogger;
|
|
9
|
+
static readonly IDB_README_URL = 'https://git.io/JnxQc';
|
|
10
|
+
|
|
11
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
12
|
+
const fbIdbPath = await resolveExecutablePath('idb');
|
|
13
|
+
const fbCompanionIdbPath = await resolveExecutablePath('idb_companion');
|
|
14
|
+
if (fbIdbPath && fbCompanionIdbPath) {
|
|
15
|
+
return doctor.okOptional('idb and idb_companion are installed');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (!fbIdbPath && fbCompanionIdbPath) {
|
|
19
|
+
return doctor.nokOptional('idb is not installed');
|
|
20
|
+
} else if (fbIdbPath && !fbCompanionIdbPath) {
|
|
21
|
+
return doctor.nokOptional('idb_companion is not installed');
|
|
22
|
+
}
|
|
23
|
+
return doctor.nokOptional('idb and idb_companion are not installed');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async fix(): Promise<string> {
|
|
27
|
+
return `Why ${'idb'.bold} is needed and how to install it: ${OptionalIdbCommandCheck.IDB_README_URL}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
hasAutofix(): boolean {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
isOptional(): boolean {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export const optionalIdbCheck = new OptionalIdbCommandCheck();
|
|
39
|
+
|
|
40
|
+
export class OptionalSimulatorCheck implements IDoctorCheck {
|
|
41
|
+
log!: AppiumLogger;
|
|
42
|
+
static readonly SUPPORTED_SIMULATOR_PLATFORMS: SimulatorPlatform[] = [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'iOS',
|
|
45
|
+
name: 'iphonesimulator'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'tvOS',
|
|
49
|
+
name: 'appletvsimulator'
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
54
|
+
try {
|
|
55
|
+
// https://github.com/appium/appium/issues/12093#issuecomment-459358120
|
|
56
|
+
await exec('xcrun', ['simctl', 'help']);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
return doctor.nokOptional(
|
|
59
|
+
`Testing on Simulator is not possible. Cannot run 'xcrun simctl': ${(err as any).stderr || (err as Error).message}`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const sdks = await this._listInstalledSdks();
|
|
64
|
+
for (const {displayName, name} of OptionalSimulatorCheck.SUPPORTED_SIMULATOR_PLATFORMS) {
|
|
65
|
+
const errorPrefix = `Testing on ${displayName} Simulator is not possible`;
|
|
66
|
+
if (!sdks.some(({platform}) => platform === name)) {
|
|
67
|
+
return doctor.nokOptional(`${errorPrefix}: SDK is not installed`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return doctor.okOptional(
|
|
72
|
+
`The following Simulator SDKs are installed:\n` +
|
|
73
|
+
sdks
|
|
74
|
+
.filter(({platform}) => OptionalSimulatorCheck.SUPPORTED_SIMULATOR_PLATFORMS.some(({name}) => name === platform))
|
|
75
|
+
.map(({displayName}) => `\t→ ${displayName}`).join('\n')
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async fix(): Promise<string> {
|
|
80
|
+
return `Install the desired Simulator SDK from Xcode's Settings -> Components`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
hasAutofix(): boolean {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
isOptional(): boolean {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private async _listInstalledSdks(): Promise<InstalledSdk[]> {
|
|
92
|
+
const {stdout} = await exec('xcodebuild', ['-json', '-showsdks']);
|
|
93
|
+
return JSON.parse(stdout);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export const optionalSimulatorCheck = new OptionalSimulatorCheck();
|
|
97
|
+
|
|
98
|
+
export class OptionalApplesimutilsCommandCheck implements IDoctorCheck {
|
|
99
|
+
log!: AppiumLogger;
|
|
100
|
+
static readonly README_LINK = 'https://github.com/appium/appium-xcuitest-driver/blob/master/docs/reference/execute-methods.md#mobile-setpermission';
|
|
101
|
+
|
|
102
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
103
|
+
const applesimutilsPath = await resolveExecutablePath('applesimutils');
|
|
104
|
+
return applesimutilsPath
|
|
105
|
+
? doctor.okOptional(`applesimutils is installed at: ${applesimutilsPath}`)
|
|
106
|
+
: doctor.nokOptional('applesimutils are not installed');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async fix(): Promise<string> {
|
|
110
|
+
return `Why ${'applesimutils'.bold} is needed and how to install it: ${OptionalApplesimutilsCommandCheck.README_LINK}`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
hasAutofix(): boolean {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
isOptional(): boolean {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export const optionalApplesimutilsCheck = new OptionalApplesimutilsCommandCheck();
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
export class OptionalFfmpegCheck implements IDoctorCheck {
|
|
125
|
+
log!: AppiumLogger;
|
|
126
|
+
static readonly FFMPEG_BINARY = 'ffmpeg';
|
|
127
|
+
static readonly FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
128
|
+
|
|
129
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
130
|
+
const ffmpegPath = await resolveExecutablePath(OptionalFfmpegCheck.FFMPEG_BINARY);
|
|
131
|
+
|
|
132
|
+
return ffmpegPath
|
|
133
|
+
? doctor.okOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
|
|
134
|
+
: doctor.nokOptional(`${OptionalFfmpegCheck.FFMPEG_BINARY} cannot be found`);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async fix(): Promise<string> {
|
|
138
|
+
return (
|
|
139
|
+
`${`${OptionalFfmpegCheck.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
|
|
140
|
+
`Please read ${OptionalFfmpegCheck.FFMPEG_INSTALL_LINK}.`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
hasAutofix(): boolean {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
isOptional(): boolean {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
export const optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
153
|
+
|
|
154
|
+
interface SimulatorPlatform {
|
|
155
|
+
displayName: string;
|
|
156
|
+
name: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
interface InstalledSdk {
|
|
160
|
+
buildID?: string;
|
|
161
|
+
canonicalName: string;
|
|
162
|
+
displayName: string;
|
|
163
|
+
isBaseSdk: boolean;
|
|
164
|
+
platform: string;
|
|
165
|
+
platformPath: string;
|
|
166
|
+
platformVersion: string;
|
|
167
|
+
productBuildVersion?: string;
|
|
168
|
+
productCopyright?: string;
|
|
169
|
+
productName?: string;
|
|
170
|
+
productVersion?: string;
|
|
171
|
+
sdkPath: string;
|
|
172
|
+
sdkVersion: string;
|
|
173
|
+
}
|