@solidxai/core 0.1.22-beta.1 → 0.1.22-beta.2
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 +16 -0
- package/dist/controllers/module-package.controller.d.ts +198 -0
- package/dist/controllers/module-package.controller.d.ts.map +1 -1
- package/dist/controllers/test-run.controller.d.ts +5 -0
- package/dist/controllers/test-run.controller.d.ts.map +1 -1
- package/dist/controllers/test-run.controller.js +17 -0
- package/dist/controllers/test-run.controller.js.map +1 -1
- package/dist/dtos/confirm-module-package-import.dto.d.ts +2 -0
- package/dist/dtos/confirm-module-package-import.dto.d.ts.map +1 -1
- package/dist/dtos/confirm-module-package-import.dto.js +21 -1
- package/dist/dtos/confirm-module-package-import.dto.js.map +1 -1
- package/dist/dtos/create-field-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-field-metadata.dto.js +3 -3
- package/dist/dtos/create-field-metadata.dto.js.map +1 -1
- package/dist/dtos/create-model-metadata.dto.d.ts +6 -6
- package/dist/dtos/create-model-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-model-metadata.dto.js +13 -7
- package/dist/dtos/create-model-metadata.dto.js.map +1 -1
- package/dist/dtos/test-run-request.dto.d.ts +12 -1
- package/dist/dtos/test-run-request.dto.d.ts.map +1 -1
- package/dist/dtos/test-run-request.dto.js +16 -1
- package/dist/dtos/test-run-request.dto.js.map +1 -1
- package/dist/helpers/module-package-sync.helper.d.ts +71 -0
- package/dist/helpers/module-package-sync.helper.d.ts.map +1 -0
- package/dist/helpers/module-package-sync.helper.js +318 -0
- package/dist/helpers/module-package-sync.helper.js.map +1 -0
- package/dist/helpers/module-package-sync.helper.spec.d.ts +2 -0
- package/dist/helpers/module-package-sync.helper.spec.d.ts.map +1 -0
- package/dist/helpers/module-package-sync.helper.spec.js +229 -0
- package/dist/helpers/module-package-sync.helper.spec.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts +3 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.js +19 -6
- package/dist/jobs/database/test-run-queue-subscriber-database.service.js.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts +9 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +138 -0
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +0 -47
- package/dist/services/module-package.service.d.ts +38 -0
- package/dist/services/module-package.service.d.ts.map +1 -1
- package/dist/services/module-package.service.js +314 -33
- package/dist/services/module-package.service.js.map +1 -1
- package/dist/services/module-package.service.spec.d.ts +2 -0
- package/dist/services/module-package.service.spec.d.ts.map +1 -0
- package/dist/services/module-package.service.spec.js +347 -0
- package/dist/services/module-package.service.spec.js.map +1 -0
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +5 -4
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/testing/__integration__/mobile-emulator.integration.d.ts +2 -0
- package/dist/testing/__integration__/mobile-emulator.integration.d.ts.map +1 -0
- package/dist/testing/__integration__/mobile-emulator.integration.js +368 -0
- package/dist/testing/__integration__/mobile-emulator.integration.js.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.d.ts +4 -0
- package/dist/testing/adapters/mobile/capabilities.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.js +85 -0
- package/dist/testing/adapters/mobile/capabilities.js.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/capabilities.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.spec.js +215 -0
- package/dist/testing/adapters/mobile/capabilities.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/fake-driver.d.ts +113 -0
- package/dist/testing/adapters/mobile/fake-driver.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/fake-driver.js +122 -0
- package/dist/testing/adapters/mobile/fake-driver.js.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.d.ts +31 -0
- package/dist/testing/adapters/mobile/ios-keyboard.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.js +157 -0
- package/dist/testing/adapters/mobile/ios-keyboard.js.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.js +36 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/locator.d.ts +12 -0
- package/dist/testing/adapters/mobile/locator.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/locator.js +96 -0
- package/dist/testing/adapters/mobile/locator.js.map +1 -0
- package/dist/testing/adapters/mobile/locator.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/locator.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/locator.spec.js +136 -0
- package/dist/testing/adapters/mobile/locator.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/logcat.d.ts +9 -0
- package/dist/testing/adapters/mobile/logcat.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/logcat.js +28 -0
- package/dist/testing/adapters/mobile/logcat.js.map +1 -0
- package/dist/testing/adapters/mobile/logcat.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/logcat.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/logcat.spec.js +46 -0
- package/dist/testing/adapters/mobile/logcat.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.d.ts +67 -0
- package/dist/testing/adapters/mobile/mobile-adapter.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.js +240 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.js +494 -0
- package/dist/testing/adapters/mobile/mobile-adapter.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.js +567 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile.types.d.ts +111 -0
- package/dist/testing/adapters/mobile/mobile.types.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile.types.js +3 -0
- package/dist/testing/adapters/mobile/mobile.types.js.map +1 -0
- package/dist/testing/adapters/mobile/phone-errors.d.ts +6 -0
- package/dist/testing/adapters/mobile/phone-errors.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/phone-errors.js +43 -0
- package/dist/testing/adapters/mobile/phone-errors.js.map +1 -0
- package/dist/testing/adapters/mobile/platform.d.ts +7 -0
- package/dist/testing/adapters/mobile/platform.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/platform.js +11 -0
- package/dist/testing/adapters/mobile/platform.js.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.d.ts +6 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.js +95 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.js.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.js +199 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/run-options.d.ts +11 -0
- package/dist/testing/adapters/mobile/run-options.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/run-options.js +41 -0
- package/dist/testing/adapters/mobile/run-options.js.map +1 -0
- package/dist/testing/adapters/mobile/run-options.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/run-options.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/run-options.spec.js +100 -0
- package/dist/testing/adapters/mobile/run-options.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/syslog.d.ts +9 -0
- package/dist/testing/adapters/mobile/syslog.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/syslog.js +45 -0
- package/dist/testing/adapters/mobile/syslog.js.map +1 -0
- package/dist/testing/adapters/mobile/syslog.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/syslog.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/syslog.spec.js +81 -0
- package/dist/testing/adapters/mobile/syslog.spec.js.map +1 -0
- package/dist/testing/adapters/ui/playwright-adapter.d.ts +24 -3
- package/dist/testing/adapters/ui/playwright-adapter.d.ts.map +1 -1
- package/dist/testing/adapters/ui/playwright-adapter.js +113 -14
- package/dist/testing/adapters/ui/playwright-adapter.js.map +1 -1
- package/dist/testing/adapters/ui/resolve-target.d.ts +12 -0
- package/dist/testing/adapters/ui/resolve-target.d.ts.map +1 -0
- package/dist/testing/adapters/ui/resolve-target.js +95 -0
- package/dist/testing/adapters/ui/resolve-target.js.map +1 -0
- package/dist/testing/adapters/ui/ui.types.d.ts +12 -0
- package/dist/testing/adapters/ui/ui.types.d.ts.map +1 -1
- package/dist/testing/adapters/ui/ui.types.js.map +1 -1
- package/dist/testing/contracts/runtime-context.types.d.ts +14 -0
- package/dist/testing/contracts/runtime-context.types.d.ts.map +1 -1
- package/dist/testing/contracts/runtime-context.types.js.map +1 -1
- package/dist/testing/contracts/testing-metadata.types.d.ts +28 -1
- package/dist/testing/contracts/testing-metadata.types.d.ts.map +1 -1
- package/dist/testing/contracts/testing-metadata.types.js.map +1 -1
- package/dist/testing/core/step-registry.d.ts +1 -0
- package/dist/testing/core/step-registry.d.ts.map +1 -1
- package/dist/testing/core/step-registry.js +3 -0
- package/dist/testing/core/step-registry.js.map +1 -1
- package/dist/testing/core/testing-engine.d.ts +16 -4
- package/dist/testing/core/testing-engine.d.ts.map +1 -1
- package/dist/testing/core/testing-engine.js +109 -33
- package/dist/testing/core/testing-engine.js.map +1 -1
- package/dist/testing/reporter/console-reporter.d.ts +7 -13
- package/dist/testing/reporter/console-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/console-reporter.js +15 -1
- package/dist/testing/reporter/console-reporter.js.map +1 -1
- package/dist/testing/reporter/file-service-artifact-sink.d.ts +2 -0
- package/dist/testing/reporter/file-service-artifact-sink.d.ts.map +1 -1
- package/dist/testing/reporter/file-service-artifact-sink.js +2 -1
- package/dist/testing/reporter/file-service-artifact-sink.js.map +1 -1
- package/dist/testing/reporter/lifecycle-events.types.d.ts +11 -0
- package/dist/testing/reporter/lifecycle-events.types.d.ts.map +1 -1
- package/dist/testing/reporter/lifecycle-events.types.js.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts +7 -5
- package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.js +25 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.js.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.d.ts +2 -0
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.d.ts.map +1 -0
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.js +72 -0
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.js.map +1 -0
- package/dist/testing/reporter/progress-reporter.d.ts +4 -13
- package/dist/testing/reporter/progress-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/progress-reporter.js +5 -1
- package/dist/testing/reporter/progress-reporter.js.map +1 -1
- package/dist/testing/reporter/reporter.types.d.ts +27 -13
- package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
- package/dist/testing/reporter/reporter.types.js.map +1 -1
- package/dist/testing/runner/lifecycle.d.ts +8 -0
- package/dist/testing/runner/lifecycle.d.ts.map +1 -1
- package/dist/testing/runner/lifecycle.js +80 -0
- package/dist/testing/runner/lifecycle.js.map +1 -1
- package/dist/testing/runner/lifecycle.spec.d.ts +2 -0
- package/dist/testing/runner/lifecycle.spec.d.ts.map +1 -0
- package/dist/testing/runner/lifecycle.spec.js +33 -0
- package/dist/testing/runner/lifecycle.spec.js.map +1 -0
- package/dist/testing/runner/mobile-session.d.ts +24 -0
- package/dist/testing/runner/mobile-session.d.ts.map +1 -0
- package/dist/testing/runner/mobile-session.js +96 -0
- package/dist/testing/runner/mobile-session.js.map +1 -0
- package/dist/testing/runner/mobile-session.spec.d.ts +2 -0
- package/dist/testing/runner/mobile-session.spec.d.ts.map +1 -0
- package/dist/testing/runner/mobile-session.spec.js +89 -0
- package/dist/testing/runner/mobile-session.spec.js.map +1 -0
- package/dist/testing/runner/recording-reporter.d.ts +62 -0
- package/dist/testing/runner/recording-reporter.d.ts.map +1 -0
- package/dist/testing/runner/recording-reporter.js +35 -0
- package/dist/testing/runner/recording-reporter.js.map +1 -0
- package/dist/testing/runner/run-cancellation.d.ts +7 -0
- package/dist/testing/runner/run-cancellation.d.ts.map +1 -0
- package/dist/testing/runner/run-cancellation.js +30 -0
- package/dist/testing/runner/run-cancellation.js.map +1 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.d.ts +2 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.d.ts.map +1 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.js +58 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.js.map +1 -0
- package/dist/testing/runner/run-from-metadata.d.ts +4 -0
- package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
- package/dist/testing/runner/run-from-metadata.js +152 -25
- package/dist/testing/runner/run-from-metadata.js.map +1 -1
- package/dist/testing/runner/run-from-metadata.mobile.spec.d.ts +2 -0
- package/dist/testing/runner/run-from-metadata.mobile.spec.d.ts.map +1 -0
- package/dist/testing/runner/run-from-metadata.mobile.spec.js +498 -0
- package/dist/testing/runner/run-from-metadata.mobile.spec.js.map +1 -0
- package/dist/testing/runner/run-from-metadata.spec.js +188 -0
- package/dist/testing/runner/run-from-metadata.spec.js.map +1 -1
- package/dist/testing/runner/scenario-graph.d.ts +8 -0
- package/dist/testing/runner/scenario-graph.d.ts.map +1 -0
- package/dist/testing/runner/scenario-graph.js +120 -0
- package/dist/testing/runner/scenario-graph.js.map +1 -0
- package/dist/testing/runner/scenario-graph.spec.d.ts +2 -0
- package/dist/testing/runner/scenario-graph.spec.d.ts.map +1 -0
- package/dist/testing/runner/scenario-graph.spec.js +97 -0
- package/dist/testing/runner/scenario-graph.spec.js.map +1 -0
- package/dist/testing/runtime/default-registry.d.ts +3 -0
- package/dist/testing/runtime/default-registry.d.ts.map +1 -0
- package/dist/testing/runtime/default-registry.js +21 -0
- package/dist/testing/runtime/default-registry.js.map +1 -0
- package/dist/testing/runtime/index.d.ts +22 -0
- package/dist/testing/runtime/index.d.ts.map +1 -0
- package/dist/testing/runtime/index.js +63 -0
- package/dist/testing/runtime/index.js.map +1 -0
- package/dist/testing/runtime/mobile-step-executor.spec.d.ts +2 -0
- package/dist/testing/runtime/mobile-step-executor.spec.d.ts.map +1 -0
- package/dist/testing/runtime/mobile-step-executor.spec.js +157 -0
- package/dist/testing/runtime/mobile-step-executor.spec.js.map +1 -0
- package/dist/testing/runtime/step-executor.d.ts +92 -0
- package/dist/testing/runtime/step-executor.d.ts.map +1 -0
- package/dist/testing/runtime/step-executor.js +171 -0
- package/dist/testing/runtime/step-executor.js.map +1 -0
- package/dist/testing/runtime/step-executor.spec.d.ts +2 -0
- package/dist/testing/runtime/step-executor.spec.d.ts.map +1 -0
- package/dist/testing/runtime/step-executor.spec.js +137 -0
- package/dist/testing/runtime/step-executor.spec.js.map +1 -0
- package/dist/testing/steps/mobile/actions.step.d.ts +3 -0
- package/dist/testing/steps/mobile/actions.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/actions.step.js +151 -0
- package/dist/testing/steps/mobile/actions.step.js.map +1 -0
- package/dist/testing/steps/mobile/app.step.d.ts +3 -0
- package/dist/testing/steps/mobile/app.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/app.step.js +20 -0
- package/dist/testing/steps/mobile/app.step.js.map +1 -0
- package/dist/testing/steps/mobile/assertions.step.d.ts +3 -0
- package/dist/testing/steps/mobile/assertions.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/assertions.step.js +55 -0
- package/dist/testing/steps/mobile/assertions.step.js.map +1 -0
- package/dist/testing/steps/mobile/gestures.step.d.ts +3 -0
- package/dist/testing/steps/mobile/gestures.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/gestures.step.js +85 -0
- package/dist/testing/steps/mobile/gestures.step.js.map +1 -0
- package/dist/testing/steps/mobile/index.d.ts +3 -0
- package/dist/testing/steps/mobile/index.d.ts.map +1 -0
- package/dist/testing/steps/mobile/index.js +14 -0
- package/dist/testing/steps/mobile/index.js.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.d.ts +2 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.d.ts.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.js +315 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.js.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.d.ts +2 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.d.ts.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.js +338 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.js.map +1 -0
- package/dist/testing/steps/mobile/shared.d.ts +13 -0
- package/dist/testing/steps/mobile/shared.d.ts.map +1 -0
- package/dist/testing/steps/mobile/shared.js +41 -0
- package/dist/testing/steps/mobile/shared.js.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.d.ts +14 -0
- package/dist/testing/steps/mobile/swipe-line.d.ts.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.js +20 -0
- package/dist/testing/steps/mobile/swipe-line.js.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.spec.d.ts +2 -0
- package/dist/testing/steps/mobile/swipe-line.spec.d.ts.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.spec.js +25 -0
- package/dist/testing/steps/mobile/swipe-line.spec.js.map +1 -0
- package/dist/testing/steps/ui/actions.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/actions.step.js +8 -5
- package/dist/testing/steps/ui/actions.step.js.map +1 -1
- package/dist/testing/steps/ui/aria-snapshot.step.d.ts +3 -0
- package/dist/testing/steps/ui/aria-snapshot.step.d.ts.map +1 -0
- package/dist/testing/steps/ui/aria-snapshot.step.js +70 -0
- package/dist/testing/steps/ui/aria-snapshot.step.js.map +1 -0
- package/dist/testing/steps/ui/assertions.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/assertions.step.js +5 -2
- package/dist/testing/steps/ui/assertions.step.js.map +1 -1
- package/dist/testing/steps/ui/form.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/form.step.js +7 -3
- package/dist/testing/steps/ui/form.step.js.map +1 -1
- package/dist/testing/steps/ui/index.d.ts.map +1 -1
- package/dist/testing/steps/ui/index.js +2 -0
- package/dist/testing/steps/ui/index.js.map +1 -1
- package/package.json +15 -5
- package/src/controllers/test-run.controller.ts +17 -1
- package/src/dtos/confirm-module-package-import.dto.ts +16 -0
- package/src/dtos/create-field-metadata.dto.ts +4 -3
- package/src/dtos/create-model-metadata.dto.ts +19 -13
- package/src/dtos/test-run-request.dto.ts +18 -0
- package/src/entities/media-migration-plan.md +20 -0
- package/src/helpers/module-package-sync.helper.spec.ts +253 -0
- package/src/helpers/module-package-sync.helper.ts +381 -0
- package/src/index.ts +3 -0
- package/src/jobs/database/test-run-queue-subscriber-database.service.ts +21 -5
- package/src/seeders/module-metadata-seeder.service.ts +154 -0
- package/src/seeders/seed-data/solid-core-metadata.json +0 -47
- package/src/services/module-package.service.spec.ts +398 -0
- package/src/services/module-package.service.ts +433 -37
- package/src/services/view-metadata.service.ts +6 -4
- package/src/testing/README.md +198 -1
- package/src/testing/__integration__/mobile-emulator.integration.ts +409 -0
- package/src/testing/adapters/mobile/capabilities.spec.ts +247 -0
- package/src/testing/adapters/mobile/capabilities.ts +108 -0
- package/src/testing/adapters/mobile/fake-driver.ts +133 -0
- package/src/testing/adapters/mobile/ios-keyboard.spec.ts +40 -0
- package/src/testing/adapters/mobile/ios-keyboard.ts +187 -0
- package/src/testing/adapters/mobile/locator.spec.ts +200 -0
- package/src/testing/adapters/mobile/locator.ts +118 -0
- package/src/testing/adapters/mobile/logcat.spec.ts +63 -0
- package/src/testing/adapters/mobile/logcat.ts +44 -0
- package/src/testing/adapters/mobile/mobile-adapter.ios.spec.ts +277 -0
- package/src/testing/adapters/mobile/mobile-adapter.spec.ts +632 -0
- package/src/testing/adapters/mobile/mobile-adapter.ts +599 -0
- package/src/testing/adapters/mobile/mobile.types.ts +177 -0
- package/src/testing/adapters/mobile/phone-errors.ts +59 -0
- package/src/testing/adapters/mobile/platform.ts +15 -0
- package/src/testing/adapters/mobile/resolve-mobile-target.spec.ts +227 -0
- package/src/testing/adapters/mobile/resolve-mobile-target.ts +104 -0
- package/src/testing/adapters/mobile/run-options.spec.ts +121 -0
- package/src/testing/adapters/mobile/run-options.ts +49 -0
- package/src/testing/adapters/mobile/syslog.spec.ts +108 -0
- package/src/testing/adapters/mobile/syslog.ts +57 -0
- package/src/testing/adapters/ui/playwright-adapter.ts +149 -22
- package/src/testing/adapters/ui/resolve-target.ts +121 -0
- package/src/testing/adapters/ui/ui.types.ts +23 -0
- package/src/testing/contracts/runtime-context.types.ts +24 -0
- package/src/testing/contracts/testing-metadata.types.ts +72 -1
- package/src/testing/core/step-registry.ts +4 -0
- package/src/testing/core/testing-engine.ts +148 -42
- package/src/testing/reporter/console-reporter.ts +22 -10
- package/src/testing/reporter/file-service-artifact-sink.ts +9 -3
- package/src/testing/reporter/lifecycle-events.types.ts +17 -0
- package/src/testing/reporter/lifecycle-webhook-reporter.spec.ts +77 -0
- package/src/testing/reporter/lifecycle-webhook-reporter.ts +31 -2
- package/src/testing/reporter/progress-reporter.ts +9 -10
- package/src/testing/reporter/reporter.types.ts +37 -9
- package/src/testing/runner/lifecycle.spec.ts +41 -0
- package/src/testing/runner/lifecycle.ts +95 -0
- package/src/testing/runner/mobile-session.spec.ts +106 -0
- package/src/testing/runner/mobile-session.ts +138 -0
- package/src/testing/runner/recording-reporter.ts +34 -0
- package/src/testing/runner/run-cancellation.ts +38 -0
- package/src/testing/runner/run-from-metadata.cancel.spec.ts +75 -0
- package/src/testing/runner/run-from-metadata.mobile.spec.ts +580 -0
- package/src/testing/runner/run-from-metadata.spec.ts +180 -2
- package/src/testing/runner/run-from-metadata.ts +215 -33
- package/src/testing/runner/scenario-graph.spec.ts +122 -0
- package/src/testing/runner/scenario-graph.ts +142 -0
- package/src/testing/runtime/default-registry.ts +19 -0
- package/src/testing/runtime/index.ts +79 -0
- package/src/testing/runtime/mobile-step-executor.spec.ts +177 -0
- package/src/testing/runtime/step-executor.spec.ts +156 -0
- package/src/testing/runtime/step-executor.ts +315 -0
- package/src/testing/steps/mobile/actions.step.ts +176 -0
- package/src/testing/steps/mobile/app.step.ts +23 -0
- package/src/testing/steps/mobile/assertions.step.ts +59 -0
- package/src/testing/steps/mobile/gestures.step.ts +102 -0
- package/src/testing/steps/mobile/index.ts +12 -0
- package/src/testing/steps/mobile/mobile-steps.ios.spec.ts +364 -0
- package/src/testing/steps/mobile/mobile-steps.spec.ts +415 -0
- package/src/testing/steps/mobile/shared.ts +48 -0
- package/src/testing/steps/mobile/swipe-line.spec.ts +27 -0
- package/src/testing/steps/mobile/swipe-line.ts +30 -0
- package/src/testing/steps/ui/actions.step.ts +11 -8
- package/src/testing/steps/ui/aria-snapshot.step.ts +101 -0
- package/src/testing/steps/ui/assertions.step.ts +7 -9
- package/src/testing/steps/ui/form.step.ts +10 -10
- package/src/testing/steps/ui/index.ts +2 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { toMobileAdapterOptions } from "./run-options";
|
|
2
|
+
import type { MobileRunOptionsInput } from "./mobile.types";
|
|
3
|
+
|
|
4
|
+
const input: MobileRunOptionsInput = {
|
|
5
|
+
appiumUrl: "http://localhost:4723",
|
|
6
|
+
udid: "emulator-5554",
|
|
7
|
+
appSource: "upload",
|
|
8
|
+
appPath: "/builds/app.apk",
|
|
9
|
+
appPackage: "com.acme.app",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
describe("toMobileAdapterOptions", () => {
|
|
13
|
+
it("copies the request fields", () => {
|
|
14
|
+
expect(toMobileAdapterOptions(input)).toMatchObject(input);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("records video and captures the device log by default", () => {
|
|
18
|
+
expect(toMobileAdapterOptions(input)).toMatchObject({ recordVideo: true, capture: { console: true } });
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("follows the run's own recordVideo and capture settings", () => {
|
|
22
|
+
expect(toMobileAdapterOptions(input, { recordVideo: false, capture: { console: false } })).toMatchObject({
|
|
23
|
+
recordVideo: false,
|
|
24
|
+
capture: { console: false },
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("passes the run's healing policy on, and leaves it unset when the run has none", () => {
|
|
29
|
+
expect(toMobileAdapterOptions(input, { healing: "off" })).toMatchObject({ healing: "off" });
|
|
30
|
+
expect(toMobileAdapterOptions(input).healing).toBeUndefined();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("drops unknown fields, including a driver factory", () => {
|
|
34
|
+
const sneaky = { ...input, driverFactory: () => undefined, somethingElse: 1 } as unknown as MobileRunOptionsInput;
|
|
35
|
+
const result = toMobileAdapterOptions(sneaky) as unknown as Record<string, unknown>;
|
|
36
|
+
expect(result.driverFactory).toBeUndefined();
|
|
37
|
+
expect(result.somethingElse).toBeUndefined();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("toMobileAdapterOptions: screenshots", () => {
|
|
42
|
+
const base = { appiumUrl: "http://localhost:4723", udid: "u", appSource: "installed" as const, appPackage: "com.acme.app", appActivity: ".A" };
|
|
43
|
+
|
|
44
|
+
it("does not take a failure screenshot unless the run asks for one", () => {
|
|
45
|
+
expect(toMobileAdapterOptions(base).capture?.screenshot).toBe(false);
|
|
46
|
+
expect(toMobileAdapterOptions(base, { capture: { screenshotOnFailure: false } }).capture?.screenshot).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("follows the run's screenshotOnFailure setting", () => {
|
|
50
|
+
expect(toMobileAdapterOptions(base, { capture: { screenshotOnFailure: true } }).capture?.screenshot).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe("toMobileAdapterOptions: iOS", () => {
|
|
55
|
+
const ios: MobileRunOptionsInput = {
|
|
56
|
+
appiumUrl: "http://localhost:4723",
|
|
57
|
+
udid: "1674E718-0EBA-4568-9644-F18E0DDF7705",
|
|
58
|
+
platformName: "iOS",
|
|
59
|
+
simulator: true,
|
|
60
|
+
appSource: "upload",
|
|
61
|
+
appPath: "/builds/Sample.app",
|
|
62
|
+
appPackage: "io.solidx.testhub.sample",
|
|
63
|
+
appProcessName: "SampleApp",
|
|
64
|
+
wdaDerivedDataPath: "/w/xcode-27.0",
|
|
65
|
+
wdaPrebuilt: true,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
it("copies the iOS fields", () => {
|
|
69
|
+
expect(toMobileAdapterOptions(ios)).toMatchObject(ios);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("rejects an unknown platform", () => {
|
|
73
|
+
expect(() => toMobileAdapterOptions({ ...ios, platformName: "Windows" as never })).toThrow(
|
|
74
|
+
'platformName must be "Android" or "iOS", got "Windows"',
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("accepts a run with no platform, which means Android", () => {
|
|
79
|
+
const { platformName, ...android } = ios;
|
|
80
|
+
expect(platformName).toBe("iOS");
|
|
81
|
+
expect(toMobileAdapterOptions(android).platformName).toBeUndefined();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe("toMobileAdapterOptions: phone signing", () => {
|
|
86
|
+
const phone: MobileRunOptionsInput = {
|
|
87
|
+
appiumUrl: "http://localhost:4723",
|
|
88
|
+
udid: "00008140-001A202611B8801C",
|
|
89
|
+
platformName: "iOS",
|
|
90
|
+
simulator: false,
|
|
91
|
+
appSource: "installed",
|
|
92
|
+
appPackage: "com.oswald.mydemoapp",
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
it("copies wdaSigning", () => {
|
|
96
|
+
expect(toMobileAdapterOptions({ ...phone, wdaSigning: { teamId: "LN5367MMM6", wdaBundleId: "io.solidx.wda.ln5367mmm6" } }).wdaSigning).toEqual({
|
|
97
|
+
teamId: "LN5367MMM6",
|
|
98
|
+
signingId: undefined,
|
|
99
|
+
wdaBundleId: "io.solidx.wda.ln5367mmm6",
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("copies only the known signing fields", () => {
|
|
104
|
+
const sneaky = { teamId: "LN5367MMM6", extra: "x" } as unknown as NonNullable<MobileRunOptionsInput["wdaSigning"]>;
|
|
105
|
+
expect(toMobileAdapterOptions({ ...phone, wdaSigning: sneaky }).wdaSigning).not.toHaveProperty("extra");
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("leaves wdaSigning out when there is none", () => {
|
|
109
|
+
expect(toMobileAdapterOptions(phone).wdaSigning).toBeUndefined();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it.each(["short", "lowercase1", "TOOLONGTEAMID", "", "LN5367MMM!"])("rejects the team id %p", (teamId) => {
|
|
113
|
+
expect(() => toMobileAdapterOptions({ ...phone, wdaSigning: { teamId } })).toThrow("wdaSigning.teamId must be a 10-character Apple team id");
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("rejects a WebDriverAgent bundle id that could be taken for an option", () => {
|
|
117
|
+
expect(() => toMobileAdapterOptions({ ...phone, wdaSigning: { teamId: "LN5367MMM6", wdaBundleId: "-bad" } })).toThrow(
|
|
118
|
+
"wdaSigning.wdaBundleId must look like io.example.wda",
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { HealingPolicy } from "../../contracts/testing-metadata.types";
|
|
2
|
+
import type { MobileAdapterOptions, MobileRunOptionsInput } from "./mobile.types";
|
|
3
|
+
import { BUNDLE_ID_RE } from "./platform";
|
|
4
|
+
|
|
5
|
+
const TEAM_ID_RE = /^[A-Z0-9]{10}$/;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Builds adapter options from the `mobile` block of a run request. Only known fields are copied, so a
|
|
9
|
+
* request cannot smuggle in anything else (such as the test-only driver factory).
|
|
10
|
+
*/
|
|
11
|
+
export function toMobileAdapterOptions(
|
|
12
|
+
input: MobileRunOptionsInput,
|
|
13
|
+
run: { recordVideo?: boolean; capture?: { console?: boolean; screenshotOnFailure?: boolean }; healing?: HealingPolicy } = {},
|
|
14
|
+
): MobileAdapterOptions {
|
|
15
|
+
if (input.platformName !== undefined && input.platformName !== "Android" && input.platformName !== "iOS") {
|
|
16
|
+
throw new Error(`platformName must be "Android" or "iOS", got "${String(input.platformName)}"`);
|
|
17
|
+
}
|
|
18
|
+
const signing = input.wdaSigning;
|
|
19
|
+
if (signing) {
|
|
20
|
+
if (!TEAM_ID_RE.test(String(signing.teamId ?? ""))) {
|
|
21
|
+
throw new Error(`wdaSigning.teamId must be a 10-character Apple team id, got "${String(signing.teamId)}"`);
|
|
22
|
+
}
|
|
23
|
+
if (signing.wdaBundleId !== undefined && !BUNDLE_ID_RE.test(String(signing.wdaBundleId))) {
|
|
24
|
+
throw new Error(`wdaSigning.wdaBundleId must look like io.example.wda, got "${String(signing.wdaBundleId)}"`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
appiumUrl: input.appiumUrl,
|
|
29
|
+
udid: input.udid,
|
|
30
|
+
platformName: input.platformName,
|
|
31
|
+
simulator: input.simulator,
|
|
32
|
+
appSource: input.appSource,
|
|
33
|
+
appPath: input.appPath,
|
|
34
|
+
appPackage: input.appPackage,
|
|
35
|
+
appActivity: input.appActivity,
|
|
36
|
+
appProcessName: input.appProcessName,
|
|
37
|
+
wdaDerivedDataPath: input.wdaDerivedDataPath,
|
|
38
|
+
wdaPrebuilt: input.wdaPrebuilt,
|
|
39
|
+
// Copied field by field, so nothing else rides along with it.
|
|
40
|
+
wdaSigning: signing ? { teamId: signing.teamId, signingId: signing.signingId, wdaBundleId: signing.wdaBundleId } : undefined,
|
|
41
|
+
defaultTimeoutMs: input.defaultTimeoutMs,
|
|
42
|
+
navigationTimeoutMs: input.navigationTimeoutMs,
|
|
43
|
+
strictLocators: input.strictLocators,
|
|
44
|
+
extraCapabilities: input.extraCapabilities,
|
|
45
|
+
healing: run.healing,
|
|
46
|
+
recordVideo: run.recordVideo ?? true,
|
|
47
|
+
capture: { console: run.capture?.console ?? true, screenshot: run.capture?.screenshotOnFailure ?? false },
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { toSyslogConsoleEntries } from "./syslog";
|
|
2
|
+
|
|
3
|
+
const app = { processName: "SampleApp", bundleId: "io.solidx.testhub.sample" };
|
|
4
|
+
const line = (level: string, proc: string, text: string) =>
|
|
5
|
+
({ level: "ALL", message: `2026-10-13 21:53:23.018 ${level} ${proc}[45761:53f83] [com.x:y] ${text}` });
|
|
6
|
+
|
|
7
|
+
describe("toSyslogConsoleEntries", () => {
|
|
8
|
+
it("keeps every line of the app's own process, mapping the level", () => {
|
|
9
|
+
const entries = [line("Db", "SampleApp", "debug"), line("I", "SampleApp", "info"), line("Df", "SampleApp", "default"), line("E", "SampleApp", "boom")];
|
|
10
|
+
expect(toSyslogConsoleEntries(entries, app, 500).map((e) => e.type)).toEqual(["debug", "info", "info", "error"]);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("drops other processes' lines", () => {
|
|
14
|
+
const entries = [line("I", "locationd", "noise"), line("Df", "SpringBoard", "more noise")];
|
|
15
|
+
expect(toSyslogConsoleEntries(entries, app, 500)).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("keeps errors and faults from other processes only when they name the app", () => {
|
|
19
|
+
const entries = [
|
|
20
|
+
line("E", "runningboardd", `Failed to launch ${app.bundleId}`),
|
|
21
|
+
line("Fa", "kernel", "unrelated fault"),
|
|
22
|
+
line("I", "runningboardd", `Launched ${app.bundleId}`),
|
|
23
|
+
];
|
|
24
|
+
const kept = toSyslogConsoleEntries(entries, app, 500);
|
|
25
|
+
expect(kept).toHaveLength(1);
|
|
26
|
+
expect(kept[0]).toMatchObject({ type: "error" });
|
|
27
|
+
expect(kept[0].text).toContain("Failed to launch");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("skips lines that do not look like log lines", () => {
|
|
31
|
+
const entries = [{ level: "ALL", message: "Timestamp Ty Process[PID:TID]" }, { level: "ALL", message: "getpwuid_r did not find a match for uid 501" }];
|
|
32
|
+
expect(toSyslogConsoleEntries(entries, app, 500)).toEqual([]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("works without a process name, relying on errors that name the app", () => {
|
|
36
|
+
const entries = [line("I", "SampleApp", "own"), line("E", "x", `bad ${app.bundleId}`)];
|
|
37
|
+
expect(toSyslogConsoleEntries(entries, { bundleId: app.bundleId }, 500)).toHaveLength(1);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("returns the newest lines when over the limit", () => {
|
|
41
|
+
const entries = Array.from({ length: 10 }, (_, i) => line("I", "SampleApp", `n${i}`));
|
|
42
|
+
const kept = toSyslogConsoleEntries(entries, app, 3);
|
|
43
|
+
expect(kept.map((e) => e.text.slice(-2))).toEqual(["n7", "n8", "n9"]);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe("toSyslogConsoleEntries: a real iPhone's lines (D48)", () => {
|
|
48
|
+
// Lines in the shape of a capture from an iPhone 16 on iOS 26.6.1 (see spikes/mobile-ios/FINDINGS-ios-device.md),
|
|
49
|
+
// with the host name changed.
|
|
50
|
+
const device = (proc: string, level: string, text: string, subsystem = "") =>
|
|
51
|
+
({ level: "ALL", message: `Oct 16 07:23:55 Test-iPhone ${proc}${subsystem ? `(${subsystem})` : ""}[2006] <${level}>: ${text}` });
|
|
52
|
+
const phone = { processName: "My Demo App", bundleId: "com.oswald.mydemoapp" };
|
|
53
|
+
|
|
54
|
+
it("keeps the app's own process, even when its name has spaces and it names a subsystem", () => {
|
|
55
|
+
const kept = toSyslogConsoleEntries(
|
|
56
|
+
[device("My Demo App", "Notice", "HTAssertion: HTBeginAssertion: track assertionId=136", "HangTracer"), device("My Demo App", "Notice", "plain")],
|
|
57
|
+
phone,
|
|
58
|
+
500,
|
|
59
|
+
);
|
|
60
|
+
expect(kept).toHaveLength(2);
|
|
61
|
+
expect(kept[0].text).toContain("HTBeginAssertion");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("drops WebDriverAgent's and the system's lines", () => {
|
|
65
|
+
const kept = toSyslogConsoleEntries(
|
|
66
|
+
[
|
|
67
|
+
device("WebDriverAgentRunner-Runner", "Notice", "nw_connection_report_state_with_handler_on_nw_queue", "Network"),
|
|
68
|
+
device("inputanalyticsd", "Error", "textInputSessionId '<private>' already exists!", "InputAnalyticsServer"),
|
|
69
|
+
device("testmanagerd", "Error", "Uncaptured runtime issue reported: <private>", "XCTAutomationSupport"),
|
|
70
|
+
],
|
|
71
|
+
phone,
|
|
72
|
+
500,
|
|
73
|
+
);
|
|
74
|
+
expect(kept).toEqual([]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("keeps an error from another process only when it names the app", () => {
|
|
78
|
+
const kept = toSyslogConsoleEntries(
|
|
79
|
+
[device("runningboardd", "Error", `Failed to launch ${phone.bundleId}`), device("runningboardd", "Error", "unrelated"), device("runningboardd", "Notice", `Launched ${phone.bundleId}`)],
|
|
80
|
+
phone,
|
|
81
|
+
500,
|
|
82
|
+
);
|
|
83
|
+
expect(kept).toHaveLength(1);
|
|
84
|
+
expect(kept[0]).toMatchObject({ type: "error" });
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it.each([
|
|
88
|
+
["Debug", "debug"],
|
|
89
|
+
["Info", "info"],
|
|
90
|
+
["Notice", "info"],
|
|
91
|
+
["Error", "error"],
|
|
92
|
+
["Fault", "error"],
|
|
93
|
+
["Surprise", "info"],
|
|
94
|
+
])("maps the level %s to %s", (level, type) => {
|
|
95
|
+
expect(toSyslogConsoleEntries([device("My Demo App", level, "x")], phone, 500)[0].type).toBe(type);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("skips the continuation lines a multi-line message leaves behind", () => {
|
|
99
|
+
const entries = [{ level: "ALL", message: "\t{name: Thermal Policy, policyWeight: 5.000, response: {100, 0.00}}" }, { level: "ALL", message: " ], Decision: AMNP}" }];
|
|
100
|
+
expect(toSyslogConsoleEntries(entries, phone, 500)).toEqual([]);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("reads a phone's lines and a simulator's together", () => {
|
|
104
|
+
const entries = [device("My Demo App", "Notice", "from the phone"), line("I", "SampleApp", "from the simulator")];
|
|
105
|
+
expect(toSyslogConsoleEntries(entries, { processName: "My Demo App", bundleId: "x.y" }, 500)).toHaveLength(1);
|
|
106
|
+
expect(toSyslogConsoleEntries(entries, { processName: "SampleApp", bundleId: "x.y" }, 500)).toHaveLength(1);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ConsoleEntry } from "./logcat";
|
|
2
|
+
|
|
3
|
+
// An iOS system log line, as Appium returns it in `message` (its own `level` is always "ALL"):
|
|
4
|
+
// 2026-10-13 21:53:23.018 Df locationd[45761:53f83] [com.apple.locationd.Utility:QA] text
|
|
5
|
+
const SYSLOG_LINE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ (\w+) (\S+?)\[\d+:[0-9a-f]+\] /;
|
|
6
|
+
|
|
7
|
+
// A real iPhone's line has another shape (D48): the process may contain spaces, the subsystem is optional, and the level is spelled out.
|
|
8
|
+
// Oct 16 07:23:55 Test-iPhone My Demo App(HangTracer)[2006] <Notice>: HTAssertion: ...
|
|
9
|
+
const DEVICE_LINE = /^\w{3} +\d+ \d\d:\d\d:\d\d \S+ (.+?)(?:\([^)]*\))?\[\d+\] <(\w+)>: /;
|
|
10
|
+
|
|
11
|
+
const TYPE_BY_DEVICE_LEVEL: Record<string, ConsoleEntry["type"]> = {
|
|
12
|
+
Debug: "debug",
|
|
13
|
+
Info: "info",
|
|
14
|
+
Notice: "info",
|
|
15
|
+
Error: "error",
|
|
16
|
+
Fault: "error",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const TYPE_BY_LEVEL: Record<string, ConsoleEntry["type"]> = {
|
|
20
|
+
Db: "debug",
|
|
21
|
+
I: "info",
|
|
22
|
+
Df: "info",
|
|
23
|
+
E: "error",
|
|
24
|
+
Fa: "error",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Turns raw syslog entries into the console.json shape. The raw log is mostly system chatter (1.3 MB for a short run), so
|
|
29
|
+
* only the app's own lines are kept, plus errors and faults from anywhere that name the app. The newest `max` are
|
|
30
|
+
* returned (D38).
|
|
31
|
+
*/
|
|
32
|
+
export function toSyslogConsoleEntries(
|
|
33
|
+
entries: Array<{ level?: string; message?: string }>,
|
|
34
|
+
app: { processName?: string; bundleId: string },
|
|
35
|
+
max: number,
|
|
36
|
+
): ConsoleEntry[] {
|
|
37
|
+
const kept: ConsoleEntry[] = [];
|
|
38
|
+
for (const entry of entries) {
|
|
39
|
+
const text = String(entry.message ?? "");
|
|
40
|
+
let processName: string;
|
|
41
|
+
let type: ConsoleEntry["type"];
|
|
42
|
+
const simulator = SYSLOG_LINE.exec(text);
|
|
43
|
+
if (simulator) {
|
|
44
|
+
processName = simulator[2];
|
|
45
|
+
type = TYPE_BY_LEVEL[simulator[1]] ?? "info";
|
|
46
|
+
} else {
|
|
47
|
+
const device = DEVICE_LINE.exec(text);
|
|
48
|
+
if (!device) continue; // a continuation line has no process to attribute it to
|
|
49
|
+
processName = device[1];
|
|
50
|
+
type = TYPE_BY_DEVICE_LEVEL[device[2]] ?? "info";
|
|
51
|
+
}
|
|
52
|
+
const own = !!app.processName && processName === app.processName;
|
|
53
|
+
const important = type === "error" && text.includes(app.bundleId);
|
|
54
|
+
if (own || important) kept.push({ type, text });
|
|
55
|
+
}
|
|
56
|
+
return kept.slice(-max);
|
|
57
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type { Browser, BrowserContext, Page, ConsoleMessage, Response, Request } from "playwright";
|
|
1
|
+
import type { Browser, BrowserContext, Page, ConsoleMessage, Response, Request, Video } from "playwright";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { HealEvent } from "../../contracts/runtime-context.types";
|
|
4
|
+
import type { HealingPolicy } from "../../contracts/testing-metadata.types";
|
|
5
|
+
import type { AttachOptions, CaptureOptions, PlaywrightAdapterOptions, ViewportOptions } from "./ui.types";
|
|
6
|
+
|
|
7
|
+
/** Storage state as returned by `BrowserContext.storageState()`. */
|
|
8
|
+
export type StorageState = Awaited<ReturnType<BrowserContext["storageState"]>>;
|
|
4
9
|
|
|
5
10
|
function isAbsoluteUrl(url: string): boolean {
|
|
6
11
|
return /^https?:\/\//i.test(url);
|
|
@@ -47,17 +52,27 @@ export class PlaywrightAdapter {
|
|
|
47
52
|
private readonly navigationTimeoutMs: number;
|
|
48
53
|
private readonly capture: CaptureOptions;
|
|
49
54
|
private readonly recordVideo: boolean;
|
|
55
|
+
private readonly healing: HealingPolicy;
|
|
56
|
+
private readonly viewport?: ViewportOptions;
|
|
50
57
|
private browser?: Browser;
|
|
51
58
|
private context?: BrowserContext;
|
|
52
59
|
public page?: Page;
|
|
60
|
+
/** False when wrapping a caller-owned page via {@link attach}: stop() leaves it open. */
|
|
61
|
+
private ownsBrowser = true;
|
|
53
62
|
|
|
54
63
|
/** Per-scenario ring buffers; reset via {@link resetCapture} at each scenario start. */
|
|
55
64
|
private consoleBuf: ConsoleLogEntry[] = [];
|
|
56
65
|
private networkBuf: NetworkLogEntry[] = [];
|
|
66
|
+
private heals: HealEvent[] = [];
|
|
57
67
|
|
|
58
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Whole-run video: temp dir Playwright writes into, one recording per browser context
|
|
70
|
+
* (a run that switches context for `session: restore|fresh` produces several), and the
|
|
71
|
+
* finalized bytes.
|
|
72
|
+
*/
|
|
59
73
|
private videoDir?: string;
|
|
60
|
-
private
|
|
74
|
+
private videoSegments: Video[] = [];
|
|
75
|
+
private runVideos: FailureArtifact[] = [];
|
|
61
76
|
private readonly requestStartedAt = new Map<Request, number>();
|
|
62
77
|
|
|
63
78
|
constructor(opts?: PlaywrightAdapterOptions) {
|
|
@@ -68,12 +83,42 @@ export class PlaywrightAdapter {
|
|
|
68
83
|
opts?.navigationTimeoutMs ?? this.defaultTimeoutMs;
|
|
69
84
|
this.capture = opts?.capture ?? {};
|
|
70
85
|
this.recordVideo = opts?.recordVideo ?? true;
|
|
86
|
+
this.healing = opts?.healing ?? "report";
|
|
87
|
+
this.viewport = sanitizeViewport(opts?.viewport);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Wrap a page the caller already launched (e.g. a long-lived authoring session), so
|
|
92
|
+
* steps run through the exact handlers the runner uses. The adapter never closes the
|
|
93
|
+
* caller's page, context, or browser.
|
|
94
|
+
*/
|
|
95
|
+
static attach(page: Page, opts?: AttachOptions): PlaywrightAdapter {
|
|
96
|
+
const adapter = new PlaywrightAdapter({ ...opts, recordVideo: false });
|
|
97
|
+
adapter.ownsBrowser = false;
|
|
98
|
+
adapter.context = page.context();
|
|
99
|
+
adapter.browser = adapter.context.browser() ?? undefined;
|
|
100
|
+
adapter.page = page;
|
|
101
|
+
adapter.attachCaptureListeners(page);
|
|
102
|
+
return adapter;
|
|
71
103
|
}
|
|
72
104
|
|
|
73
105
|
isHeadless(): boolean {
|
|
74
106
|
return this.headless;
|
|
75
107
|
}
|
|
76
108
|
|
|
109
|
+
getHealingPolicy(): HealingPolicy {
|
|
110
|
+
return this.healing;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
recordHeal(heal: HealEvent): void {
|
|
114
|
+
this.heals.push(heal);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Heals recorded since the last {@link resetCapture}. */
|
|
118
|
+
getHeals(): HealEvent[] {
|
|
119
|
+
return [...this.heals];
|
|
120
|
+
}
|
|
121
|
+
|
|
77
122
|
/**
|
|
78
123
|
* Resolves the timeout for a single Playwright call: an explicit per-step
|
|
79
124
|
* value wins, otherwise the run-wide default applies.
|
|
@@ -102,18 +147,65 @@ export class PlaywrightAdapter {
|
|
|
102
147
|
const fs = await import('fs');
|
|
103
148
|
this.videoDir = fs.mkdtempSync(path.join(os.tmpdir(), 'solid-run-video-'));
|
|
104
149
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
150
|
+
await this.openContext();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private async openContext(storageState?: StorageState): Promise<void> {
|
|
154
|
+
if (!this.browser) {
|
|
155
|
+
throw new Error("PlaywrightAdapter: browser is not started");
|
|
156
|
+
}
|
|
157
|
+
this.context = await this.browser.newContext({
|
|
158
|
+
...contextViewportOptions(this.viewport),
|
|
159
|
+
...(this.videoDir ? { recordVideo: { dir: this.videoDir } } : {}),
|
|
160
|
+
...(storageState ? { storageState } : {}),
|
|
161
|
+
});
|
|
108
162
|
this.context.setDefaultTimeout(this.defaultTimeoutMs);
|
|
109
163
|
this.context.setDefaultNavigationTimeout(this.navigationTimeoutMs);
|
|
110
164
|
this.page = await this.context.newPage();
|
|
111
165
|
this.attachCaptureListeners(this.page);
|
|
112
166
|
}
|
|
113
167
|
|
|
114
|
-
|
|
168
|
+
private async closeContext(): Promise<void> {
|
|
169
|
+
const video = this.videoDir ? this.page?.video() : undefined;
|
|
170
|
+
if (video) this.videoSegments.push(video);
|
|
171
|
+
try {
|
|
172
|
+
if (this.context) {
|
|
173
|
+
await this.context.close();
|
|
174
|
+
}
|
|
175
|
+
} finally {
|
|
176
|
+
this.context = undefined;
|
|
177
|
+
this.page = undefined;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Replace the current browser context with a new one, optionally seeded with a saved
|
|
183
|
+
* storage state. Used for `session: fresh|restore` scenarios.
|
|
184
|
+
*/
|
|
185
|
+
async newContext(opts?: { storageState?: StorageState }): Promise<void> {
|
|
186
|
+
if (!this.ownsBrowser) {
|
|
187
|
+
throw new Error("PlaywrightAdapter: cannot replace the context of an attached page");
|
|
188
|
+
}
|
|
189
|
+
await this.closeContext();
|
|
190
|
+
await this.openContext(opts?.storageState);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Cookies and localStorage of the current context, kept in memory by the caller. */
|
|
194
|
+
async storageState(): Promise<StorageState> {
|
|
195
|
+
if (!this.context) {
|
|
196
|
+
throw new Error("PlaywrightAdapter: no browser context");
|
|
197
|
+
}
|
|
198
|
+
return this.context.storageState();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** First whole-run video segment, available after {@link stop} has finalized it. */
|
|
115
202
|
getRunVideo(): FailureArtifact | undefined {
|
|
116
|
-
return this.
|
|
203
|
+
return this.runVideos[0];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Every whole-run video segment (one per browser context), after {@link stop}. */
|
|
207
|
+
getRunVideos(): FailureArtifact[] {
|
|
208
|
+
return [...this.runVideos];
|
|
117
209
|
}
|
|
118
210
|
|
|
119
211
|
/**
|
|
@@ -186,6 +278,7 @@ export class PlaywrightAdapter {
|
|
|
186
278
|
resetCapture(): void {
|
|
187
279
|
this.consoleBuf = [];
|
|
188
280
|
this.networkBuf = [];
|
|
281
|
+
this.heals = [];
|
|
189
282
|
this.requestStartedAt.clear();
|
|
190
283
|
}
|
|
191
284
|
|
|
@@ -241,28 +334,28 @@ export class PlaywrightAdapter {
|
|
|
241
334
|
}
|
|
242
335
|
|
|
243
336
|
async stop(opts?: { keepVideo?: boolean }): Promise<void> {
|
|
244
|
-
|
|
245
|
-
// Grab the video handle before the context closes; its file is only finalized on close().
|
|
246
|
-
const video = this.videoDir ? this.page?.video() : undefined;
|
|
247
|
-
|
|
248
|
-
try {
|
|
249
|
-
if (this.context) {
|
|
250
|
-
await this.context.close();
|
|
251
|
-
}
|
|
252
|
-
} finally {
|
|
337
|
+
if (!this.ownsBrowser) {
|
|
253
338
|
this.context = undefined;
|
|
254
339
|
this.page = undefined;
|
|
340
|
+
this.browser = undefined;
|
|
341
|
+
return;
|
|
255
342
|
}
|
|
343
|
+
const keepVideo = opts?.keepVideo ?? false;
|
|
344
|
+
// closeContext() grabs the video handle first; its file is only finalized on close().
|
|
345
|
+
await this.closeContext();
|
|
256
346
|
|
|
257
|
-
if (
|
|
347
|
+
if (this.videoDir) {
|
|
258
348
|
try {
|
|
259
349
|
const fs = await import('fs');
|
|
260
350
|
// Only read the recording into memory when the caller wants to keep it (i.e. the
|
|
261
351
|
// run FAILED). Passing runs discard the webm unread — no wasted IO/memory.
|
|
262
352
|
if (keepVideo) {
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
|
|
353
|
+
const single = this.videoSegments.length === 1;
|
|
354
|
+
for (const [i, video] of this.videoSegments.entries()) {
|
|
355
|
+
const data = await fs.promises.readFile(await video.path());
|
|
356
|
+
const name = single ? 'run.webm' : `run-${i + 1}.webm`;
|
|
357
|
+
this.runVideos.push({ name, contentType: 'video/webm', data });
|
|
358
|
+
}
|
|
266
359
|
}
|
|
267
360
|
// Clean up the temp recording directory either way.
|
|
268
361
|
await fs.promises.rm(this.videoDir, { recursive: true, force: true }).catch(() => {});
|
|
@@ -270,6 +363,7 @@ export class PlaywrightAdapter {
|
|
|
270
363
|
// A video read failure must never mask the real run result.
|
|
271
364
|
} finally {
|
|
272
365
|
this.videoDir = undefined;
|
|
366
|
+
this.videoSegments = [];
|
|
273
367
|
}
|
|
274
368
|
}
|
|
275
369
|
|
|
@@ -375,3 +469,36 @@ function shouldCaptureDetailedNetworkEntry(req: Request): boolean {
|
|
|
375
469
|
|
|
376
470
|
return resourceType === "document";
|
|
377
471
|
}
|
|
472
|
+
|
|
473
|
+
/** A usable viewport, or undefined (Playwright's default window) when the size is missing or nonsense. */
|
|
474
|
+
export function sanitizeViewport(viewport?: ViewportOptions): ViewportOptions | undefined {
|
|
475
|
+
if (!viewport) return undefined;
|
|
476
|
+
const width = Math.trunc(Number(viewport.width));
|
|
477
|
+
const height = Math.trunc(Number(viewport.height));
|
|
478
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width < 200 || height < 200 || width > 7680 || height > 4320) {
|
|
479
|
+
return undefined;
|
|
480
|
+
}
|
|
481
|
+
const scale = Number(viewport.deviceScaleFactor);
|
|
482
|
+
return {
|
|
483
|
+
width,
|
|
484
|
+
height,
|
|
485
|
+
...(viewport.isMobile ? { isMobile: true } : {}),
|
|
486
|
+
...(viewport.hasTouch ? { hasTouch: true } : {}),
|
|
487
|
+
...(Number.isFinite(scale) && scale > 0 && scale <= 5 ? { deviceScaleFactor: scale } : {}),
|
|
488
|
+
...(typeof viewport.userAgent === "string" && viewport.userAgent.trim() && viewport.userAgent.length <= 400
|
|
489
|
+
? { userAgent: viewport.userAgent.trim() }
|
|
490
|
+
: {}),
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/** The Playwright `newContext` options a viewport stands for. */
|
|
495
|
+
export function contextViewportOptions(viewport?: ViewportOptions): Record<string, unknown> {
|
|
496
|
+
if (!viewport) return {};
|
|
497
|
+
return {
|
|
498
|
+
viewport: { width: viewport.width, height: viewport.height },
|
|
499
|
+
...(viewport.isMobile ? { isMobile: true } : {}),
|
|
500
|
+
...(viewport.hasTouch ? { hasTouch: true } : {}),
|
|
501
|
+
...(viewport.deviceScaleFactor ? { deviceScaleFactor: viewport.deviceScaleFactor } : {}),
|
|
502
|
+
...(viewport.userAgent ? { userAgent: viewport.userAgent } : {}),
|
|
503
|
+
};
|
|
504
|
+
}
|