@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,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const scenario_graph_1 = require("./scenario-graph");
|
|
4
|
+
function scn(id, extra = {}) {
|
|
5
|
+
return { id, type: "ui", steps: [], ...extra };
|
|
6
|
+
}
|
|
7
|
+
describe("scenario dependency graph", () => {
|
|
8
|
+
it("is inactive for files that use none of the new fields", () => {
|
|
9
|
+
expect((0, scenario_graph_1.usesDependencies)([scn("a"), scn("b", { session: "shared" })])).toBe(false);
|
|
10
|
+
expect((0, scenario_graph_1.usesDependencies)([scn("a", { dependsOn: ["b"] }), scn("b")])).toBe(true);
|
|
11
|
+
expect((0, scenario_graph_1.usesDependencies)([scn("a", { saveSession: true })])).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
it("pulls transitive dependencies into a selection, in file order", () => {
|
|
14
|
+
const all = [scn("login", { saveSession: true }), scn("create", { dependsOn: ["login"] }), scn("edit", { dependsOn: ["create"] }), scn("other")];
|
|
15
|
+
const picked = (0, scenario_graph_1.expandWithDependencies)(all, [all[2]]);
|
|
16
|
+
expect(picked.map((s) => s.id)).toEqual(["login", "create", "edit"]);
|
|
17
|
+
});
|
|
18
|
+
it("rejects a dependency that does not exist", () => {
|
|
19
|
+
const all = [scn("a", { dependsOn: ["ghost"] })];
|
|
20
|
+
expect(() => (0, scenario_graph_1.expandWithDependencies)(all, all)).toThrow(/unknown scenario "ghost"/);
|
|
21
|
+
});
|
|
22
|
+
it("orders dependencies first and otherwise keeps file order", () => {
|
|
23
|
+
const ordered = (0, scenario_graph_1.orderByDependencies)([scn("b", { dependsOn: ["a"] }), scn("c"), scn("a")]);
|
|
24
|
+
expect(ordered.map((s) => s.id)).toEqual(["a", "b", "c"]);
|
|
25
|
+
});
|
|
26
|
+
it("names the scenarios in a cycle", () => {
|
|
27
|
+
expect(() => (0, scenario_graph_1.orderByDependencies)([scn("a", { dependsOn: ["b"] }), scn("b", { dependsOn: ["a"] })])).toThrow(/cycle: a → b → a/);
|
|
28
|
+
});
|
|
29
|
+
it("restores from the nearest dependency that saved a session", () => {
|
|
30
|
+
const list = [
|
|
31
|
+
scn("login", { saveSession: true }),
|
|
32
|
+
scn("admin", { dependsOn: ["login"] }),
|
|
33
|
+
scn("report", { dependsOn: ["admin"], session: "restore" }),
|
|
34
|
+
];
|
|
35
|
+
const byId = new Map(list.map((s) => [s.id, s]));
|
|
36
|
+
expect((0, scenario_graph_1.sessionSourceFor)(list[2], byId)).toBe("login");
|
|
37
|
+
expect(() => (0, scenario_graph_1.validateSessions)(list)).not.toThrow();
|
|
38
|
+
});
|
|
39
|
+
it("rejects restore without a saved session and unknown session modes", () => {
|
|
40
|
+
expect(() => (0, scenario_graph_1.validateSessions)([scn("a"), scn("b", { dependsOn: ["a"], session: "restore" })])).toThrow(/none of its dependencies sets saveSession/);
|
|
41
|
+
expect(() => (0, scenario_graph_1.validateSessions)([scn("a", { session: "bogus" })])).toThrow(/invalid session/);
|
|
42
|
+
});
|
|
43
|
+
describe("restoreFrom", () => {
|
|
44
|
+
it("means dependsOn + session restore, and saves the source's session without saveSession", () => {
|
|
45
|
+
const [login, cart] = (0, scenario_graph_1.expandRestoreFrom)([scn("login"), scn("cart", { restoreFrom: "login" })]);
|
|
46
|
+
expect(login.saveSession).toBe(true);
|
|
47
|
+
expect(cart).toMatchObject({ dependsOn: ["login"], session: "restore", restoreFrom: "login" });
|
|
48
|
+
const byId = new Map([login, cart].map((s) => [s.id, s]));
|
|
49
|
+
expect((0, scenario_graph_1.sessionSourceFor)(cart, byId)).toBe("login");
|
|
50
|
+
expect(() => (0, scenario_graph_1.validateSessions)([login, cart])).not.toThrow();
|
|
51
|
+
expect((0, scenario_graph_1.usesDependencies)([login, cart])).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
it("puts the source first in dependsOn, keeps the others, and does not list it twice", () => {
|
|
54
|
+
const list = (0, scenario_graph_1.expandRestoreFrom)([
|
|
55
|
+
scn("login"),
|
|
56
|
+
scn("create"),
|
|
57
|
+
scn("a", { restoreFrom: "login", dependsOn: ["create"] }),
|
|
58
|
+
scn("b", { restoreFrom: "login", dependsOn: ["create", "login"] }),
|
|
59
|
+
]);
|
|
60
|
+
expect(list[2].dependsOn).toEqual(["login", "create"]);
|
|
61
|
+
expect(list[3].dependsOn).toEqual(["create", "login"]);
|
|
62
|
+
});
|
|
63
|
+
it("restores the named session, not the nearest one, when two are reachable", () => {
|
|
64
|
+
const list = (0, scenario_graph_1.expandRestoreFrom)([
|
|
65
|
+
scn("login-admin"),
|
|
66
|
+
scn("login-user"),
|
|
67
|
+
scn("approve", { restoreFrom: "login-admin", dependsOn: ["login-user"] }),
|
|
68
|
+
scn("view", { restoreFrom: "login-user", dependsOn: ["login-admin", "approve"] }),
|
|
69
|
+
]);
|
|
70
|
+
const byId = new Map(list.map((s) => [s.id, s]));
|
|
71
|
+
expect((0, scenario_graph_1.sessionSourceFor)(byId.get("approve"), byId)).toBe("login-admin");
|
|
72
|
+
expect((0, scenario_graph_1.sessionSourceFor)(byId.get("view"), byId)).toBe("login-user");
|
|
73
|
+
});
|
|
74
|
+
it("pulls the source in past a selection that excludes it, and orders it first", () => {
|
|
75
|
+
const all = (0, scenario_graph_1.expandRestoreFrom)([scn("cart", { restoreFrom: "login" }), scn("login")]);
|
|
76
|
+
const selected = (0, scenario_graph_1.expandWithDependencies)(all, [all[0]]);
|
|
77
|
+
expect((0, scenario_graph_1.orderByDependencies)(selected).map((s) => s.id)).toEqual(["login", "cart"]);
|
|
78
|
+
});
|
|
79
|
+
it("leaves a file without it untouched, and does not modify its input", () => {
|
|
80
|
+
const plain = [scn("a"), scn("b", { dependsOn: ["a"] })];
|
|
81
|
+
expect((0, scenario_graph_1.expandRestoreFrom)(plain)).toEqual(plain);
|
|
82
|
+
const input = [scn("login"), scn("cart", { restoreFrom: "login" })];
|
|
83
|
+
(0, scenario_graph_1.expandRestoreFrom)(input);
|
|
84
|
+
expect(input[0].saveSession).toBeUndefined();
|
|
85
|
+
expect(input[1].dependsOn).toBeUndefined();
|
|
86
|
+
});
|
|
87
|
+
it("rejects a missing source, itself, the reset scenario and a different session mode", () => {
|
|
88
|
+
expect(() => (0, scenario_graph_1.expandRestoreFrom)([scn("cart", { restoreFrom: "nope" })])).toThrow(/unknown scenario "nope"/);
|
|
89
|
+
expect(() => (0, scenario_graph_1.expandRestoreFrom)([scn("cart", { restoreFrom: "cart" })])).toThrow(/cannot restoreFrom itself/);
|
|
90
|
+
expect(() => (0, scenario_graph_1.expandRestoreFrom)([scn("cart", { restoreFrom: "reset-app" })], "reset-app")).toThrow(/reset scenario/);
|
|
91
|
+
expect(() => (0, scenario_graph_1.expandRestoreFrom)([scn("login"), scn("cart", { restoreFrom: "login", session: "fresh" })])).toThrow(/means session "restore"/);
|
|
92
|
+
expect(() => (0, scenario_graph_1.expandRestoreFrom)([scn("login"), scn("cart", { restoreFrom: "" })])).toThrow(/invalid restoreFrom/);
|
|
93
|
+
expect(() => (0, scenario_graph_1.expandRestoreFrom)([scn("login"), scn("cart", { restoreFrom: "login", session: "restore" })])).not.toThrow();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=scenario-graph.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-graph.spec.js","sourceRoot":"","sources":["../../../src/testing/runner/scenario-graph.spec.ts"],"names":[],"mappings":";;AACA,qDAO0B;AAE1B,SAAS,GAAG,CAAC,EAAU,EAAE,QAA+B,EAAE;IACxD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,CAAC,IAAA,iCAAgB,EAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClF,MAAM,CAAC,IAAA,iCAAgB,EAAC,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,C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AAC,IAAA,kCAAiB,EAAC,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;YACpH,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,kCAAiB,EAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAC9G,yBAAyB,CAC1B,CAAC;YACF,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,kCAAiB,EAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;YACjH,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,kCAAiB,EAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QAC3H,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import type { ScenarioSpec } from \"../contracts/testing-metadata.types\";\nimport {\n expandRestoreFrom,\n expandWithDependencies,\n orderByDependencies,\n sessionSourceFor,\n usesDependencies,\n validateSessions,\n} from \"./scenario-graph\";\n\nfunction scn(id: string, extra: Partial<ScenarioSpec> = {}): ScenarioSpec {\n return { id, type: \"ui\", steps: [], ...extra };\n}\n\ndescribe(\"scenario dependency graph\", () => {\n it(\"is inactive for files that use none of the new fields\", () => {\n expect(usesDependencies([scn(\"a\"), scn(\"b\", { session: \"shared\" })])).toBe(false);\n expect(usesDependencies([scn(\"a\", { dependsOn: [\"b\"] }), scn(\"b\")])).toBe(true);\n expect(usesDependencies([scn(\"a\", { saveSession: true })])).toBe(true);\n });\n\n it(\"pulls transitive dependencies into a selection, in file order\", () => {\n const all = [scn(\"login\", { saveSession: true }), scn(\"create\", { dependsOn: [\"login\"] }), scn(\"edit\", { dependsOn: [\"create\"] }), scn(\"other\")];\n const picked = expandWithDependencies(all, [all[2]]);\n expect(picked.map((s) => s.id)).toEqual([\"login\", \"create\", \"edit\"]);\n });\n\n it(\"rejects a dependency that does not exist\", () => {\n const all = [scn(\"a\", { dependsOn: [\"ghost\"] })];\n expect(() => expandWithDependencies(all, all)).toThrow(/unknown scenario \"ghost\"/);\n });\n\n it(\"orders dependencies first and otherwise keeps file order\", () => {\n const ordered = orderByDependencies([scn(\"b\", { dependsOn: [\"a\"] }), scn(\"c\"), scn(\"a\")]);\n expect(ordered.map((s) => s.id)).toEqual([\"a\", \"b\", \"c\"]);\n });\n\n it(\"names the scenarios in a cycle\", () => {\n expect(() => orderByDependencies([scn(\"a\", { dependsOn: [\"b\"] }), scn(\"b\", { dependsOn: [\"a\"] })])).toThrow(\n /cycle: a → b → a/,\n );\n });\n\n it(\"restores from the nearest dependency that saved a session\", () => {\n const list = [\n scn(\"login\", { saveSession: true }),\n scn(\"admin\", { dependsOn: [\"login\"] }),\n scn(\"report\", { dependsOn: [\"admin\"], session: \"restore\" }),\n ];\n const byId = new Map(list.map((s) => [s.id, s]));\n expect(sessionSourceFor(list[2], byId)).toBe(\"login\");\n expect(() => validateSessions(list)).not.toThrow();\n });\n\n it(\"rejects restore without a saved session and unknown session modes\", () => {\n expect(() => validateSessions([scn(\"a\"), scn(\"b\", { dependsOn: [\"a\"], session: \"restore\" })])).toThrow(\n /none of its dependencies sets saveSession/,\n );\n expect(() => validateSessions([scn(\"a\", { session: \"bogus\" as any })])).toThrow(/invalid session/);\n });\n\n describe(\"restoreFrom\", () => {\n it(\"means dependsOn + session restore, and saves the source's session without saveSession\", () => {\n const [login, cart] = expandRestoreFrom([scn(\"login\"), scn(\"cart\", { restoreFrom: \"login\" })]);\n expect(login.saveSession).toBe(true);\n expect(cart).toMatchObject({ dependsOn: [\"login\"], session: \"restore\", restoreFrom: \"login\" });\n const byId = new Map([login, cart].map((s) => [s.id, s]));\n expect(sessionSourceFor(cart, byId)).toBe(\"login\");\n expect(() => validateSessions([login, cart])).not.toThrow();\n expect(usesDependencies([login, cart])).toBe(true);\n });\n\n it(\"puts the source first in dependsOn, keeps the others, and does not list it twice\", () => {\n const list = expandRestoreFrom([\n scn(\"login\"),\n scn(\"create\"),\n scn(\"a\", { restoreFrom: \"login\", dependsOn: [\"create\"] }),\n scn(\"b\", { restoreFrom: \"login\", dependsOn: [\"create\", \"login\"] }),\n ]);\n expect(list[2].dependsOn).toEqual([\"login\", \"create\"]);\n expect(list[3].dependsOn).toEqual([\"create\", \"login\"]);\n });\n\n it(\"restores the named session, not the nearest one, when two are reachable\", () => {\n const list = expandRestoreFrom([\n scn(\"login-admin\"),\n scn(\"login-user\"),\n scn(\"approve\", { restoreFrom: \"login-admin\", dependsOn: [\"login-user\"] }),\n scn(\"view\", { restoreFrom: \"login-user\", dependsOn: [\"login-admin\", \"approve\"] }),\n ]);\n const byId = new Map(list.map((s) => [s.id, s]));\n expect(sessionSourceFor(byId.get(\"approve\")!, byId)).toBe(\"login-admin\");\n expect(sessionSourceFor(byId.get(\"view\")!, byId)).toBe(\"login-user\");\n });\n\n it(\"pulls the source in past a selection that excludes it, and orders it first\", () => {\n const all = expandRestoreFrom([scn(\"cart\", { restoreFrom: \"login\" }), scn(\"login\")]);\n const selected = expandWithDependencies(all, [all[0]]);\n expect(orderByDependencies(selected).map((s) => s.id)).toEqual([\"login\", \"cart\"]);\n });\n\n it(\"leaves a file without it untouched, and does not modify its input\", () => {\n const plain = [scn(\"a\"), scn(\"b\", { dependsOn: [\"a\"] })];\n expect(expandRestoreFrom(plain)).toEqual(plain);\n const input = [scn(\"login\"), scn(\"cart\", { restoreFrom: \"login\" })];\n expandRestoreFrom(input);\n expect(input[0].saveSession).toBeUndefined();\n expect(input[1].dependsOn).toBeUndefined();\n });\n\n it(\"rejects a missing source, itself, the reset scenario and a different session mode\", () => {\n expect(() => expandRestoreFrom([scn(\"cart\", { restoreFrom: \"nope\" })])).toThrow(/unknown scenario \"nope\"/);\n expect(() => expandRestoreFrom([scn(\"cart\", { restoreFrom: \"cart\" })])).toThrow(/cannot restoreFrom itself/);\n expect(() => expandRestoreFrom([scn(\"cart\", { restoreFrom: \"reset-app\" })], \"reset-app\")).toThrow(/reset scenario/);\n expect(() => expandRestoreFrom([scn(\"login\"), scn(\"cart\", { restoreFrom: \"login\", session: \"fresh\" })])).toThrow(\n /means session \"restore\"/,\n );\n expect(() => expandRestoreFrom([scn(\"login\"), scn(\"cart\", { restoreFrom: \"\" })])).toThrow(/invalid restoreFrom/);\n expect(() => expandRestoreFrom([scn(\"login\"), scn(\"cart\", { restoreFrom: \"login\", session: \"restore\" })])).not.toThrow();\n });\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-registry.d.ts","sourceRoot":"","sources":["../../../src/testing/runtime/default-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AASrD,wBAAgB,yBAAyB,IAAI,YAAY,CASxD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDefaultStepRegistry = createDefaultStepRegistry;
|
|
4
|
+
const step_registry_1 = require("../core/step-registry");
|
|
5
|
+
const api_1 = require("../steps/api");
|
|
6
|
+
const assert_1 = require("../steps/assert");
|
|
7
|
+
const mobile_1 = require("../steps/mobile");
|
|
8
|
+
const test_1 = require("../steps/test");
|
|
9
|
+
const ui_1 = require("../steps/ui");
|
|
10
|
+
const util_1 = require("../steps/util");
|
|
11
|
+
function createDefaultStepRegistry() {
|
|
12
|
+
const registry = new step_registry_1.StepRegistry();
|
|
13
|
+
(0, api_1.registerApiSteps)(registry);
|
|
14
|
+
(0, ui_1.registerUiSteps)(registry);
|
|
15
|
+
(0, mobile_1.registerMobileSteps)(registry);
|
|
16
|
+
(0, assert_1.registerAssertSteps)(registry);
|
|
17
|
+
(0, util_1.registerUtilSteps)(registry);
|
|
18
|
+
(0, test_1.registerTestSteps)(registry);
|
|
19
|
+
return registry;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=default-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-registry.js","sourceRoot":"","sources":["../../../src/testing/runtime/default-registry.ts"],"names":[],"mappings":";;AASA,8DASC;AAlBD,yDAAqD;AACrD,sCAAgD;AAChD,4CAAsD;AACtD,4CAAsD;AACtD,wCAAkD;AAClD,oCAA8C;AAC9C,wCAAkD;AAGlD,SAAgB,yBAAyB;IACvC,MAAM,QAAQ,GAAG,IAAI,4BAAY,EAAE,CAAC;IACpC,IAAA,sBAAgB,EAAC,QAAQ,CAAC,CAAC;IAC3B,IAAA,oBAAe,EAAC,QAAQ,CAAC,CAAC;IAC1B,IAAA,4BAAmB,EAAC,QAAQ,CAAC,CAAC;IAC9B,IAAA,4BAAmB,EAAC,QAAQ,CAAC,CAAC;IAC9B,IAAA,wBAAiB,EAAC,QAAQ,CAAC,CAAC;IAC5B,IAAA,wBAAiB,EAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { StepRegistry } from \"../core/step-registry\";\nimport { registerApiSteps } from \"../steps/api\";\nimport { registerAssertSteps } from \"../steps/assert\";\nimport { registerMobileSteps } from \"../steps/mobile\";\nimport { registerTestSteps } from \"../steps/test\";\nimport { registerUiSteps } from \"../steps/ui\";\nimport { registerUtilSteps } from \"../steps/util\";\n\n/** Registry with every built-in op, shared by the runner and the step executor. */\nexport function createDefaultStepRegistry(): StepRegistry {\n const registry = new StepRegistry();\n registerApiSteps(registry);\n registerUiSteps(registry);\n registerMobileSteps(registry);\n registerAssertSteps(registry);\n registerUtilSteps(registry);\n registerTestSteps(registry);\n return registry;\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const RUNTIME_VERSION = "1.5.0";
|
|
2
|
+
export declare const CAPABILITIES: readonly ["selfHealing", "mobileSelfHealing", "mobileRuntime", "mobileSessionModes", "mobileReset", "expectAriaSnapshot", "dependsOn", "saveSession", "restoreFrom", "sessionModes", "heals", "skippedStatus", "stepPath"];
|
|
3
|
+
export type RuntimeCapability = (typeof CAPABILITIES)[number];
|
|
4
|
+
export declare function listOps(): string[];
|
|
5
|
+
export { createDefaultStepRegistry } from "./default-registry";
|
|
6
|
+
export { createMobileStepExecutor, createStepExecutor, errorMessage } from "./step-executor";
|
|
7
|
+
export type { MobileStepExecutor, MobileStepExecutorOptions, ScenarioRunResult, StepExecutor, StepExecutorOptions, StepRecord, StepRunResult, } from "./step-executor";
|
|
8
|
+
export { MobileAdapter } from "../adapters/mobile/mobile-adapter";
|
|
9
|
+
export { resolveLocator } from "../adapters/mobile/locator";
|
|
10
|
+
export { fingerprintLocators, resolveMobileTarget } from "../adapters/mobile/resolve-mobile-target";
|
|
11
|
+
export { PlaywrightAdapter } from "../adapters/ui/playwright-adapter";
|
|
12
|
+
export type { StorageState } from "../adapters/ui/playwright-adapter";
|
|
13
|
+
export { fingerprintSelectors, resolveTarget, PRIMARY_GRACE_MS } from "../adapters/ui/resolve-target";
|
|
14
|
+
export { StepRegistry } from "../core/step-registry";
|
|
15
|
+
export { TestingEngine, stepPathFor } from "../core/testing-engine";
|
|
16
|
+
export { interpolateDeep, collectSecretKeys } from "../core/interpolation";
|
|
17
|
+
export { normalizeBlock } from "../core/normalize-steps";
|
|
18
|
+
export { buildTestDataIndex } from "../runner/run-from-metadata";
|
|
19
|
+
export { expandWithDependencies, orderByDependencies, expandRestoreFrom, sessionSourceFor, usesDependencies, validateSessions, } from "../runner/scenario-graph";
|
|
20
|
+
export type { HealEvent, StepPhase, TestContext } from "../contracts/runtime-context.types";
|
|
21
|
+
export type { HealingPolicy, OpStep, ScenarioSessionMode, ScenarioSpec, StepBlock, TargetFingerprint, } from "../contracts/testing-metadata.types";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/runtime/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe,UAAU,CAAC;AAMvC,eAAO,MAAM,YAAY,4NAcf,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAG9D,wBAAgB,OAAO,IAAI,MAAM,EAAE,CAElC;AAED,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7F,YAAY,EACV,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5F,YAAY,EACV,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,iBAAiB,GAClB,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSessions = exports.usesDependencies = exports.sessionSourceFor = exports.expandRestoreFrom = exports.orderByDependencies = exports.expandWithDependencies = exports.buildTestDataIndex = exports.normalizeBlock = exports.collectSecretKeys = exports.interpolateDeep = exports.stepPathFor = exports.TestingEngine = exports.StepRegistry = exports.PRIMARY_GRACE_MS = exports.resolveTarget = exports.fingerprintSelectors = exports.PlaywrightAdapter = exports.resolveMobileTarget = exports.fingerprintLocators = exports.resolveLocator = exports.MobileAdapter = exports.errorMessage = exports.createStepExecutor = exports.createMobileStepExecutor = exports.createDefaultStepRegistry = exports.CAPABILITIES = exports.RUNTIME_VERSION = void 0;
|
|
4
|
+
exports.listOps = listOps;
|
|
5
|
+
const default_registry_1 = require("./default-registry");
|
|
6
|
+
exports.RUNTIME_VERSION = "1.5.0";
|
|
7
|
+
exports.CAPABILITIES = [
|
|
8
|
+
"selfHealing",
|
|
9
|
+
"mobileSelfHealing",
|
|
10
|
+
"mobileRuntime",
|
|
11
|
+
"mobileSessionModes",
|
|
12
|
+
"mobileReset",
|
|
13
|
+
"expectAriaSnapshot",
|
|
14
|
+
"dependsOn",
|
|
15
|
+
"saveSession",
|
|
16
|
+
"restoreFrom",
|
|
17
|
+
"sessionModes",
|
|
18
|
+
"heals",
|
|
19
|
+
"skippedStatus",
|
|
20
|
+
"stepPath",
|
|
21
|
+
];
|
|
22
|
+
function listOps() {
|
|
23
|
+
return (0, default_registry_1.createDefaultStepRegistry)().ops();
|
|
24
|
+
}
|
|
25
|
+
var default_registry_2 = require("./default-registry");
|
|
26
|
+
Object.defineProperty(exports, "createDefaultStepRegistry", { enumerable: true, get: function () { return default_registry_2.createDefaultStepRegistry; } });
|
|
27
|
+
var step_executor_1 = require("./step-executor");
|
|
28
|
+
Object.defineProperty(exports, "createMobileStepExecutor", { enumerable: true, get: function () { return step_executor_1.createMobileStepExecutor; } });
|
|
29
|
+
Object.defineProperty(exports, "createStepExecutor", { enumerable: true, get: function () { return step_executor_1.createStepExecutor; } });
|
|
30
|
+
Object.defineProperty(exports, "errorMessage", { enumerable: true, get: function () { return step_executor_1.errorMessage; } });
|
|
31
|
+
var mobile_adapter_1 = require("../adapters/mobile/mobile-adapter");
|
|
32
|
+
Object.defineProperty(exports, "MobileAdapter", { enumerable: true, get: function () { return mobile_adapter_1.MobileAdapter; } });
|
|
33
|
+
var locator_1 = require("../adapters/mobile/locator");
|
|
34
|
+
Object.defineProperty(exports, "resolveLocator", { enumerable: true, get: function () { return locator_1.resolveLocator; } });
|
|
35
|
+
var resolve_mobile_target_1 = require("../adapters/mobile/resolve-mobile-target");
|
|
36
|
+
Object.defineProperty(exports, "fingerprintLocators", { enumerable: true, get: function () { return resolve_mobile_target_1.fingerprintLocators; } });
|
|
37
|
+
Object.defineProperty(exports, "resolveMobileTarget", { enumerable: true, get: function () { return resolve_mobile_target_1.resolveMobileTarget; } });
|
|
38
|
+
var playwright_adapter_1 = require("../adapters/ui/playwright-adapter");
|
|
39
|
+
Object.defineProperty(exports, "PlaywrightAdapter", { enumerable: true, get: function () { return playwright_adapter_1.PlaywrightAdapter; } });
|
|
40
|
+
var resolve_target_1 = require("../adapters/ui/resolve-target");
|
|
41
|
+
Object.defineProperty(exports, "fingerprintSelectors", { enumerable: true, get: function () { return resolve_target_1.fingerprintSelectors; } });
|
|
42
|
+
Object.defineProperty(exports, "resolveTarget", { enumerable: true, get: function () { return resolve_target_1.resolveTarget; } });
|
|
43
|
+
Object.defineProperty(exports, "PRIMARY_GRACE_MS", { enumerable: true, get: function () { return resolve_target_1.PRIMARY_GRACE_MS; } });
|
|
44
|
+
var step_registry_1 = require("../core/step-registry");
|
|
45
|
+
Object.defineProperty(exports, "StepRegistry", { enumerable: true, get: function () { return step_registry_1.StepRegistry; } });
|
|
46
|
+
var testing_engine_1 = require("../core/testing-engine");
|
|
47
|
+
Object.defineProperty(exports, "TestingEngine", { enumerable: true, get: function () { return testing_engine_1.TestingEngine; } });
|
|
48
|
+
Object.defineProperty(exports, "stepPathFor", { enumerable: true, get: function () { return testing_engine_1.stepPathFor; } });
|
|
49
|
+
var interpolation_1 = require("../core/interpolation");
|
|
50
|
+
Object.defineProperty(exports, "interpolateDeep", { enumerable: true, get: function () { return interpolation_1.interpolateDeep; } });
|
|
51
|
+
Object.defineProperty(exports, "collectSecretKeys", { enumerable: true, get: function () { return interpolation_1.collectSecretKeys; } });
|
|
52
|
+
var normalize_steps_1 = require("../core/normalize-steps");
|
|
53
|
+
Object.defineProperty(exports, "normalizeBlock", { enumerable: true, get: function () { return normalize_steps_1.normalizeBlock; } });
|
|
54
|
+
var run_from_metadata_1 = require("../runner/run-from-metadata");
|
|
55
|
+
Object.defineProperty(exports, "buildTestDataIndex", { enumerable: true, get: function () { return run_from_metadata_1.buildTestDataIndex; } });
|
|
56
|
+
var scenario_graph_1 = require("../runner/scenario-graph");
|
|
57
|
+
Object.defineProperty(exports, "expandWithDependencies", { enumerable: true, get: function () { return scenario_graph_1.expandWithDependencies; } });
|
|
58
|
+
Object.defineProperty(exports, "orderByDependencies", { enumerable: true, get: function () { return scenario_graph_1.orderByDependencies; } });
|
|
59
|
+
Object.defineProperty(exports, "expandRestoreFrom", { enumerable: true, get: function () { return scenario_graph_1.expandRestoreFrom; } });
|
|
60
|
+
Object.defineProperty(exports, "sessionSourceFor", { enumerable: true, get: function () { return scenario_graph_1.sessionSourceFor; } });
|
|
61
|
+
Object.defineProperty(exports, "usesDependencies", { enumerable: true, get: function () { return scenario_graph_1.usesDependencies; } });
|
|
62
|
+
Object.defineProperty(exports, "validateSessions", { enumerable: true, get: function () { return scenario_graph_1.validateSessions; } });
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/runtime/index.ts"],"names":[],"mappings":";;;AAoCA,0BAEC;AAjCD,yDAA+D;AAMlD,QAAA,eAAe,GAAG,OAAO,CAAC;AAM1B,QAAA,YAAY,GAAG;IAC1B,aAAa;IACb,mBAAmB;IACnB,eAAe;IACf,oBAAoB;IACpB,aAAa;IACb,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,aAAa;IACb,cAAc;IACd,OAAO;IACP,eAAe;IACf,UAAU;CACF,CAAC;AAKX,SAAgB,OAAO;IACrB,OAAO,IAAA,4CAAyB,GAAE,CAAC,GAAG,EAAE,CAAC;AAC3C,CAAC;AAED,uDAA+D;AAAtD,6HAAA,yBAAyB,OAAA;AAClC,iDAA6F;AAApF,yHAAA,wBAAwB,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AAAE,6GAAA,YAAY,OAAA;AAUnE,oEAAkE;AAAzD,+GAAA,aAAa,OAAA;AACtB,sDAA4D;AAAnD,yGAAA,cAAc,OAAA;AACvB,kFAAoG;AAA3F,4HAAA,mBAAmB,OAAA;AAAE,4HAAA,mBAAmB,OAAA;AACjD,wEAAsE;AAA7D,uHAAA,iBAAiB,OAAA;AAE1B,gEAAsG;AAA7F,sHAAA,oBAAoB,OAAA;AAAE,+GAAA,aAAa,OAAA;AAAE,kHAAA,gBAAgB,OAAA;AAC9D,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AACrB,yDAAoE;AAA3D,+GAAA,aAAa,OAAA;AAAE,6GAAA,WAAW,OAAA;AACnC,uDAA2E;AAAlE,gHAAA,eAAe,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAC3C,2DAAyD;AAAhD,iHAAA,cAAc,OAAA;AACvB,iEAAiE;AAAxD,uHAAA,kBAAkB,OAAA;AAC3B,2DAOkC;AANhC,wHAAA,sBAAsB,OAAA;AACtB,qHAAA,mBAAmB,OAAA;AACnB,mHAAA,iBAAiB,OAAA;AACjB,kHAAA,gBAAgB,OAAA;AAChB,kHAAA,gBAAgB,OAAA;AAChB,kHAAA,gBAAgB,OAAA","sourcesContent":["/**\n * Entry point of the standalone testing runtime bundle (`npm run build:testing-runtime`).\n * The bundle is vendored by tools that must execute steps exactly as the runner does\n * (e.g. the AI agent's authoring session), so everything they rely on is exported here.\n */\nimport { createDefaultStepRegistry } from \"./default-registry\";\n\n/**\n * Bumped when the step contract changes in a way vendored copies must notice. Consumers\n * compare it with the version they were written against.\n */\nexport const RUNTIME_VERSION = \"1.5.0\";\n\n/**\n * Scenario features this runner understands. Authoring tools only emit a feature the\n * target runner lists, so files stay runnable on older runners.\n */\nexport const CAPABILITIES = [\n \"selfHealing\",\n \"mobileSelfHealing\",\n \"mobileRuntime\",\n \"mobileSessionModes\",\n \"mobileReset\",\n \"expectAriaSnapshot\",\n \"dependsOn\",\n \"saveSession\",\n \"restoreFrom\",\n \"sessionModes\",\n \"heals\",\n \"skippedStatus\",\n \"stepPath\",\n] as const;\n\nexport type RuntimeCapability = (typeof CAPABILITIES)[number];\n\n/** Every op the built-in registry handles, sorted. */\nexport function listOps(): string[] {\n return createDefaultStepRegistry().ops();\n}\n\nexport { createDefaultStepRegistry } from \"./default-registry\";\nexport { createMobileStepExecutor, createStepExecutor, errorMessage } from \"./step-executor\";\nexport type {\n MobileStepExecutor,\n MobileStepExecutorOptions,\n ScenarioRunResult,\n StepExecutor,\n StepExecutorOptions,\n StepRecord,\n StepRunResult,\n} from \"./step-executor\";\nexport { MobileAdapter } from \"../adapters/mobile/mobile-adapter\";\nexport { resolveLocator } from \"../adapters/mobile/locator\";\nexport { fingerprintLocators, resolveMobileTarget } from \"../adapters/mobile/resolve-mobile-target\";\nexport { PlaywrightAdapter } from \"../adapters/ui/playwright-adapter\";\nexport type { StorageState } from \"../adapters/ui/playwright-adapter\";\nexport { fingerprintSelectors, resolveTarget, PRIMARY_GRACE_MS } from \"../adapters/ui/resolve-target\";\nexport { StepRegistry } from \"../core/step-registry\";\nexport { TestingEngine, stepPathFor } from \"../core/testing-engine\";\nexport { interpolateDeep, collectSecretKeys } from \"../core/interpolation\";\nexport { normalizeBlock } from \"../core/normalize-steps\";\nexport { buildTestDataIndex } from \"../runner/run-from-metadata\";\nexport {\n expandWithDependencies,\n orderByDependencies,\n expandRestoreFrom,\n sessionSourceFor,\n usesDependencies,\n validateSessions,\n} from \"../runner/scenario-graph\";\nexport type { HealEvent, StepPhase, TestContext } from \"../contracts/runtime-context.types\";\nexport type {\n HealingPolicy,\n OpStep,\n ScenarioSessionMode,\n ScenarioSpec,\n StepBlock,\n TargetFingerprint,\n} from \"../contracts/testing-metadata.types\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile-step-executor.spec.d.ts","sourceRoot":"","sources":["../../../src/testing/runtime/mobile-step-executor.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fake_driver_1 = require("../adapters/mobile/fake-driver");
|
|
4
|
+
const index_1 = require("./index");
|
|
5
|
+
const step_executor_1 = require("./step-executor");
|
|
6
|
+
const save = { by: "accessibilityId", value: "Save" };
|
|
7
|
+
function setup(overrides = {}) {
|
|
8
|
+
const driver = new fake_driver_1.FakeDriver();
|
|
9
|
+
const executor = (0, step_executor_1.createMobileStepExecutor)({ driver, appPackage: "com.acme.app", appActivity: ".Main", defaultTimeoutMs: 2_000, clock: new fake_driver_1.FakeClock(), ...overrides });
|
|
10
|
+
return { driver, executor };
|
|
11
|
+
}
|
|
12
|
+
describe("mobile step executor", () => {
|
|
13
|
+
it("runs a step with the runner's handler and reports it", async () => {
|
|
14
|
+
const { driver, executor } = setup();
|
|
15
|
+
const [button] = driver.add("~Save", new fake_driver_1.FakeElement());
|
|
16
|
+
const result = await executor.runStep({ op: "mobile.tap", with: { locator: save } }, { phase: "when", stepPath: "steps[1].when" });
|
|
17
|
+
expect(result).toMatchObject({ ok: true, op: "mobile.tap", phase: "when", stepPath: "steps[1].when", heals: [] });
|
|
18
|
+
expect(button.calls).toContain("click");
|
|
19
|
+
});
|
|
20
|
+
it("reports a failing step instead of throwing, with the runner's message", async () => {
|
|
21
|
+
const { executor } = setup();
|
|
22
|
+
const result = await executor.runStep({ op: "mobile.tap", with: { locator: save, timeoutMs: 1_000 } });
|
|
23
|
+
expect(result.ok).toBe(false);
|
|
24
|
+
expect(result.error).toContain('No element matches { by: "accessibilityId", value: "Save" } after 1000 ms');
|
|
25
|
+
});
|
|
26
|
+
it("interpolates secrets and shared resources the way the runner does", async () => {
|
|
27
|
+
const { driver, executor } = setup({ secrets: { "demo-password": "s3cret" } });
|
|
28
|
+
const [field] = driver.add("~Password input field", new fake_driver_1.FakeElement());
|
|
29
|
+
const result = await executor.runStep({
|
|
30
|
+
op: "mobile.type",
|
|
31
|
+
with: { locator: { by: "accessibilityId", value: "Password input field" }, text: "${secret:demo-password}" },
|
|
32
|
+
});
|
|
33
|
+
expect(result.ok).toBe(true);
|
|
34
|
+
expect(field.calls).toContain("setValue:s3cret");
|
|
35
|
+
});
|
|
36
|
+
it("heals only when asked to: an authoring session turns it off", async () => {
|
|
37
|
+
const withFallback = { op: "mobile.tap", with: { locator: save, timeoutMs: 1_000, fallbacks: [{ by: "accessibilityId", value: "Save order" }] } };
|
|
38
|
+
const reporting = setup({ healing: "report" });
|
|
39
|
+
reporting.driver.add("~Save order", new fake_driver_1.FakeElement());
|
|
40
|
+
const healed = await reporting.executor.runStep(withFallback);
|
|
41
|
+
expect(healed.ok).toBe(true);
|
|
42
|
+
expect(healed.heals).toMatchObject([{ field: "locator", from: save, to: { by: "accessibilityId", value: "Save order" } }]);
|
|
43
|
+
const authoring = setup({ healing: "off" });
|
|
44
|
+
authoring.driver.add("~Save order", new fake_driver_1.FakeElement());
|
|
45
|
+
const strict = await authoring.executor.runStep(withFallback);
|
|
46
|
+
expect(strict.ok).toBe(false);
|
|
47
|
+
expect(strict.heals).toEqual([]);
|
|
48
|
+
});
|
|
49
|
+
it("runs a whole scenario through the engine, with a record of each step", async () => {
|
|
50
|
+
const { driver, executor } = setup();
|
|
51
|
+
driver.add("~Save", new fake_driver_1.FakeElement());
|
|
52
|
+
driver.add("~Done", new fake_driver_1.FakeElement());
|
|
53
|
+
const scenario = {
|
|
54
|
+
id: "demo",
|
|
55
|
+
type: "mobile",
|
|
56
|
+
steps: [
|
|
57
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
58
|
+
{ when: { op: "mobile.tap", with: { locator: save } } },
|
|
59
|
+
{ then: { op: "mobile.expectVisible", with: { locator: { by: "accessibilityId", value: "Done" } } } },
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
const result = await executor.runScenario(scenario);
|
|
63
|
+
expect(result.ok).toBe(true);
|
|
64
|
+
expect(result.steps.map((s) => [s.op, s.ok, s.stepPath])).toEqual([
|
|
65
|
+
["mobile.launch", true, "steps[0].given"],
|
|
66
|
+
["mobile.tap", true, "steps[1].when"],
|
|
67
|
+
["mobile.expectVisible", true, "steps[2].then"],
|
|
68
|
+
]);
|
|
69
|
+
});
|
|
70
|
+
it("reports the failing step of a scenario, and heals it made along the way", async () => {
|
|
71
|
+
const { driver, executor } = setup();
|
|
72
|
+
driver.add("~Save order", new fake_driver_1.FakeElement());
|
|
73
|
+
const scenario = {
|
|
74
|
+
id: "demo",
|
|
75
|
+
type: "mobile",
|
|
76
|
+
steps: [
|
|
77
|
+
{ when: { op: "mobile.tap", with: { locator: save, fallbacks: [{ by: "accessibilityId", value: "Save order" }] } } },
|
|
78
|
+
{ then: { op: "mobile.expectVisible", with: { locator: { by: "accessibilityId", value: "Nope" }, timeoutMs: 1_000 } } },
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
const result = await executor.runScenario(scenario);
|
|
82
|
+
expect(result.ok).toBe(false);
|
|
83
|
+
expect(result.error).toContain("No element matches");
|
|
84
|
+
expect(result.steps.map((s) => s.ok)).toEqual([true, false]);
|
|
85
|
+
expect(result.heals).toHaveLength(1);
|
|
86
|
+
});
|
|
87
|
+
it("never ends the caller's session", async () => {
|
|
88
|
+
const { driver, executor } = setup();
|
|
89
|
+
driver.add("~Save", new fake_driver_1.FakeElement());
|
|
90
|
+
await executor.runStep({ op: "mobile.tap", with: { locator: save } });
|
|
91
|
+
await executor.mobile.stop();
|
|
92
|
+
expect(driver.callsTo("deleteSession")).toHaveLength(0);
|
|
93
|
+
});
|
|
94
|
+
it("is a mobile context: no browser, no api adapter needed by mobile steps", async () => {
|
|
95
|
+
const { executor } = setup();
|
|
96
|
+
expect(executor.context.scenarioType).toBe("mobile");
|
|
97
|
+
expect(executor.context.ui).toBeUndefined();
|
|
98
|
+
expect(executor.context.mobile).toBe(executor.mobile);
|
|
99
|
+
});
|
|
100
|
+
it("forgets saved values when asked", async () => {
|
|
101
|
+
const { driver, executor } = setup();
|
|
102
|
+
driver.add("~Save", new fake_driver_1.FakeElement({ text: "hello" }));
|
|
103
|
+
await executor.runStep({ op: "mobile.getText", saveAs: "label", with: { locator: save } });
|
|
104
|
+
expect(executor.context.resources.has("label")).toBe(true);
|
|
105
|
+
executor.resetResources();
|
|
106
|
+
expect(executor.context.resources.has("label")).toBe(false);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe("clearing an iOS app's data", () => {
|
|
110
|
+
const launch = { op: "mobile.launch", with: { clearData: true, grantPermissions: false } };
|
|
111
|
+
const scripts = (driver) => driver.callsTo("execute").map((call) => [call.args[0], call.args[1]]);
|
|
112
|
+
it("reinstalls the build it was given", async () => {
|
|
113
|
+
const { driver, executor } = setup({ platformName: "iOS", simulator: true, appPath: "/builds/My Demo App.app" });
|
|
114
|
+
const result = await executor.runStep(launch);
|
|
115
|
+
expect(result.ok).toBe(true);
|
|
116
|
+
expect(scripts(driver)).toEqual(expect.arrayContaining([
|
|
117
|
+
["mobile: removeApp", { bundleId: "com.acme.app" }],
|
|
118
|
+
["mobile: installApp", { app: "/builds/My Demo App.app" }],
|
|
119
|
+
]));
|
|
120
|
+
});
|
|
121
|
+
it("says what is missing when it was given no build", async () => {
|
|
122
|
+
const { driver, executor } = setup({ platformName: "iOS", simulator: true });
|
|
123
|
+
const result = await executor.runStep(launch);
|
|
124
|
+
expect(result.ok).toBe(false);
|
|
125
|
+
expect(result.error).toContain("Clearing data on iOS needs a build to reinstall");
|
|
126
|
+
expect(scripts(driver).map(([script]) => script)).not.toContain("mobile: removeApp");
|
|
127
|
+
});
|
|
128
|
+
it("does not need a build on Android, which clears the data in place", async () => {
|
|
129
|
+
const { driver, executor } = setup();
|
|
130
|
+
expect((await executor.runStep({ op: "mobile.launch", with: { clearData: true } })).ok).toBe(true);
|
|
131
|
+
expect(scripts(driver).map(([script]) => script)).toContain("mobile: clearApp");
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
describe("runtime manifest", () => {
|
|
135
|
+
it("lists every mobile op and the mobile capabilities", () => {
|
|
136
|
+
expect((0, index_1.listOps)().filter((op) => op.startsWith("mobile."))).toEqual([
|
|
137
|
+
"mobile.back",
|
|
138
|
+
"mobile.clear",
|
|
139
|
+
"mobile.expectHidden",
|
|
140
|
+
"mobile.expectText",
|
|
141
|
+
"mobile.expectVisible",
|
|
142
|
+
"mobile.getText",
|
|
143
|
+
"mobile.hideKeyboard",
|
|
144
|
+
"mobile.launch",
|
|
145
|
+
"mobile.reset",
|
|
146
|
+
"mobile.scrollTo",
|
|
147
|
+
"mobile.submit",
|
|
148
|
+
"mobile.swipe",
|
|
149
|
+
"mobile.tap",
|
|
150
|
+
"mobile.terminate",
|
|
151
|
+
"mobile.type",
|
|
152
|
+
]);
|
|
153
|
+
expect(index_1.CAPABILITIES).toEqual(expect.arrayContaining(["mobileRuntime", "mobileSelfHealing", "mobileSessionModes", "mobileReset", "restoreFrom"]));
|
|
154
|
+
expect(index_1.RUNTIME_VERSION).toBe("1.5.0");
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=mobile-step-executor.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile-step-executor.spec.js","sourceRoot":"","sources":["../../../src/testing/runtime/mobile-step-executor.spec.ts"],"names":[],"mappings":";;AAAA,gEAAoF;AAEpF,mCAAiE;AACjE,mDAA2D;AAG3D,MAAM,IAAI,GAAG,EAAE,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAEtD,SAAS,KAAK,CAAC,YAAgD,EAAE;IAC/D,MAAM,MAAM,GAAG,IAAI,wBAAU,EAAE,CAAC;IAEhC,MAAM,QAAQ,GAAG,IAAA,wCAAwB,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,uBAAS,EAAE,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACvK,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC;AAED,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,sDAAsD,EAAE,KAAK,IAAI,EAAE;QACpE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,CAAC;QACrC,MAAM,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AAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACjJ,MAAM,CAAC,uBAAe,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { FakeClock, FakeDriver, FakeElement } from \"../adapters/mobile/fake-driver\";\nimport type { ScenarioSpec } from \"../contracts/testing-metadata.types\";\nimport { CAPABILITIES, RUNTIME_VERSION, listOps } from \"./index\";\nimport { createMobileStepExecutor } from \"./step-executor\";\nimport type { MobileStepExecutorOptions } from \"./step-executor\";\n\nconst save = { by: \"accessibilityId\", value: \"Save\" };\n\nfunction setup(overrides: Partial<MobileStepExecutorOptions> = {}) {\n const driver = new FakeDriver();\n // A clock that only moves when the adapter sleeps, so a missing element does not make a spec wait.\n const executor = createMobileStepExecutor({ driver, appPackage: \"com.acme.app\", appActivity: \".Main\", defaultTimeoutMs: 2_000, clock: new FakeClock(), ...overrides });\n return { driver, executor };\n}\n\ndescribe(\"mobile step executor\", () => {\n it(\"runs a step with the runner's handler and reports it\", async () => {\n const { driver, executor } = setup();\n const [button] = driver.add(\"~Save\", new FakeElement());\n const result = await executor.runStep({ op: \"mobile.tap\", with: { locator: save } }, { phase: \"when\", stepPath: \"steps[1].when\" });\n expect(result).toMatchObject({ ok: true, op: \"mobile.tap\", phase: \"when\", stepPath: \"steps[1].when\", heals: [] });\n expect(button.calls).toContain(\"click\");\n });\n\n it(\"reports a failing step instead of throwing, with the runner's message\", async () => {\n const { executor } = setup();\n const result = await executor.runStep({ op: \"mobile.tap\", with: { locator: save, timeoutMs: 1_000 } });\n expect(result.ok).toBe(false);\n expect(result.error).toContain('No element matches { by: \"accessibilityId\", value: \"Save\" } after 1000 ms');\n });\n\n it(\"interpolates secrets and shared resources the way the runner does\", async () => {\n const { driver, executor } = setup({ secrets: { \"demo-password\": \"s3cret\" } });\n const [field] = driver.add(\"~Password input field\", new FakeElement());\n const result = await executor.runStep({\n op: \"mobile.type\",\n with: { locator: { by: \"accessibilityId\", value: \"Password input field\" }, text: \"${secret:demo-password}\" },\n });\n expect(result.ok).toBe(true);\n expect(field.calls).toContain(\"setValue:s3cret\");\n });\n\n it(\"heals only when asked to: an authoring session turns it off\", async () => {\n const withFallback = { op: \"mobile.tap\", with: { locator: save, timeoutMs: 1_000, fallbacks: [{ by: \"accessibilityId\", value: \"Save order\" }] } };\n\n const reporting = setup({ healing: \"report\" });\n reporting.driver.add(\"~Save order\", new FakeElement());\n const healed = await reporting.executor.runStep(withFallback);\n expect(healed.ok).toBe(true);\n expect(healed.heals).toMatchObject([{ field: \"locator\", from: save, to: { by: \"accessibilityId\", value: \"Save order\" } }]);\n\n const authoring = setup({ healing: \"off\" });\n authoring.driver.add(\"~Save order\", new FakeElement());\n const strict = await authoring.executor.runStep(withFallback);\n expect(strict.ok).toBe(false);\n expect(strict.heals).toEqual([]);\n });\n\n it(\"runs a whole scenario through the engine, with a record of each step\", async () => {\n const { driver, executor } = setup();\n driver.add(\"~Save\", new FakeElement());\n driver.add(\"~Done\", new FakeElement());\n const scenario: ScenarioSpec = {\n id: \"demo\",\n type: \"mobile\",\n steps: [\n { given: { op: \"mobile.launch\", with: { clearData: true } } },\n { when: { op: \"mobile.tap\", with: { locator: save } } },\n { then: { op: \"mobile.expectVisible\", with: { locator: { by: \"accessibilityId\", value: \"Done\" } } } },\n ],\n };\n const result = await executor.runScenario(scenario);\n expect(result.ok).toBe(true);\n expect(result.steps.map((s) => [s.op, s.ok, s.stepPath])).toEqual([\n [\"mobile.launch\", true, \"steps[0].given\"],\n [\"mobile.tap\", true, \"steps[1].when\"],\n [\"mobile.expectVisible\", true, \"steps[2].then\"],\n ]);\n });\n\n it(\"reports the failing step of a scenario, and heals it made along the way\", async () => {\n const { driver, executor } = setup();\n driver.add(\"~Save order\", new FakeElement());\n const scenario: ScenarioSpec = {\n id: \"demo\",\n type: \"mobile\",\n steps: [\n { when: { op: \"mobile.tap\", with: { locator: save, fallbacks: [{ by: \"accessibilityId\", value: \"Save order\" }] } } },\n { then: { op: \"mobile.expectVisible\", with: { locator: { by: \"accessibilityId\", value: \"Nope\" }, timeoutMs: 1_000 } } },\n ],\n };\n const result = await executor.runScenario(scenario);\n expect(result.ok).toBe(false);\n expect(result.error).toContain(\"No element matches\");\n expect(result.steps.map((s) => s.ok)).toEqual([true, false]);\n expect(result.heals).toHaveLength(1);\n });\n\n it(\"never ends the caller's session\", async () => {\n const { driver, executor } = setup();\n driver.add(\"~Save\", new FakeElement());\n await executor.runStep({ op: \"mobile.tap\", with: { locator: save } });\n await executor.mobile.stop();\n expect(driver.callsTo(\"deleteSession\")).toHaveLength(0);\n });\n\n it(\"is a mobile context: no browser, no api adapter needed by mobile steps\", async () => {\n const { executor } = setup();\n expect(executor.context.scenarioType).toBe(\"mobile\");\n expect(executor.context.ui).toBeUndefined();\n expect(executor.context.mobile).toBe(executor.mobile);\n });\n\n it(\"forgets saved values when asked\", async () => {\n const { driver, executor } = setup();\n driver.add(\"~Save\", new FakeElement({ text: \"hello\" }));\n await executor.runStep({ op: \"mobile.getText\", saveAs: \"label\", with: { locator: save } });\n expect(executor.context.resources.has(\"label\")).toBe(true);\n executor.resetResources();\n expect(executor.context.resources.has(\"label\")).toBe(false);\n });\n});\n\ndescribe(\"clearing an iOS app's data\", () => {\n const launch = { op: \"mobile.launch\", with: { clearData: true, grantPermissions: false } };\n const scripts = (driver: FakeDriver) => driver.callsTo(\"execute\").map((call) => [call.args[0], call.args[1]]);\n\n it(\"reinstalls the build it was given\", async () => {\n const { driver, executor } = setup({ platformName: \"iOS\", simulator: true, appPath: \"/builds/My Demo App.app\" });\n const result = await executor.runStep(launch);\n expect(result.ok).toBe(true);\n expect(scripts(driver)).toEqual(\n expect.arrayContaining([\n [\"mobile: removeApp\", { bundleId: \"com.acme.app\" }],\n [\"mobile: installApp\", { app: \"/builds/My Demo App.app\" }],\n ]),\n );\n });\n\n it(\"says what is missing when it was given no build\", async () => {\n const { driver, executor } = setup({ platformName: \"iOS\", simulator: true });\n const result = await executor.runStep(launch);\n expect(result.ok).toBe(false);\n expect(result.error).toContain(\"Clearing data on iOS needs a build to reinstall\");\n expect(scripts(driver).map(([script]) => script)).not.toContain(\"mobile: removeApp\");\n });\n\n it(\"does not need a build on Android, which clears the data in place\", async () => {\n const { driver, executor } = setup();\n expect((await executor.runStep({ op: \"mobile.launch\", with: { clearData: true } })).ok).toBe(true);\n expect(scripts(driver).map(([script]) => script)).toContain(\"mobile: clearApp\");\n });\n});\n\ndescribe(\"runtime manifest\", () => {\n it(\"lists every mobile op and the mobile capabilities\", () => {\n expect(listOps().filter((op) => op.startsWith(\"mobile.\"))).toEqual([\n \"mobile.back\",\n \"mobile.clear\",\n \"mobile.expectHidden\",\n \"mobile.expectText\",\n \"mobile.expectVisible\",\n \"mobile.getText\",\n \"mobile.hideKeyboard\",\n \"mobile.launch\",\n \"mobile.reset\",\n \"mobile.scrollTo\",\n \"mobile.submit\",\n \"mobile.swipe\",\n \"mobile.tap\",\n \"mobile.terminate\",\n \"mobile.type\",\n ]);\n expect(CAPABILITIES).toEqual(expect.arrayContaining([\"mobileRuntime\", \"mobileSelfHealing\", \"mobileSessionModes\", \"mobileReset\", \"restoreFrom\"]));\n expect(RUNTIME_VERSION).toBe(\"1.5.0\");\n });\n});\n"]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Page } from "playwright";
|
|
2
|
+
import { MobileAdapter } from "../adapters/mobile/mobile-adapter";
|
|
3
|
+
import type { MobileClock, MobileDriver } from "../adapters/mobile/mobile.types";
|
|
4
|
+
import { PlaywrightAdapter } from "../adapters/ui/playwright-adapter";
|
|
5
|
+
import type { CaptureOptions } from "../adapters/ui/ui.types";
|
|
6
|
+
import type { HealEvent, StepPhase, TestContext } from "../contracts/runtime-context.types";
|
|
7
|
+
import type { HealingPolicy, OpStep, ScenarioSpec, ScenarioType } from "../contracts/testing-metadata.types";
|
|
8
|
+
import type { StepRegistry } from "../core/step-registry";
|
|
9
|
+
export interface StepExecutorOptions {
|
|
10
|
+
page: Page;
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
apiBaseUrl?: string;
|
|
13
|
+
apiHeaders?: Record<string, string>;
|
|
14
|
+
env?: Record<string, string>;
|
|
15
|
+
secrets?: Record<string, any>;
|
|
16
|
+
testData?: Record<string, Record<string, any>>;
|
|
17
|
+
params?: Record<string, any>;
|
|
18
|
+
defaultTimeoutMs?: number;
|
|
19
|
+
navigationTimeoutMs?: number;
|
|
20
|
+
healing?: HealingPolicy;
|
|
21
|
+
capture?: CaptureOptions;
|
|
22
|
+
scenarioId?: string;
|
|
23
|
+
scenarioType?: ScenarioType;
|
|
24
|
+
registry?: StepRegistry;
|
|
25
|
+
}
|
|
26
|
+
export interface StepRunResult {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
op: string;
|
|
29
|
+
phase: StepPhase;
|
|
30
|
+
stepPath?: string;
|
|
31
|
+
durationMs: number;
|
|
32
|
+
error?: string;
|
|
33
|
+
result?: unknown;
|
|
34
|
+
heals: HealEvent[];
|
|
35
|
+
}
|
|
36
|
+
export interface StepRecord {
|
|
37
|
+
phase: StepPhase;
|
|
38
|
+
op: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
stepPath?: string;
|
|
41
|
+
ok: boolean;
|
|
42
|
+
durationMs: number;
|
|
43
|
+
error?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ScenarioRunResult {
|
|
46
|
+
ok: boolean;
|
|
47
|
+
durationMs: number;
|
|
48
|
+
error?: string;
|
|
49
|
+
steps: StepRecord[];
|
|
50
|
+
heals: HealEvent[];
|
|
51
|
+
}
|
|
52
|
+
export interface StepExecutor {
|
|
53
|
+
readonly ui: PlaywrightAdapter;
|
|
54
|
+
readonly context: TestContext;
|
|
55
|
+
runStep(step: OpStep, opts?: {
|
|
56
|
+
phase?: StepPhase;
|
|
57
|
+
stepPath?: string;
|
|
58
|
+
}): Promise<StepRunResult>;
|
|
59
|
+
runScenario(scenario: ScenarioSpec): Promise<ScenarioRunResult>;
|
|
60
|
+
resetResources(): void;
|
|
61
|
+
}
|
|
62
|
+
export declare function errorMessage(err: unknown): string;
|
|
63
|
+
export declare function createStepExecutor(opts: StepExecutorOptions): StepExecutor;
|
|
64
|
+
export interface MobileStepExecutorOptions {
|
|
65
|
+
driver: MobileDriver;
|
|
66
|
+
platformName?: "Android" | "iOS";
|
|
67
|
+
appPackage: string;
|
|
68
|
+
appActivity?: string;
|
|
69
|
+
appPath?: string;
|
|
70
|
+
appProcessName?: string;
|
|
71
|
+
simulator?: boolean;
|
|
72
|
+
secrets?: Record<string, any>;
|
|
73
|
+
testData?: Record<string, Record<string, any>>;
|
|
74
|
+
params?: Record<string, any>;
|
|
75
|
+
env?: Record<string, string>;
|
|
76
|
+
defaultTimeoutMs?: number;
|
|
77
|
+
navigationTimeoutMs?: number;
|
|
78
|
+
healing?: HealingPolicy;
|
|
79
|
+
capture?: {
|
|
80
|
+
console?: boolean;
|
|
81
|
+
screenshot?: boolean;
|
|
82
|
+
};
|
|
83
|
+
scenarioId?: string;
|
|
84
|
+
registry?: StepRegistry;
|
|
85
|
+
clock?: MobileClock;
|
|
86
|
+
}
|
|
87
|
+
export interface MobileStepExecutor extends Pick<StepExecutor, "runStep" | "runScenario" | "resetResources"> {
|
|
88
|
+
readonly mobile: MobileAdapter;
|
|
89
|
+
readonly context: TestContext;
|
|
90
|
+
}
|
|
91
|
+
export declare function createMobileStepExecutor(opts: MobileStepExecutorOptions): MobileStepExecutor;
|
|
92
|
+
//# sourceMappingURL=step-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-executor.d.ts","sourceRoot":"","sources":["../../../src/testing/runtime/step-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,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