@solidxai/core 0.1.22-beta.0 → 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 +22 -0
- package/dist/controllers/chatter-message.controller.d.ts +4 -0
- package/dist/controllers/chatter-message.controller.d.ts.map +1 -1
- package/dist/controllers/chatter-message.controller.js +13 -0
- package/dist/controllers/chatter-message.controller.js.map +1 -1
- 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/import-chatter-from-odoo.dto.d.ts +12 -0
- package/dist/dtos/import-chatter-from-odoo.dto.d.ts.map +1 -0
- package/dist/dtos/import-chatter-from-odoo.dto.js +66 -0
- package/dist/dtos/import-chatter-from-odoo.dto.js.map +1 -0
- 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/entities/chatter-message.entity.d.ts +1 -0
- package/dist/entities/chatter-message.entity.d.ts.map +1 -1
- package/dist/entities/chatter-message.entity.js +6 -1
- package/dist/entities/chatter-message.entity.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/interfaces.d.ts +4 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.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/jobs/rabbitmq/odoo-chatter-import-queue-options.d.ts +18 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-options.d.ts.map +1 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-options.js +11 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-options.js.map +1 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-publisher.service.d.ts +12 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-publisher.service.d.ts.map +1 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-publisher.service.js +39 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-publisher.service.js.map +1 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-subscriber.service.d.ts +22 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-subscriber.service.d.ts.map +1 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-subscriber.service.js +51 -0
- package/dist/jobs/rabbitmq/odoo-chatter-import-queue-subscriber.service.js.map +1 -0
- 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/chatter-message.service.d.ts +44 -1
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +240 -2
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/mediaStorageProviders/file-s3-storage-provider.d.ts +4 -1
- package/dist/services/mediaStorageProviders/file-s3-storage-provider.d.ts.map +1 -1
- package/dist/services/mediaStorageProviders/file-s3-storage-provider.js +4 -2
- package/dist/services/mediaStorageProviders/file-s3-storage-provider.js.map +1 -1
- package/dist/services/mediaStorageProviders/file-storage-provider.d.ts +4 -1
- package/dist/services/mediaStorageProviders/file-storage-provider.d.ts.map +1 -1
- package/dist/services/mediaStorageProviders/file-storage-provider.js +3 -0
- package/dist/services/mediaStorageProviders/file-storage-provider.js.map +1 -1
- 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/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +4 -0
- package/dist/solid-core.module.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/chatter-message.controller.ts +7 -0
- 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/import-chatter-from-odoo.dto.ts +47 -0
- package/src/dtos/test-run-request.dto.ts +18 -0
- package/src/entities/chatter-message.entity.ts +12 -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/interfaces.ts +1 -1
- package/src/jobs/database/test-run-queue-subscriber-database.service.ts +21 -5
- package/src/jobs/rabbitmq/odoo-chatter-import-queue-options.ts +24 -0
- package/src/jobs/rabbitmq/odoo-chatter-import-queue-publisher.service.ts +23 -0
- package/src/jobs/rabbitmq/odoo-chatter-import-queue-subscriber.service.ts +38 -0
- package/src/seeders/module-metadata-seeder.service.ts +154 -0
- package/src/seeders/seed-data/solid-core-metadata.json +0 -47
- package/src/services/chatter-message.service.ts +408 -0
- package/src/services/mediaStorageProviders/file-s3-storage-provider.ts +5 -3
- package/src/services/mediaStorageProviders/file-storage-provider.ts +4 -1
- 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/solid-core.module.ts +4 -0
- 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 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-target.js","sourceRoot":"","sources":["../../../../src/testing/adapters/ui/resolve-target.ts"],"names":[],"mappings":";;;AA6BA,oDAUC;AAkCD,sCA+CC;AA9GY,QAAA,gBAAgB,GAAG,KAAK,CAAC;AAWtC,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK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AM,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;YAAE,SAAS;QAE/D,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YAAE,OAAO,OAAO,CAAC;QACrD,EAAE,CAAC,UAAU,CAAC;YACZ,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,SAAS,CAAC,QAAQ;YACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,MAAM;SACP,CAAC,CAAC;QACH,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { Locator, Page } from \"playwright\";\n\nimport type { TestContext } from \"../../contracts/runtime-context.types\";\nimport type { OpStep, TargetFingerprint } from \"../../contracts/testing-metadata.types\";\n\n/**\n * How long the primary selector gets to attach before alternatives are tried. Short on\n * purpose: alternatives only run when they exist, and the action that follows still\n * waits its full timeout on whichever selector wins.\n */\nexport const PRIMARY_GRACE_MS = 2_500;\n\nexport interface TargetInput {\n selector?: string;\n /** Alternative selectors, tried in order when the primary does not attach. */\n fallbacks?: string[];\n /** Element identity used when every selector misses. */\n fingerprint?: TargetFingerprint;\n timeoutMs?: number;\n}\n\nfunction quote(value: string): string {\n return JSON.stringify(value);\n}\n\n/**\n * Selector strings for a fingerprint, most specific first. They are plain selector\n * strings (not Locator objects) so a heal can be written straight back into a scenario.\n */\nexport function fingerprintSelectors(fp: TargetFingerprint): string[] {\n const out: string[] = [];\n const scope = fp.within ? `${fp.within} >> ` : \"\";\n if (fp.testId) out.push(`${scope}[data-testid=${quote(fp.testId)}]`);\n if (fp.role && fp.name) out.push(`${scope}role=${fp.role}[name=${quote(fp.name)}i]`);\n if (fp.label) out.push(`${scope}internal:label=${quote(fp.label)}i`);\n if (fp.placeholder) out.push(`${scope}[placeholder=${quote(fp.placeholder)}]`);\n if (fp.role && !fp.name && fp.text) out.push(`${scope}role=${fp.role} >> text=${quote(fp.text)}`);\n if (!fp.role && fp.text) out.push(`${scope}text=${quote(fp.text)}`);\n return out;\n}\n\nasync function attached(page: Page, selector: string, timeoutMs: number): Promise<boolean> {\n const locator = page.locator(selector).first();\n try {\n if (timeoutMs > 0) {\n await locator.waitFor({ state: \"attached\", timeout: timeoutMs });\n return true;\n }\n return (await page.locator(selector).count()) > 0;\n } catch {\n return false;\n }\n}\n\n/** An alternative is only trusted when it identifies exactly one visible element. */\nasync function uniqueVisible(page: Page, selector: string): Promise<boolean> {\n try {\n const locator: Locator = page.locator(selector);\n if ((await locator.count()) !== 1) return false;\n return await locator.isVisible();\n } catch {\n // An unparsable alternative must not break the step; it just never wins.\n return false;\n }\n}\n\n/**\n * Pick the selector a UI step should act on. Returns the primary unchanged when healing\n * is off, when the step has no alternatives, or when the primary attaches. Otherwise the\n * first alternative that matches one visible element wins and a heal is recorded on the\n * adapter. With nothing better, the primary is returned so the step fails with its\n * normal error.\n */\nexport async function resolveTarget(\n ctx: TestContext,\n step: OpStep,\n input: TargetInput,\n): Promise<string> {\n const primary = input.selector;\n if (!primary) {\n throw new Error(`Missing \"selector\" in step.with for op \"${step.op}\"`);\n }\n const ui = ctx.ui;\n const page = ui?.page;\n if (!ui || !page) return primary;\n\n const policy = ui.getHealingPolicy();\n const fallbacks = Array.isArray(input.fallbacks)\n ? input.fallbacks.filter((s): s is string => typeof s === \"string\" && s.length > 0 && s !== primary)\n : [];\n const fromFingerprint = input.fingerprint ? fingerprintSelectors(input.fingerprint) : [];\n if (policy === \"off\" || (fallbacks.length === 0 && fromFingerprint.length === 0)) {\n return primary;\n }\n\n const grace = Math.min(PRIMARY_GRACE_MS, ui.resolveTimeout(input.timeoutMs));\n if (await attached(page, primary, grace)) return primary;\n\n const candidates: Array<{ selector: string; strategy: \"fallback\" | \"fingerprint\" }> = [\n ...fallbacks.map((selector) => ({ selector, strategy: \"fallback\" as const })),\n ...fromFingerprint.map((selector) => ({ selector, strategy: \"fingerprint\" as const })),\n ];\n for (const candidate of candidates) {\n if (!(await uniqueVisible(page, candidate.selector))) continue;\n // A slow page can attach the primary just after the grace window; prefer it then.\n if (await attached(page, primary, 0)) return primary;\n ui.recordHeal({\n scenarioId: ctx.scenarioId,\n stepPath: ctx.stepPath,\n op: step.op,\n stepName: step.name,\n field: \"selector\",\n from: primary,\n to: candidate.selector,\n strategy: candidate.strategy,\n policy,\n });\n return candidate.selector;\n }\n return primary;\n}\n"]}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import type { HealingPolicy } from "../../contracts/testing-metadata.types";
|
|
1
2
|
export interface CaptureOptions {
|
|
2
3
|
console?: boolean;
|
|
3
4
|
network?: boolean;
|
|
4
5
|
}
|
|
6
|
+
export interface ViewportOptions {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
isMobile?: boolean;
|
|
10
|
+
hasTouch?: boolean;
|
|
11
|
+
deviceScaleFactor?: number;
|
|
12
|
+
userAgent?: string;
|
|
13
|
+
}
|
|
5
14
|
export interface PlaywrightAdapterOptions {
|
|
6
15
|
headless?: boolean;
|
|
7
16
|
baseUrl?: string;
|
|
@@ -9,5 +18,8 @@ export interface PlaywrightAdapterOptions {
|
|
|
9
18
|
navigationTimeoutMs?: number;
|
|
10
19
|
capture?: CaptureOptions;
|
|
11
20
|
recordVideo?: boolean;
|
|
21
|
+
healing?: HealingPolicy;
|
|
22
|
+
viewport?: ViewportOptions;
|
|
12
23
|
}
|
|
24
|
+
export type AttachOptions = Omit<PlaywrightAdapterOptions, "headless" | "recordVideo">;
|
|
13
25
|
//# sourceMappingURL=ui.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.types.d.ts","sourceRoot":"","sources":["../../../../src/testing/adapters/ui/ui.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui.types.d.ts","sourceRoot":"","sources":["../../../../src/testing/adapters/ui/ui.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAS5E,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAOD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAGD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.types.js","sourceRoot":"","sources":["../../../../src/testing/adapters/ui/ui.types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Per-run capture toggles for the Playwright adapter. Console/network events are\n * buffered while a scenario runs and only flushed (attached to the reporter) when the\n * scenario FAILS; passing scenarios discard them. API scenarios never open a page, so\n * nothing is captured. The whole-run video may be enabled per run and is kept only when\n * the run fails.\n */\nexport interface CaptureOptions {\n console?: boolean;\n network?: boolean;\n}\n\nexport interface PlaywrightAdapterOptions {\n headless?: boolean;\n baseUrl?: string;\n defaultTimeoutMs?: number;\n navigationTimeoutMs?: number;\n capture?: CaptureOptions;\n recordVideo?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ui.types.js","sourceRoot":"","sources":["../../../../src/testing/adapters/ui/ui.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { HealingPolicy } from \"../../contracts/testing-metadata.types\";\n\n/**\n * Per-run capture toggles for the Playwright adapter. Console/network events are\n * buffered while a scenario runs and only flushed (attached to the reporter) when the\n * scenario FAILS; passing scenarios discard them. API scenarios never open a page, so\n * nothing is captured. The whole-run video may be enabled per run and is kept only when\n * the run fails.\n */\nexport interface CaptureOptions {\n console?: boolean;\n network?: boolean;\n}\n\n/**\n * Browser window size for a run. `isMobile` and `hasTouch` make the page behave like a phone\n * (mobile meta-viewport handling, touch events); leave them off for a desktop-sized window.\n * Without a viewport Playwright's own default (1280x720) applies.\n */\nexport interface ViewportOptions {\n width: number;\n height: number;\n isMobile?: boolean;\n hasTouch?: boolean;\n deviceScaleFactor?: number;\n /** The device's browser identity, so a site that checks it sees a phone or tablet. */\n userAgent?: string;\n}\n\nexport interface PlaywrightAdapterOptions {\n headless?: boolean;\n baseUrl?: string;\n defaultTimeoutMs?: number;\n navigationTimeoutMs?: number;\n capture?: CaptureOptions;\n recordVideo?: boolean;\n /** Selector healing for UI steps; see {@link HealingPolicy}. Defaults to `report`. */\n healing?: HealingPolicy;\n viewport?: ViewportOptions;\n}\n\n/** Options for wrapping a page the caller already owns. */\nexport type AttachOptions = Omit<PlaywrightAdapterOptions, \"headless\" | \"recordVideo\">;\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ApiAdapter } from "../adapters/api/api-adapter";
|
|
2
|
+
import type { MobileAdapter } from "../adapters/mobile/mobile-adapter";
|
|
2
3
|
import type { PlaywrightAdapter } from "../adapters/ui/playwright-adapter";
|
|
3
4
|
import type { Reporter } from "../reporter/reporter.types";
|
|
4
5
|
import type { SpecRegistry } from "../core/spec-registry";
|
|
@@ -23,6 +24,7 @@ export interface TestContext {
|
|
|
23
24
|
resources: ResourceStore;
|
|
24
25
|
api?: ApiAdapter;
|
|
25
26
|
ui?: PlaywrightAdapter;
|
|
27
|
+
mobile?: MobileAdapter;
|
|
26
28
|
last?: {
|
|
27
29
|
apiResponse?: ApiResponse;
|
|
28
30
|
};
|
|
@@ -35,5 +37,17 @@ export interface TestContext {
|
|
|
35
37
|
options?: {
|
|
36
38
|
printApiLogs?: boolean;
|
|
37
39
|
};
|
|
40
|
+
stepPath?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface HealEvent {
|
|
43
|
+
scenarioId: string;
|
|
44
|
+
stepPath?: string;
|
|
45
|
+
op: string;
|
|
46
|
+
stepName?: string;
|
|
47
|
+
field: "selector" | "locator" | "locator.android" | "locator.ios";
|
|
48
|
+
from: string | Record<string, unknown>;
|
|
49
|
+
to: string | Record<string, unknown>;
|
|
50
|
+
strategy: "fallback" | "fingerprint";
|
|
51
|
+
policy: "report" | "auto";
|
|
38
52
|
}
|
|
39
53
|
//# sourceMappingURL=runtime-context.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-context.types.d.ts","sourceRoot":"","sources":["../../../src/testing/contracts/runtime-context.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY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C,EAAE,UAAU,CAAC;IACjB,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,WAAW,CAAA;KAAE,CAAC;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAK7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE9B,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;IAKF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,aAAa,CAAC;IAElE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,EAAE,UAAU,GAAG,aAAa,CAAC;IACrC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-context.types.js","sourceRoot":"","sources":["../../../src/testing/contracts/runtime-context.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ApiAdapter } from \"../adapters/api/api-adapter\";\nimport type { PlaywrightAdapter } from \"../adapters/ui/playwright-adapter\";\nimport type { Reporter } from \"../reporter/reporter.types\";\nimport type { SpecRegistry } from \"../core/spec-registry\";\nimport type { RandomDataRegistry } from \"../core/random-data\";\nimport type { ScenarioType } from \"./testing-metadata.types\";\n\nexport type StepPhase = \"given\" | \"when\" | \"then\" | \"and\" | \"step\";\n\nexport interface ResourceStore {\n get(path: string): unknown;\n set(path: string, value: unknown): void;\n has(path: string): boolean;\n}\n\nexport interface ApiResponse {\n status: number;\n headers: Record<string, string>;\n bodyText: string;\n bodyJson?: unknown;\n}\n\nexport interface TestContext {\n scenarioId: string;\n scenarioType: ScenarioType;\n params: Record<string, any>;\n resources: ResourceStore;\n api?: ApiAdapter;\n ui?: PlaywrightAdapter;\n last?: { apiResponse?: ApiResponse };\n reporter: Reporter;\n specRegistry?: SpecRegistry;\n testData?: Record<string, Record<string, any>>;\n env?: Record<string, string>;\n /**\n * Secrets referenced by this scenario, resolved server-side before the run.\n * Scoped per scenario — a scenario never sees another scenario's secrets.\n */\n secrets?: Record<string, any>;\n /** Hands out `${random:...}` and `util.random` values; one per run, so values never repeat in it. */\n randomData?: RandomDataRegistry;\n options?: {\n printApiLogs?: boolean;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-context.types.js","sourceRoot":"","sources":["../../../src/testing/contracts/runtime-context.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ApiAdapter } from \"../adapters/api/api-adapter\";\nimport type { MobileAdapter } from \"../adapters/mobile/mobile-adapter\";\nimport type { PlaywrightAdapter } from \"../adapters/ui/playwright-adapter\";\nimport type { Reporter } from \"../reporter/reporter.types\";\nimport type { SpecRegistry } from \"../core/spec-registry\";\nimport type { RandomDataRegistry } from \"../core/random-data\";\nimport type { ScenarioType } from \"./testing-metadata.types\";\n\nexport type StepPhase = \"given\" | \"when\" | \"then\" | \"and\" | \"step\";\n\nexport interface ResourceStore {\n get(path: string): unknown;\n set(path: string, value: unknown): void;\n has(path: string): boolean;\n}\n\nexport interface ApiResponse {\n status: number;\n headers: Record<string, string>;\n bodyText: string;\n bodyJson?: unknown;\n}\n\nexport interface TestContext {\n scenarioId: string;\n scenarioType: ScenarioType;\n params: Record<string, any>;\n resources: ResourceStore;\n api?: ApiAdapter;\n ui?: PlaywrightAdapter;\n mobile?: MobileAdapter;\n last?: { apiResponse?: ApiResponse };\n reporter: Reporter;\n specRegistry?: SpecRegistry;\n testData?: Record<string, Record<string, any>>;\n env?: Record<string, string>;\n /**\n * Secrets referenced by this scenario, resolved server-side before the run.\n * Scoped per scenario — a scenario never sees another scenario's secrets.\n */\n secrets?: Record<string, any>;\n /** Hands out `${random:...}` and `util.random` values; one per run, so values never repeat in it. */\n randomData?: RandomDataRegistry;\n options?: {\n printApiLogs?: boolean;\n };\n /**\n * Location of the step currently executing, as a path into the scenario\n * (`steps[3].when`, `steps[5].then[1]`). Heal reports use it to address the step.\n */\n stepPath?: string;\n}\n\n/**\n * A step that passed only because a fallback or fingerprint replaced its selector (UI) or locator (mobile). A mobile heal\n * names which locator it replaced: the base one, or the override for the platform the run was on.\n */\nexport interface HealEvent {\n scenarioId: string;\n stepPath?: string;\n op: string;\n stepName?: string;\n field: \"selector\" | \"locator\" | \"locator.android\" | \"locator.ios\";\n /** The selector string (UI), or the `{ by, value, index? }` locator (mobile) that missed. */\n from: string | Record<string, unknown>;\n to: string | Record<string, unknown>;\n strategy: \"fallback\" | \"fingerprint\";\n policy: \"report\" | \"auto\";\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ScenarioType = "api" | "ui" | "mixed";
|
|
1
|
+
export type ScenarioType = "api" | "ui" | "mixed" | "mobile";
|
|
2
2
|
export interface TestingDataRecord {
|
|
3
3
|
modelUserKey: string;
|
|
4
4
|
recUserKeyValue: string;
|
|
@@ -35,8 +35,35 @@ export interface ScenarioSpec {
|
|
|
35
35
|
tags?: string[];
|
|
36
36
|
timeoutMs?: number;
|
|
37
37
|
retries?: number;
|
|
38
|
+
dependsOn?: string[];
|
|
39
|
+
restoreFrom?: string;
|
|
40
|
+
saveSession?: boolean;
|
|
41
|
+
session?: ScenarioSessionMode;
|
|
42
|
+
reset?: boolean;
|
|
38
43
|
steps: StepBlock[];
|
|
39
44
|
}
|
|
45
|
+
export type ScenarioSessionMode = "shared" | "restore" | "fresh";
|
|
46
|
+
export type HealingPolicy = "off" | "report" | "auto";
|
|
47
|
+
export interface TargetFingerprint {
|
|
48
|
+
role?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
label?: string;
|
|
51
|
+
placeholder?: string;
|
|
52
|
+
testId?: string;
|
|
53
|
+
text?: string;
|
|
54
|
+
within?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface MobileFingerprint {
|
|
57
|
+
kind?: string;
|
|
58
|
+
label?: string;
|
|
59
|
+
text?: string;
|
|
60
|
+
accessibilityId?: string;
|
|
61
|
+
resourceId?: string;
|
|
62
|
+
within?: {
|
|
63
|
+
by: string;
|
|
64
|
+
value: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
40
67
|
export type StepBlock = {
|
|
41
68
|
given: OpStep;
|
|
42
69
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-metadata.types.d.ts","sourceRoot":"","sources":["../../../src/testing/contracts/testing-metadata.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"testing-metadata.types.d.ts","sourceRoot":"","sources":["../../../src/testing/contracts/testing-metadata.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAA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AAM,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-metadata.types.js","sourceRoot":"","sources":["../../../src/testing/contracts/testing-metadata.types.ts"],"names":[],"mappings":"","sourcesContent":["export type ScenarioType = \"api\" | \"ui\" | \"mixed\";\n\nexport interface TestingDataRecord {\n modelUserKey: string;\n recUserKeyValue: string;\n data: Record<string, any>;\n}\n\nexport interface TestingRoleSpec {\n name: string;\n permissions?: string[];\n}\n\nexport interface TestingUserSpec {\n username: string;\n email: string;\n password: string;\n fullName?: string;\n mobile?: string;\n roles?: string[];\n /**\n * Seed this user through the registered IExtensionUserCreationProvider, making it\n * an instance of the app's extension entity rather than a base `User`.\n *\n * Absent means a base `User`, so existing specs are unaffected. Set it on users\n * that carry extension fields (`userType` and the like) - without it those fields\n * are ignored and a plain `User` is created.\n *\n * `roles` is ignored on a flagged user: the provider derives them from the\n * extension fields, exactly as it does on the model's own CRUD form.\n */\n isExtensionUser?: boolean;\n [key: string]: any;\n}\n\nexport interface TestingMetadata {\n testing: {\n specs?: string[];\n roles?: TestingRoleSpec[];\n users?: TestingUserSpec[];\n data?: TestingDataRecord[];\n scenarios: ScenarioSpec[];\n };\n}\n\nexport interface ScenarioSpec {\n id: string;\n name?: string;\n type: ScenarioType;\n params?: Record<string, any>;\n tags?: string[];\n timeoutMs?: number;\n retries?: number;\n steps: StepBlock[];\n}\n\n/**\n * A step can be written in a phase block (Given/When/Then/And) or as a flat op step.\n */\nexport type StepBlock =\n | { given: OpStep }\n | { when: OpStep }\n | { then: OpStep | OpStep[] }\n | { and: OpStep }\n | OpStep;\n\nexport interface OpStep {\n op: string;\n with?: Record<string, any>;\n saveAs?: string;\n name?: string;\n // spec is used by op \"test.spec\" to point to a registered custom spec implementation.\n spec?: string;\n timeoutMs?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"testing-metadata.types.js","sourceRoot":"","sources":["../../../src/testing/contracts/testing-metadata.types.ts"],"names":[],"mappings":"","sourcesContent":["export type ScenarioType = \"api\" | \"ui\" | \"mixed\" | \"mobile\";\n\nexport interface TestingDataRecord {\n modelUserKey: string;\n recUserKeyValue: string;\n data: Record<string, any>;\n}\n\nexport interface TestingRoleSpec {\n name: string;\n permissions?: string[];\n}\n\nexport interface TestingUserSpec {\n username: string;\n email: string;\n password: string;\n fullName?: string;\n mobile?: string;\n roles?: string[];\n /**\n * Seed this user through the registered IExtensionUserCreationProvider, making it\n * an instance of the app's extension entity rather than a base `User`.\n *\n * Absent means a base `User`, so existing specs are unaffected. Set it on users\n * that carry extension fields (`userType` and the like) - without it those fields\n * are ignored and a plain `User` is created.\n *\n * `roles` is ignored on a flagged user: the provider derives them from the\n * extension fields, exactly as it does on the model's own CRUD form.\n */\n isExtensionUser?: boolean;\n [key: string]: any;\n}\n\nexport interface TestingMetadata {\n testing: {\n specs?: string[];\n roles?: TestingRoleSpec[];\n users?: TestingUserSpec[];\n data?: TestingDataRecord[];\n scenarios: ScenarioSpec[];\n };\n}\n\nexport interface ScenarioSpec {\n id: string;\n name?: string;\n type: ScenarioType;\n params?: Record<string, any>;\n tags?: string[];\n timeoutMs?: number;\n retries?: number;\n /**\n * Scenarios that must pass before this one runs. Selecting this scenario pulls its\n * dependencies into the run; a failed dependency skips it with `dependency_failed`.\n * Using it anywhere in a run switches that run from fail-fast to dependency-aware.\n */\n dependsOn?: string[];\n /**\n * Start as the identity another scenario signed in as: `restoreFrom: \"login\"` means `login` runs first, its state is saved\n * (it needs no `saveSession`), and this scenario starts from it (`session: \"restore\"`). It is also a dependency, so it need\n * not be listed in `dependsOn`, which keeps only ordering and data dependencies. Only client state is restored (cookies and\n * storage on the web, the signed-in app on mobile), never the page or screen. One scenario id, not a list.\n */\n restoreFrom?: string;\n /** Keep this scenario's browser storage state (cookies + localStorage) after it passes. */\n saveSession?: boolean;\n /**\n * Browser context for this scenario:\n * - `shared` (default): keep the context left by the previous scenario.\n * - `restore`: new context seeded from the nearest `dependsOn` entry that saved a session.\n * - `fresh`: new empty context.\n */\n session?: ScenarioSessionMode;\n /**\n * Mobile only. Marks the one scenario that brings the app back to its signed-out start screen from any state. A real\n * iPhone cannot clear an app's data, so the runner runs this before a scenario that needs a fresh start. It is never run\n * or counted as a scenario of its own.\n */\n reset?: boolean;\n steps: StepBlock[];\n}\n\nexport type ScenarioSessionMode = \"shared\" | \"restore\" | \"fresh\";\n\n/**\n * How UI steps react when their primary selector is missing:\n * - `off`: primary selector only.\n * - `report` (default): fall back to `fallbacks` / `fingerprint`, keep running, report the heal.\n * - `auto`: as `report`, and mark the heal for automatic application to the scenario file.\n */\nexport type HealingPolicy = \"off\" | \"report\" | \"auto\";\n\n/**\n * Identity of a UI target, recorded at authoring time and used to re-find the element\n * when every selector misses. Matched with Playwright's user-facing locators only.\n */\nexport interface TargetFingerprint {\n role?: string;\n name?: string;\n label?: string;\n placeholder?: string;\n testId?: string;\n text?: string;\n /** Selector scoping the search, e.g. a dialog or form. */\n within?: string;\n}\n\n/**\n * Identity of a mobile element, recorded at authoring time and used to find it again when every locator misses. Only\n * `accessibilityId`, `resourceId`, `text` and `label` are matched today; `kind` and `within` are kept for the reviewer.\n */\nexport interface MobileFingerprint {\n /** Short class of the element, e.g. \"Button\", \"EditText\", \"XCUIElementTypeButton\". */\n kind?: string;\n /** The visible label the author saw. */\n label?: string;\n text?: string;\n /** Content description on Android, name on iOS. */\n accessibilityId?: string;\n /** Android resource id without the package prefix. */\n resourceId?: string;\n /** Nearest ancestor with an accessibility id. */\n within?: { by: string; value: string };\n}\n\n/**\n * A step can be written in a phase block (Given/When/Then/And) or as a flat op step.\n */\nexport type StepBlock =\n | { given: OpStep }\n | { when: OpStep }\n | { then: OpStep | OpStep[] }\n | { and: OpStep }\n | OpStep;\n\nexport interface OpStep {\n op: string;\n with?: Record<string, any>;\n saveAs?: string;\n name?: string;\n // spec is used by op \"test.spec\" to point to a registered custom spec implementation.\n spec?: string;\n timeoutMs?: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-registry.d.ts","sourceRoot":"","sources":["../../../src/testing/core/step-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAE3E,MAAM,WAAW,WAAW;IAK1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI;IAU3E,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW;IAQ5B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAKxB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"step-registry.d.ts","sourceRoot":"","sources":["../../../src/testing/core/step-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAE3E,MAAM,WAAW,WAAW;IAK1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI;IAU3E,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW;IAQ5B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAKxB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE;IAInC,GAAG,IAAI,MAAM,EAAE;CAGhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-registry.js","sourceRoot":"","sources":["../../../src/testing/core/step-registry.ts"],"names":[],"mappings":";;;AAaA,MAAa,YAAY;IAAzB;QACmB,aAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;QAC1C,YAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"step-registry.js","sourceRoot":"","sources":["../../../src/testing/core/step-registry.ts"],"names":[],"mappings":";;;AAaA,MAAa,YAAY;IAAzB;QACmB,aAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;QAC1C,YAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAgCzD,CAAC;IA9BC,QAAQ,CAAC,EAAU,EAAE,OAAoB,EAAE,UAAuB,EAAE;QAClE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC/B,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,uCAAuC,EAAE,GAAG,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAGD,aAAa,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;IACpC,CAAC;IAED,GAAG;QACD,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;CACF;AAlCD,oCAkCC","sourcesContent":["import type { TestContext } from \"../contracts/runtime-context.types\";\nimport type { OpStep } from \"../contracts/testing-metadata.types\";\n\nexport type StepHandler = (ctx: TestContext, step: OpStep) => Promise<any>;\n\nexport interface StepOptions {\n /**\n * `with` fields handed to the handler as written, not interpolated: for a field whose own `${...}`\n * means something else, such as the JavaScript template literals in util.script's `script`.\n */\n rawWith?: string[];\n}\n\nexport class StepRegistry {\n private readonly handlers = new Map<string, StepHandler>();\n private readonly rawWith = new Map<string, string[]>();\n\n register(op: string, handler: StepHandler, options: StepOptions = {}): void {\n if (this.handlers.has(op)) {\n throw new Error(`Step handler already registered for op: \"${op}\"`);\n }\n this.handlers.set(op, handler);\n if (options.rawWith?.length) {\n this.rawWith.set(op, options.rawWith);\n }\n }\n\n get(op: string): StepHandler {\n const handler = this.handlers.get(op);\n if (!handler) {\n throw new Error(`No step handler registered for op: \"${op}\"`);\n }\n return handler;\n }\n\n has(op: string): boolean {\n return this.handlers.has(op);\n }\n\n /** The `with` fields of `op` that the engine must not interpolate; empty for most ops. */\n rawWithFields(op: string): string[] {\n return this.rawWith.get(op) ?? [];\n }\n\n ops(): string[] {\n return [...this.handlers.keys()].sort();\n }\n}\n"]}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type { TestContext } from "../contracts/runtime-context.types";
|
|
2
|
-
import type { ScenarioSpec } from "../contracts/testing-metadata.types";
|
|
1
|
+
import type { TestContext, StepPhase } from "../contracts/runtime-context.types";
|
|
2
|
+
import type { OpStep, ScenarioSpec, StepBlock } from "../contracts/testing-metadata.types";
|
|
3
3
|
import { StepRegistry } from "./step-registry";
|
|
4
|
+
export declare function stepPathFor(block: StepBlock, blockIndex: number, stepIndex: number): string;
|
|
5
|
+
export interface ScenarioSetup {
|
|
6
|
+
kind: string;
|
|
7
|
+
scenario: ScenarioSpec;
|
|
8
|
+
secrets?: Record<string, any>;
|
|
9
|
+
probe?: {
|
|
10
|
+
locator: unknown;
|
|
11
|
+
timeoutMs: number;
|
|
12
|
+
};
|
|
13
|
+
orElse?: ScenarioSetup[];
|
|
14
|
+
}
|
|
4
15
|
export declare class TestingEngine {
|
|
5
16
|
private readonly registry;
|
|
6
17
|
private readonly defaults?;
|
|
@@ -8,8 +19,9 @@ export declare class TestingEngine {
|
|
|
8
19
|
timeoutMs?: number;
|
|
9
20
|
retries?: number;
|
|
10
21
|
});
|
|
11
|
-
runScenario(scenario: ScenarioSpec, ctxBase: Omit<TestContext, "scenarioId" | "scenarioType" | "params"
|
|
22
|
+
runScenario(scenario: ScenarioSpec, ctxBase: Omit<TestContext, "scenarioId" | "scenarioType" | "params">, setup?: ScenarioSetup[]): Promise<void>;
|
|
23
|
+
private runSetup;
|
|
12
24
|
private resolveStep;
|
|
13
|
-
|
|
25
|
+
runStep(phase: StepPhase, step: OpStep, ctx: TestContext, stepPath?: string, setup?: string): Promise<unknown>;
|
|
14
26
|
}
|
|
15
27
|
//# sourceMappingURL=testing-engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-engine.d.ts","sourceRoot":"","sources":["../../../src/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;IAkBb,OAAO,CACX,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC;CA+CpB"}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TestingEngine = void 0;
|
|
4
|
+
exports.stepPathFor = stepPathFor;
|
|
4
5
|
const interpolation_1 = require("./interpolation");
|
|
5
6
|
const normalize_steps_1 = require("./normalize-steps");
|
|
7
|
+
const lifecycle_1 = require("../runner/lifecycle");
|
|
6
8
|
const timeout_1 = require("./timeout");
|
|
9
|
+
function stepPathFor(block, blockIndex, stepIndex) {
|
|
10
|
+
const base = `steps[${blockIndex}]`;
|
|
11
|
+
if ("given" in block)
|
|
12
|
+
return `${base}.given`;
|
|
13
|
+
if ("when" in block)
|
|
14
|
+
return `${base}.when`;
|
|
15
|
+
if ("and" in block)
|
|
16
|
+
return `${base}.and`;
|
|
17
|
+
if ("then" in block) {
|
|
18
|
+
return Array.isArray(block.then) ? `${base}.then[${stepIndex}]` : `${base}.then`;
|
|
19
|
+
}
|
|
20
|
+
return base;
|
|
21
|
+
}
|
|
22
|
+
const SLOW_CALL_REPORT_MS = 2000;
|
|
7
23
|
class TestingEngine {
|
|
8
24
|
constructor(registry, defaults) {
|
|
9
25
|
this.registry = registry;
|
|
10
26
|
this.defaults = defaults;
|
|
11
27
|
}
|
|
12
|
-
async runScenario(scenario, ctxBase) {
|
|
28
|
+
async runScenario(scenario, ctxBase, setup = []) {
|
|
13
29
|
const retries = scenario.retries ?? this.defaults?.retries ?? 0;
|
|
14
30
|
const maxAttempts = Math.max(0, retries) + 1;
|
|
15
31
|
const scenarioTimeoutMs = scenario.timeoutMs ?? this.defaults?.timeoutMs;
|
|
@@ -25,11 +41,25 @@ class TestingEngine {
|
|
|
25
41
|
let scenarioError;
|
|
26
42
|
reporter.onScenarioStart(scenario);
|
|
27
43
|
ctx.ui?.resetCapture();
|
|
44
|
+
const usesMobile = (0, lifecycle_1.scenarioNeedsMobile)(scenario) && !!ctx.mobile?.isStarted();
|
|
45
|
+
if (usesMobile)
|
|
46
|
+
await ctx.mobile?.resetCapture();
|
|
28
47
|
try {
|
|
29
48
|
const execute = async () => {
|
|
30
|
-
for (const
|
|
49
|
+
for (const part of setup) {
|
|
50
|
+
await this.runSetup(part, ctx);
|
|
51
|
+
if (part.probe) {
|
|
52
|
+
const there = await ctx.mobile?.findDisplayed(part.probe.locator, part.probe.timeoutMs).then(() => true, () => false);
|
|
53
|
+
if (!there)
|
|
54
|
+
for (const fallback of part.orElse ?? [])
|
|
55
|
+
await this.runSetup(fallback, ctx);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
for (const [blockIndex, block] of scenario.steps.entries()) {
|
|
31
59
|
const normalized = (0, normalize_steps_1.normalizeBlock)(block);
|
|
32
|
-
|
|
60
|
+
for (const [stepIndex, step] of normalized.steps.entries()) {
|
|
61
|
+
await this.runStep(normalized.phase, step, ctx, stepPathFor(block, blockIndex, stepIndex));
|
|
62
|
+
}
|
|
33
63
|
}
|
|
34
64
|
};
|
|
35
65
|
if (scenarioTimeoutMs !== undefined) {
|
|
@@ -58,11 +88,28 @@ class TestingEngine {
|
|
|
58
88
|
catch {
|
|
59
89
|
}
|
|
60
90
|
}
|
|
91
|
+
if (scenarioError && usesMobile && reporter.attach) {
|
|
92
|
+
try {
|
|
93
|
+
const artifacts = (await ctx.mobile?.collectFailureArtifacts()) ?? [];
|
|
94
|
+
for (const a of artifacts) {
|
|
95
|
+
reporter.attach({
|
|
96
|
+
scenarioId: ctx.scenarioId,
|
|
97
|
+
name: a.name,
|
|
98
|
+
contentType: a.contentType,
|
|
99
|
+
data: a.data,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
}
|
|
105
|
+
}
|
|
61
106
|
const durationMs = Date.now() - scenarioStart;
|
|
107
|
+
const heals = [...(ctx.ui?.getHeals() ?? []), ...(ctx.mobile?.getHeals() ?? [])];
|
|
62
108
|
reporter.onScenarioEnd(scenario, {
|
|
63
109
|
ok: !scenarioError,
|
|
64
110
|
error: scenarioError,
|
|
65
111
|
durationMs,
|
|
112
|
+
...(heals.length ? { heals } : {}),
|
|
66
113
|
});
|
|
67
114
|
}
|
|
68
115
|
if (!scenarioError) {
|
|
@@ -73,6 +120,29 @@ class TestingEngine {
|
|
|
73
120
|
}
|
|
74
121
|
}
|
|
75
122
|
}
|
|
123
|
+
async runSetup(part, ctx) {
|
|
124
|
+
const partCtx = {
|
|
125
|
+
...ctx,
|
|
126
|
+
scenarioId: part.scenario.id,
|
|
127
|
+
scenarioType: part.scenario.type,
|
|
128
|
+
params: part.scenario.params ?? {},
|
|
129
|
+
secrets: part.secrets,
|
|
130
|
+
};
|
|
131
|
+
for (const [blockIndex, block] of part.scenario.steps.entries()) {
|
|
132
|
+
const normalized = (0, normalize_steps_1.normalizeBlock)(block);
|
|
133
|
+
for (const [stepIndex, step] of normalized.steps.entries()) {
|
|
134
|
+
const stepPath = stepPathFor(block, blockIndex, stepIndex);
|
|
135
|
+
try {
|
|
136
|
+
await this.runStep(normalized.phase, step, partCtx, stepPath, part.kind);
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
const failure = new Error(`Setup "${part.kind}" (scenario "${part.scenario.id}") failed at ${stepPath}: ${err?.message ?? err}`);
|
|
140
|
+
failure.cause = err;
|
|
141
|
+
throw failure;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
76
146
|
resolveStep(step, ctx) {
|
|
77
147
|
const raw = this.registry
|
|
78
148
|
.rawWithFields(step.op)
|
|
@@ -87,39 +157,45 @@ class TestingEngine {
|
|
|
87
157
|
const kept = Object.fromEntries(raw.map((field) => [field, step.with[field]]));
|
|
88
158
|
return { ...resolved, with: { ...resolved.with, ...kept } };
|
|
89
159
|
}
|
|
90
|
-
async
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
160
|
+
async runStep(phase, step, ctx, stepPath, setup) {
|
|
161
|
+
const reporter = ctx.reporter;
|
|
162
|
+
const stepStart = Date.now();
|
|
163
|
+
let stepError;
|
|
164
|
+
let resolvedStep;
|
|
165
|
+
let result;
|
|
166
|
+
ctx.stepPath = stepPath;
|
|
167
|
+
reporter.onStepStart({ scenarioId: ctx.scenarioId, phase, step, stepPath, ...(setup ? { setup } : {}) });
|
|
168
|
+
try {
|
|
169
|
+
resolvedStep = this.resolveStep(step, ctx);
|
|
170
|
+
const handler = this.registry.get(resolvedStep.op);
|
|
171
|
+
const run = handler(ctx, resolvedStep);
|
|
172
|
+
result =
|
|
173
|
+
resolvedStep.timeoutMs !== undefined
|
|
102
174
|
? await (0, timeout_1.withTimeout)(run, resolvedStep.timeoutMs, `Step timeout after ${resolvedStep.timeoutMs}ms: "${resolvedStep.op}"`)
|
|
103
175
|
: await run;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch (err) {
|
|
109
|
-
stepError = err;
|
|
110
|
-
throw err;
|
|
111
|
-
}
|
|
112
|
-
finally {
|
|
113
|
-
const durationMs = Date.now() - stepStart;
|
|
114
|
-
reporter.onStepEnd({
|
|
115
|
-
scenarioId: ctx.scenarioId,
|
|
116
|
-
phase,
|
|
117
|
-
step: resolvedStep ?? step,
|
|
118
|
-
ok: !stepError,
|
|
119
|
-
error: stepError,
|
|
120
|
-
durationMs,
|
|
121
|
-
});
|
|
176
|
+
if (resolvedStep.saveAs) {
|
|
177
|
+
ctx.resources.set(resolvedStep.saveAs, result);
|
|
122
178
|
}
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
stepError = err;
|
|
183
|
+
throw err;
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
const durationMs = Date.now() - stepStart;
|
|
187
|
+
const slowestCallMs = ctx.mobile?.takeSlowestCallMs() ?? 0;
|
|
188
|
+
reporter.onStepEnd({
|
|
189
|
+
scenarioId: ctx.scenarioId,
|
|
190
|
+
phase,
|
|
191
|
+
step: resolvedStep ?? step,
|
|
192
|
+
ok: !stepError,
|
|
193
|
+
error: stepError,
|
|
194
|
+
durationMs,
|
|
195
|
+
stepPath,
|
|
196
|
+
...(slowestCallMs >= SLOW_CALL_REPORT_MS ? { slowestCallMs } : {}),
|
|
197
|
+
...(setup ? { setup } : {}),
|
|
198
|
+
});
|
|
123
199
|
}
|
|
124
200
|
}
|
|
125
201
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-engine.js","sourceRoot":"","sources":["../../../src/testing/core/testing-engine.ts"],"names":[],"mappings":";;;AAEA,mDAAkD;AAClD,uDAAmD;AAEnD,uCAAwC;AAExC,MAAa,aAAa;IAIxB,YACE,QAAsB,EACtB,QAAmD;QAEnD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,WAAW,CACf,QAAsB,EACtB,OAAoE;QAEpE,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,OAAO,IAAI,CAAC,CAAC;QAChE,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,iBAAiB,GACrB,QAAQ,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;QAEjD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,WAAW,EAA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GAAG,EACH,YAAY,CAAC,SAAS,EACtB,sBAAsB,YAAY,CAAC,SAAS,QAAQ,YAAY,CAAC,EAAE,GAAG,CACvE;oBACD,CAAC,CAAC,MAAM,GAAG,CAAC;gBAEhB,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;oBAExB,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACjD,CAAC;YACH,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,SAAS,GAAG,GAAG,CAAC;gBAChB,MAAM,GAAG,CAAC;YACZ,CAAC;oBAAS,CAAC;gBACT,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;gBAC1C,QAAQ,CAAC,SAAS,CAAC;oBACjB,UAAU,EAAE,GAAG,CAAC,UAAU;oBAC1B,KAAK;oBACL,IAAI,EAAE,YAAY,IAAI,IAAI;oBAC1B,EAAE,EAAE,CAAC,SAAS;oBACd,KAAK,EAAE,SAAS;oBAChB,UAAU;iBACX,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA5JD,sCA4JC","sourcesContent":["import type { TestContext, StepPhase } from \"../contracts/runtime-context.types\";\nimport type { OpStep, ScenarioSpec } from \"../contracts/testing-metadata.types\";\nimport { interpolateDeep } from \"./interpolation\";\nimport { normalizeBlock } from \"./normalize-steps\";\nimport { StepRegistry } from \"./step-registry\";\nimport { withTimeout } from \"./timeout\";\n\nexport class TestingEngine {\n private readonly registry: StepRegistry;\n private readonly defaults?: { timeoutMs?: number; retries?: number };\n\n constructor(\n registry: StepRegistry,\n defaults?: { timeoutMs?: number; retries?: number },\n ) {\n this.registry = registry;\n this.defaults = defaults;\n }\n\n async runScenario(\n scenario: ScenarioSpec,\n ctxBase: Omit<TestContext, \"scenarioId\" | \"scenarioType\" | \"params\">,\n ): Promise<void> {\n const retries = scenario.retries ?? this.defaults?.retries ?? 0;\n const maxAttempts = Math.max(0, retries) + 1;\n const scenarioTimeoutMs =\n scenario.timeoutMs ?? this.defaults?.timeoutMs;\n\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n const ctx: TestContext = {\n ...ctxBase,\n scenarioId: scenario.id,\n scenarioType: scenario.type,\n params: scenario.params ?? {},\n };\n\n const reporter = ctx.reporter;\n const scenarioStart = Date.now();\n let scenarioError: unknown;\n\n reporter.onScenarioStart(scenario);\n // Start a clean capture window for this scenario (UI adapter buffers console/network\n // events; they're only flushed to the reporter if the scenario fails below).\n ctx.ui?.resetCapture();\n\n try {\n const execute = async () => {\n for (const block of scenario.steps) {\n const normalized = normalizeBlock(block);\n await this.runBlock(normalized.phase, normalized.steps, ctx);\n }\n };\n\n if (scenarioTimeoutMs !== undefined) {\n await withTimeout(\n execute(),\n scenarioTimeoutMs,\n `Scenario timeout after ${scenarioTimeoutMs}ms: \"${scenario.id}\"`,\n );\n } else {\n await execute();\n }\n } catch (err: any) {\n scenarioError = err;\n } finally {\n // On failure, flush the UI adapter's captured artifacts (console + network) BEFORE\n // onScenarioEnd — the lifecycle reporter snapshots the attached artifacts inside\n // onScenarioEnd. No page (e.g. API scenarios) → nothing captured.\n if (scenarioError && ctx.ui?.page && reporter.attach) {\n try {\n const artifacts = await ctx.ui.collectFailureArtifacts();\n for (const a of artifacts) {\n reporter.attach({\n scenarioId: ctx.scenarioId,\n name: a.name,\n contentType: a.contentType,\n data: a.data,\n });\n }\n } catch {\n // Artifact capture is best-effort; never let it mask the scenario error.\n }\n }\n\n const durationMs = Date.now() - scenarioStart;\n reporter.onScenarioEnd(scenario, {\n ok: !scenarioError,\n error: scenarioError,\n durationMs,\n });\n }\n\n if (!scenarioError) {\n return;\n }\n\n if (attempt >= maxAttempts) {\n throw scenarioError;\n }\n }\n }\n\n // Interpolates the step, except the `with` fields its op takes as written (StepOptions.rawWith).\n private resolveStep(step: OpStep, ctx: TestContext): OpStep {\n const raw = this.registry\n .rawWithFields(step.op)\n .filter((field) => step.with && typeof step.with === \"object\" && field in step.with);\n if (!raw.length) {\n return interpolateDeep(step, ctx);\n }\n const rest = { ...step.with };\n for (const field of raw) delete rest[field];\n const resolved = interpolateDeep({ ...step, with: rest }, ctx);\n const kept = Object.fromEntries(raw.map((field) => [field, step.with![field]]));\n return { ...resolved, with: { ...resolved.with, ...kept } };\n }\n\n private async runBlock(\n phase: StepPhase,\n steps: OpStep[],\n ctx: TestContext,\n ): Promise<void> {\n for (const step of steps) {\n const reporter = ctx.reporter;\n const stepStart = Date.now();\n let stepError: unknown;\n let resolvedStep: OpStep | undefined;\n\n reporter.onStepStart({ scenarioId: ctx.scenarioId, phase, step });\n\n try {\n resolvedStep = this.resolveStep(step, ctx);\n const handler = this.registry.get(resolvedStep.op);\n const run = handler(ctx, resolvedStep);\n const result =\n resolvedStep.timeoutMs !== undefined\n ? await withTimeout(\n run,\n resolvedStep.timeoutMs,\n `Step timeout after ${resolvedStep.timeoutMs}ms: \"${resolvedStep.op}\"`,\n )\n : await run;\n\n if (resolvedStep.saveAs) {\n // console.log(`Step ${resolvedStep.name} attempting to saveAs ${resolvedStep.saveAs}`, JSON.stringify(result));\n ctx.resources.set(resolvedStep.saveAs, result);\n }\n } catch (err: any) {\n stepError = err;\n throw err;\n } finally {\n const durationMs = Date.now() - stepStart;\n reporter.onStepEnd({\n scenarioId: ctx.scenarioId,\n phase,\n step: resolvedStep ?? step,\n ok: !stepError,\n error: stepError,\n durationMs,\n });\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"testing-engine.js","sourceRoot":"","sources":["../../../src/testing/core/testing-engine.ts"],"names":[],"mappings":";;;AAYA,kCASC;AAnBD,mDAAkD;AAClD,uDAAmD;AAEnD,mDAA0D;AAC1D,uCAAwC;AAMxC,SAAgB,WAAW,CAAC,KAAgB,EAAE,UAAkB,EAAE,SAAiB;IACjF,MAAM,IAAI,GAAG,SAAS,UAAU,GAAG,CAAC;IACpC,IAAI,OAAO,IAAI,KAAK;QAAE,OAAO,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C;gBAClE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC5B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAhOD,sCAgOC","sourcesContent":["import type { TestContext, StepPhase } from \"../contracts/runtime-context.types\";\nimport type { OpStep, ScenarioSpec, StepBlock } from \"../contracts/testing-metadata.types\";\nimport { interpolateDeep } from \"./interpolation\";\nimport { normalizeBlock } from \"./normalize-steps\";\nimport { StepRegistry } from \"./step-registry\";\nimport { scenarioNeedsMobile } from \"../runner/lifecycle\";\nimport { withTimeout } from \"./timeout\";\n\n/**\n * Path of a step inside `scenario.steps`, matching the file layout so a consumer can\n * patch the exact step: `steps[2]`, `steps[3].when`, `steps[5].then[1]`.\n */\nexport function stepPathFor(block: StepBlock, blockIndex: number, stepIndex: number): string {\n const base = `steps[${blockIndex}]`;\n if (\"given\" in block) return `${base}.given`;\n if (\"when\" in block) return `${base}.when`;\n if (\"and\" in block) return `${base}.and`;\n if (\"then\" in block) {\n return Array.isArray(block.then) ? `${base}.then[${stepIndex}]` : `${base}.then`;\n }\n return base;\n}\n\n/**\n * Steps that run before a scenario's own, as part of that scenario's report: bringing a phone back to its start screen,\n * or logging in again, so the scenario does not depend on what ran before it. They keep the scenario they come from\n * (`scenario.id`, and `steps[n]` paths inside it), so a heal found in them can be applied to that scenario's file.\n */\nexport interface ScenarioSetup {\n /** What the steps are for, reported with each one: \"reset\", \"login\". */\n kind: string;\n scenario: ScenarioSpec;\n /** Resolved secret values for the steps' `${secret:...}` tokens. */\n secrets?: Record<string, any>;\n /**\n * After the steps have run, look for this element on the device. When it shows within `timeoutMs` the setup is over; when it\n * does not, `orElse` runs in its place. It is how a restore avoids replaying a login the app is still in.\n */\n probe?: { locator: unknown; timeoutMs: number };\n orElse?: ScenarioSetup[];\n}\n\n/** A device lookup slower than this is reported with its step. */\nconst SLOW_CALL_REPORT_MS = 2000;\n\nexport class TestingEngine {\n private readonly registry: StepRegistry;\n private readonly defaults?: { timeoutMs?: number; retries?: number };\n\n constructor(\n registry: StepRegistry,\n defaults?: { timeoutMs?: number; retries?: number },\n ) {\n this.registry = registry;\n this.defaults = defaults;\n }\n\n async runScenario(\n scenario: ScenarioSpec,\n ctxBase: Omit<TestContext, \"scenarioId\" | \"scenarioType\" | \"params\">,\n setup: ScenarioSetup[] = [],\n ): Promise<void> {\n const retries = scenario.retries ?? this.defaults?.retries ?? 0;\n const maxAttempts = Math.max(0, retries) + 1;\n const scenarioTimeoutMs =\n scenario.timeoutMs ?? this.defaults?.timeoutMs;\n\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n const ctx: TestContext = {\n ...ctxBase,\n scenarioId: scenario.id,\n scenarioType: scenario.type,\n params: scenario.params ?? {},\n };\n\n const reporter = ctx.reporter;\n const scenarioStart = Date.now();\n let scenarioError: unknown;\n\n reporter.onScenarioStart(scenario);\n // Start a clean capture window for this scenario (UI adapter buffers console/network\n // events; they're only flushed to the reporter if the scenario fails below).\n ctx.ui?.resetCapture();\n const usesMobile = scenarioNeedsMobile(scenario) && !!ctx.mobile?.isStarted();\n if (usesMobile) await ctx.mobile?.resetCapture();\n\n try {\n const execute = async () => {\n for (const part of setup) {\n await this.runSetup(part, ctx);\n // A probe is a question, not a step: a missing element is an answer, and is not reported as a failure.\n if (part.probe) {\n // Showing is what counts, as for an expectVisible. Any failure to find it, or to get an answer in time, is a \"no\".\n const there = await ctx.mobile?.findDisplayed(part.probe.locator, part.probe.timeoutMs).then(() => true, () => false);\n if (!there) for (const fallback of part.orElse ?? []) await this.runSetup(fallback, ctx);\n }\n }\n for (const [blockIndex, block] of scenario.steps.entries()) {\n const normalized = normalizeBlock(block);\n for (const [stepIndex, step] of normalized.steps.entries()) {\n await this.runStep(normalized.phase, step, ctx, stepPathFor(block, blockIndex, stepIndex));\n }\n }\n };\n\n if (scenarioTimeoutMs !== undefined) {\n await withTimeout(\n execute(),\n scenarioTimeoutMs,\n `Scenario timeout after ${scenarioTimeoutMs}ms: \"${scenario.id}\"`,\n );\n } else {\n await execute();\n }\n } catch (err: any) {\n scenarioError = err;\n } finally {\n // On failure, flush the UI adapter's captured artifacts (console + network) BEFORE\n // onScenarioEnd — the lifecycle reporter snapshots the attached artifacts inside\n // onScenarioEnd. No page (e.g. API scenarios) → nothing captured.\n if (scenarioError && ctx.ui?.page && reporter.attach) {\n try {\n const artifacts = await ctx.ui.collectFailureArtifacts();\n for (const a of artifacts) {\n reporter.attach({\n scenarioId: ctx.scenarioId,\n name: a.name,\n contentType: a.contentType,\n data: a.data,\n });\n }\n } catch {\n // Artifact capture is best-effort; never let it mask the scenario error.\n }\n }\n\n // Same for a mobile scenario: device log and a screenshot of the failing screen.\n if (scenarioError && usesMobile && reporter.attach) {\n try {\n const artifacts = (await ctx.mobile?.collectFailureArtifacts()) ?? [];\n for (const a of artifacts) {\n reporter.attach({\n scenarioId: ctx.scenarioId,\n name: a.name,\n contentType: a.contentType,\n data: a.data,\n });\n }\n } catch {\n // Best-effort, like the UI artifacts above.\n }\n }\n\n const durationMs = Date.now() - scenarioStart;\n const heals = [...(ctx.ui?.getHeals() ?? []), ...(ctx.mobile?.getHeals() ?? [])];\n reporter.onScenarioEnd(scenario, {\n ok: !scenarioError,\n error: scenarioError,\n durationMs,\n ...(heals.length ? { heals } : {}),\n });\n }\n\n if (!scenarioError) {\n return;\n }\n\n if (attempt >= maxAttempts) {\n throw scenarioError;\n }\n }\n }\n\n /** Runs one setup part's steps in the part's own scenario context, and names the part when one of them fails. */\n private async runSetup(part: ScenarioSetup, ctx: TestContext): Promise<void> {\n const partCtx: TestContext = {\n ...ctx,\n scenarioId: part.scenario.id,\n scenarioType: part.scenario.type,\n params: part.scenario.params ?? {},\n secrets: part.secrets,\n };\n for (const [blockIndex, block] of part.scenario.steps.entries()) {\n const normalized = normalizeBlock(block);\n for (const [stepIndex, step] of normalized.steps.entries()) {\n const stepPath = stepPathFor(block, blockIndex, stepIndex);\n try {\n await this.runStep(normalized.phase, step, partCtx, stepPath, part.kind);\n } catch (err: any) {\n const failure = new Error(`Setup \"${part.kind}\" (scenario \"${part.scenario.id}\") failed at ${stepPath}: ${err?.message ?? err}`);\n (failure as Error & { cause?: unknown }).cause = err;\n throw failure;\n }\n }\n }\n }\n\n // Interpolates the step, except the `with` fields its op takes as written (StepOptions.rawWith).\n private resolveStep(step: OpStep, ctx: TestContext): OpStep {\n const raw = this.registry\n .rawWithFields(step.op)\n .filter((field) => step.with && typeof step.with === \"object\" && field in step.with);\n if (!raw.length) {\n return interpolateDeep(step, ctx);\n }\n const rest = { ...step.with };\n for (const field of raw) delete rest[field];\n const resolved = interpolateDeep({ ...step, with: rest }, ctx);\n const kept = Object.fromEntries(raw.map((field) => [field, step.with![field]]));\n return { ...resolved, with: { ...resolved.with, ...kept } };\n }\n\n /**\n * Run one step exactly as a scenario would: interpolate, dispatch, honor `timeoutMs`,\n * store `saveAs`, and report start/end. Throws the step's error.\n */\n async runStep(\n phase: StepPhase,\n step: OpStep,\n ctx: TestContext,\n stepPath?: string,\n setup?: string,\n ): Promise<unknown> {\n const reporter = ctx.reporter;\n const stepStart = Date.now();\n let stepError: unknown;\n let resolvedStep: OpStep | undefined;\n let result: unknown;\n\n ctx.stepPath = stepPath;\n reporter.onStepStart({ scenarioId: ctx.scenarioId, phase, step, stepPath, ...(setup ? { setup } : {}) });\n\n try {\n resolvedStep = this.resolveStep(step, ctx);\n const handler = this.registry.get(resolvedStep.op);\n const run = handler(ctx, resolvedStep);\n result =\n resolvedStep.timeoutMs !== undefined\n ? await withTimeout(\n run,\n resolvedStep.timeoutMs,\n `Step timeout after ${resolvedStep.timeoutMs}ms: \"${resolvedStep.op}\"`,\n )\n : await run;\n\n if (resolvedStep.saveAs) {\n ctx.resources.set(resolvedStep.saveAs, result);\n }\n return result;\n } catch (err: any) {\n stepError = err;\n throw err;\n } finally {\n const durationMs = Date.now() - stepStart;\n // Taken for every mobile step so the figure never carries over; only a slow one is worth reporting.\n const slowestCallMs = ctx.mobile?.takeSlowestCallMs() ?? 0;\n reporter.onStepEnd({\n scenarioId: ctx.scenarioId,\n phase,\n step: resolvedStep ?? step,\n ok: !stepError,\n error: stepError,\n durationMs,\n stepPath,\n ...(slowestCallMs >= SLOW_CALL_REPORT_MS ? { slowestCallMs } : {}),\n ...(setup ? { setup } : {}),\n });\n }\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Reporter } from "./reporter.types";
|
|
1
|
+
import type { Reporter, RunEndArgs, ScenarioResult, ScenarioSkipInfo } from "./reporter.types";
|
|
2
2
|
import type { OpStep } from "../contracts/testing-metadata.types";
|
|
3
3
|
export declare class ConsoleReporter implements Reporter {
|
|
4
4
|
private totalScenarios;
|
|
@@ -14,11 +14,11 @@ export declare class ConsoleReporter implements Reporter {
|
|
|
14
14
|
onScenarioEnd(scenario: {
|
|
15
15
|
id: string;
|
|
16
16
|
name?: string;
|
|
17
|
-
}, result:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}): void;
|
|
17
|
+
}, result: ScenarioResult): void;
|
|
18
|
+
onScenarioSkipped(scenario: {
|
|
19
|
+
id: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
}, info: ScenarioSkipInfo): void;
|
|
22
22
|
onStepStart(args: {
|
|
23
23
|
scenarioId: string;
|
|
24
24
|
phase: string;
|
|
@@ -47,12 +47,6 @@ export declare class ConsoleReporter implements Reporter {
|
|
|
47
47
|
contentType: string;
|
|
48
48
|
data: Buffer | string;
|
|
49
49
|
}): void;
|
|
50
|
-
onRunEnd(args:
|
|
51
|
-
ok: boolean;
|
|
52
|
-
total: number;
|
|
53
|
-
passed: number;
|
|
54
|
-
failed: number;
|
|
55
|
-
durationMs: number;
|
|
56
|
-
}): void;
|
|
50
|
+
onRunEnd(args: RunEndArgs): void;
|
|
57
51
|
}
|
|
58
52
|
//# sourceMappingURL=console-reporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console-reporter.d.ts","sourceRoot":"","sources":["../../../src/testing/reporter/console-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"console-reporter.d.ts","sourceRoot":"","sources":["../../../src/testing/reporter/console-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAgJlE,qBAAa,eAAgB,YAAW,QAAQ;IAC9C,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,eAAe,CAAK;IAE5B,UAAU,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAI1C,eAAe,CAAC,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAK9D,aAAa,CACX,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EACvC,MAAM,EAAE,cAAc,GACrB,IAAI;IAiBP,iBAAiB,CAAC,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAKxF,WAAW,CAAC,IAAI,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,IAAI;IAMR,SAAS,CAAC,IAAI,EAAE;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd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