@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,409 @@
|
|
|
1
|
+
// Opt-in integration checks: they drive a real Android emulator or phone through Appium.
|
|
2
|
+
//
|
|
3
|
+
// This is a plain script, not a Jest spec. WebdriverIO's network layer does not survive Jest's sandbox
|
|
4
|
+
// (it crashes the process), and plain Node is what a real run uses anyway.
|
|
5
|
+
//
|
|
6
|
+
// Needs, all running: Appium on MOBILE_IT_APPIUM, a device on MOBILE_IT_UDID, and `webdriverio` that Node can
|
|
7
|
+
// resolve. It is only an optional peer of this package, so point NODE_PATH at a folder that has it.
|
|
8
|
+
//
|
|
9
|
+
// NODE_PATH=/path/to/node_modules npm run test:mobile
|
|
10
|
+
//
|
|
11
|
+
// MOBILE_IT_LONG=1 also runs the four-minute recording check. Exit code is 1 if any check fails.
|
|
12
|
+
//
|
|
13
|
+
// iOS Simulator instead of Android: boot a simulator and start Appium, then
|
|
14
|
+
//
|
|
15
|
+
// MOBILE_IT_PLATFORM=ios MOBILE_IT_UDID=<simulator udid> NODE_PATH=/path/to/node_modules npm run test:mobile
|
|
16
|
+
//
|
|
17
|
+
// It installs the small sample app from the iOS spike (MOBILE_IT_IOS_APP, default
|
|
18
|
+
// test-hub/spikes/mobile-ios/sample-app/out/SampleApp.app, built by its build.sh). WebDriverAgent is cached in
|
|
19
|
+
// MOBILE_IT_WDA (default ~/.solidx/wda/xcode-27.0); the first run builds it, which takes minutes.
|
|
20
|
+
//
|
|
21
|
+
// A real iPhone instead, with the demo app already installed on it (from Xcode, TestFlight or the App Store). Plug the
|
|
22
|
+
// phone into this Mac with a USB cable, unlock it, start Appium, then
|
|
23
|
+
//
|
|
24
|
+
// MOBILE_IT_PLATFORM=ios-device MOBILE_IT_UDID=<phone udid> MOBILE_IT_IOS_TEAM=<10-character team id> \
|
|
25
|
+
// NODE_PATH=/path/to/node_modules npm run test:mobile
|
|
26
|
+
//
|
|
27
|
+
// The phone's UDID is in `xcrun devicectl list devices`; the team id is the OU of the "Apple Development" certificate.
|
|
28
|
+
// MOBILE_IT_IOS_BUNDLE (default com.oswald.mydemoapp) is the installed app's bundle id and MOBILE_IT_IOS_PROCESS (default
|
|
29
|
+
// "My Demo App") its executable, which names its lines in the device log. WebDriverAgent is built and signed for the
|
|
30
|
+
// phone into MOBILE_IT_WDA (default ~/.solidx/wda/xcode-27.0-iphoneos-<team>): the first run takes minutes, and the
|
|
31
|
+
// Mac's keychain asks for its password (answer Always Allow).
|
|
32
|
+
import * as assert from "node:assert/strict";
|
|
33
|
+
import * as fs from "node:fs";
|
|
34
|
+
import * as os from "node:os";
|
|
35
|
+
import * as path from "node:path";
|
|
36
|
+
import type { MobileAdapterOptions } from "../adapters/mobile/mobile.types";
|
|
37
|
+
import type { ScenarioSpec } from "../contracts/testing-metadata.types";
|
|
38
|
+
import { RecordingReporter } from "../runner/recording-reporter";
|
|
39
|
+
import { runFromMetadata } from "../runner/run-from-metadata";
|
|
40
|
+
|
|
41
|
+
const APPIUM = process.env.MOBILE_IT_APPIUM ?? "http://localhost:4723";
|
|
42
|
+
const UDID = process.env.MOBILE_IT_UDID ?? "emulator-5554";
|
|
43
|
+
const APPS_DIR =
|
|
44
|
+
process.env.MOBILE_IT_APPS_DIR ?? "/Users/oswald/projects/Solid_Starters/test-hub/spikes/mobile-appium/apps";
|
|
45
|
+
|
|
46
|
+
const IOS = process.env.MOBILE_IT_PLATFORM === "ios";
|
|
47
|
+
const IOS_DEVICE = process.env.MOBILE_IT_PLATFORM === "ios-device";
|
|
48
|
+
const IOS_APP =
|
|
49
|
+
process.env.MOBILE_IT_IOS_APP ??
|
|
50
|
+
path.join(APPS_DIR, "..", "..", "mobile-ios", "sample-app", "out", "SampleApp.app");
|
|
51
|
+
const WDA_DIR = process.env.MOBILE_IT_WDA ?? path.join(os.homedir(), ".solidx", "wda", "xcode-27.0");
|
|
52
|
+
|
|
53
|
+
const apiDemos: MobileAdapterOptions = {
|
|
54
|
+
appiumUrl: APPIUM,
|
|
55
|
+
udid: UDID,
|
|
56
|
+
appSource: "upload",
|
|
57
|
+
appPath: path.join(APPS_DIR, "ApiDemos-debug.apk"),
|
|
58
|
+
appPackage: "io.appium.android.apis",
|
|
59
|
+
capture: { console: true },
|
|
60
|
+
};
|
|
61
|
+
const rnDemo: MobileAdapterOptions = {
|
|
62
|
+
appiumUrl: APPIUM,
|
|
63
|
+
udid: UDID,
|
|
64
|
+
appSource: "installed",
|
|
65
|
+
appPackage: "com.saucelabs.mydemoapp.rn",
|
|
66
|
+
appActivity: ".MainActivity",
|
|
67
|
+
capture: { console: true },
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const acc = (value: string) => ({ by: "accessibilityId", value });
|
|
71
|
+
|
|
72
|
+
const apiDemosFlow: ScenarioSpec = {
|
|
73
|
+
id: "apidemos-controls",
|
|
74
|
+
type: "mobile",
|
|
75
|
+
steps: [
|
|
76
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
77
|
+
{ when: { op: "mobile.tap", with: { locator: acc("Views") } } },
|
|
78
|
+
{ and: { op: "mobile.tap", with: { locator: acc("Controls") } } },
|
|
79
|
+
{ and: { op: "mobile.tap", with: { locator: acc("1. Light Theme") } } },
|
|
80
|
+
// A bare id: exercises the app-package prefix.
|
|
81
|
+
{ and: { op: "mobile.type", with: { locator: { by: "id", value: "edit" }, text: "hello" } } },
|
|
82
|
+
{ then: { op: "mobile.expectText", with: { locator: { by: "id", value: "edit" }, equals: "hello" } } },
|
|
83
|
+
{ and: { op: "mobile.back" } },
|
|
84
|
+
{ and: { op: "mobile.back" } },
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const rnLogin = (id: string): ScenarioSpec => ({
|
|
89
|
+
id,
|
|
90
|
+
type: "mobile",
|
|
91
|
+
steps: [
|
|
92
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
93
|
+
{ when: { op: "mobile.tap", with: { locator: acc("open menu") } } },
|
|
94
|
+
{ and: { op: "mobile.tap", with: { locator: acc("menu item log in") } } },
|
|
95
|
+
{ and: { op: "mobile.type", with: { locator: acc("Username input field"), text: "bob@example.com" } } },
|
|
96
|
+
{ and: { op: "mobile.type", with: { locator: acc("Password input field"), text: "10203040" } } },
|
|
97
|
+
{ and: { op: "mobile.hideKeyboard" } },
|
|
98
|
+
{ and: { op: "mobile.tap", with: { locator: acc("Login button") } } },
|
|
99
|
+
{ then: { op: "mobile.expectVisible", with: { locator: acc("products screen"), timeoutMs: 15000 } } },
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// ---- iOS Simulator: the spike's sample app (a login form, a persisted login, and a location button) -----------------------
|
|
104
|
+
|
|
105
|
+
const sampleApp = (): MobileAdapterOptions => ({
|
|
106
|
+
appiumUrl: APPIUM,
|
|
107
|
+
udid: UDID,
|
|
108
|
+
platformName: "iOS",
|
|
109
|
+
simulator: true,
|
|
110
|
+
appSource: "upload",
|
|
111
|
+
appPath: IOS_APP,
|
|
112
|
+
appPackage: "io.solidx.testhub.sample",
|
|
113
|
+
appProcessName: "SampleApp",
|
|
114
|
+
wdaDerivedDataPath: WDA_DIR,
|
|
115
|
+
wdaPrebuilt: fs.existsSync(path.join(WDA_DIR, "Build", "Products", "Debug-iphonesimulator", "WebDriverAgentRunner-Runner.app")),
|
|
116
|
+
capture: { console: true },
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const sampleLogin = (id: string): ScenarioSpec => ({
|
|
120
|
+
id,
|
|
121
|
+
type: "mobile",
|
|
122
|
+
steps: [
|
|
123
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
124
|
+
{ then: { op: "mobile.expectText", with: { locator: acc("status label"), equals: "Logged out" } } },
|
|
125
|
+
{ when: { op: "mobile.type", with: { locator: acc("Username input field"), text: "bob" } } },
|
|
126
|
+
{ and: { op: "mobile.type", with: { locator: acc("Password input field"), text: "secret-pass" } } },
|
|
127
|
+
{ and: { op: "mobile.hideKeyboard" } },
|
|
128
|
+
{ and: { op: "mobile.tap", with: { locator: acc("Login button") } } },
|
|
129
|
+
{ then: { op: "mobile.expectText", with: { locator: acc("status label"), equals: "Logged in as bob" } } },
|
|
130
|
+
],
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
async function iosChecks() {
|
|
134
|
+
if (!process.env.MOBILE_IT_UDID) throw new Error("MOBILE_IT_UDID must be the booted simulator's UDID for MOBILE_IT_PLATFORM=ios");
|
|
135
|
+
if (!fs.existsSync(IOS_APP)) throw new Error(`The sample app is not built: ${IOS_APP} (run spikes/mobile-ios/sample-app/build.sh)`);
|
|
136
|
+
|
|
137
|
+
await check("iOS: login twice in one run; the second starts logged out, which proves the reinstall reset", async () => {
|
|
138
|
+
const reporter = new RecordingReporter();
|
|
139
|
+
await runFromMetadata({ scenarios: [sampleLogin("ios-login-1"), sampleLogin("ios-login-2")], mobile: sampleApp(), reporter });
|
|
140
|
+
assert.deepEqual(reporter.scenarioEnds, [
|
|
141
|
+
{ id: "ios-login-1", ok: true },
|
|
142
|
+
{ id: "ios-login-2", ok: true },
|
|
143
|
+
]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
await check("iOS: permissions are granted after a reset, so no prompt blocks the location button", async () => {
|
|
147
|
+
const scenario: ScenarioSpec = {
|
|
148
|
+
id: "ios-location",
|
|
149
|
+
type: "mobile",
|
|
150
|
+
steps: [
|
|
151
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
152
|
+
{ when: { op: "mobile.tap", with: { locator: acc("Location button") } } },
|
|
153
|
+
// 4 is CLAuthorizationStatus.authorizedWhenInUse; an alert that autoAcceptAlerts accepted would leave 2 (denied).
|
|
154
|
+
{ then: { op: "mobile.expectText", with: { locator: acc("location label"), equals: "Location: 4" } } },
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
const reporter = new RecordingReporter();
|
|
158
|
+
await runFromMetadata({ scenarios: [scenario], mobile: sampleApp(), reporter });
|
|
159
|
+
assert.deepEqual(reporter.scenarioEnds, [{ id: "ios-location", ok: true }]);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
await check("iOS: mobile.back on a screen with no back button fails instead of passing silently", async () => {
|
|
163
|
+
const scenario: ScenarioSpec = {
|
|
164
|
+
id: "ios-back",
|
|
165
|
+
type: "mobile",
|
|
166
|
+
steps: [{ given: { op: "mobile.launch" } }, { when: { op: "mobile.back" } }],
|
|
167
|
+
};
|
|
168
|
+
const reporter = new RecordingReporter();
|
|
169
|
+
await assert.rejects(runFromMetadata({ scenarios: [scenario], mobile: sampleApp(), reporter }), /has no back button on iOS/);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
await check("iOS: a failing scenario still gets the recording and the device log", async () => {
|
|
173
|
+
const failing: ScenarioSpec = {
|
|
174
|
+
id: "ios-fails",
|
|
175
|
+
type: "mobile",
|
|
176
|
+
steps: [
|
|
177
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
178
|
+
{ then: { op: "mobile.expectVisible", with: { locator: acc("does-not-exist"), timeoutMs: 3000 } } },
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
const reporter = new RecordingReporter();
|
|
182
|
+
await assert.rejects(
|
|
183
|
+
runFromMetadata({ scenarios: [failing], mobile: sampleApp(), reporter }),
|
|
184
|
+
/No element matches \{ by: "accessibilityId", value: "does-not-exist" \} after 3000 ms/,
|
|
185
|
+
);
|
|
186
|
+
const names = reporter.attachments.filter((a) => a.scenarioId === "ios-fails").map((a) => a.name);
|
|
187
|
+
assert.deepEqual(reporter.runArtifacts.map((a) => a.name), ["run.mp4"]);
|
|
188
|
+
assert.ok(reporter.runArtifacts[0].bytes > 1000, "recording looks empty");
|
|
189
|
+
console.log(` attachments: ${names.join(", ") || "(none)"}; recording ${reporter.runArtifacts[0].bytes} bytes`);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// ---- A real iPhone: the demo app, already installed ---------------------------------------------------------------------
|
|
194
|
+
|
|
195
|
+
/** Keeps what a scenario attached, which the shared RecordingReporter drops. */
|
|
196
|
+
class ContentReporter extends RecordingReporter {
|
|
197
|
+
contents = new Map<string, string>();
|
|
198
|
+
attach(args: { scenarioId: string; name: string; contentType: string; data: Buffer | string }) {
|
|
199
|
+
super.attach(args);
|
|
200
|
+
this.contents.set(`${args.scenarioId}/${args.name}`, String(args.data));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const phoneApp = (): MobileAdapterOptions => {
|
|
205
|
+
const team = process.env.MOBILE_IT_IOS_TEAM ?? "";
|
|
206
|
+
const wdaDir = process.env.MOBILE_IT_WDA ?? path.join(os.homedir(), ".solidx", "wda", `xcode-27.0-iphoneos-${team}`);
|
|
207
|
+
return {
|
|
208
|
+
appiumUrl: APPIUM,
|
|
209
|
+
udid: UDID,
|
|
210
|
+
platformName: "iOS",
|
|
211
|
+
simulator: false,
|
|
212
|
+
appSource: "installed",
|
|
213
|
+
appPackage: process.env.MOBILE_IT_IOS_BUNDLE ?? "com.oswald.mydemoapp",
|
|
214
|
+
appProcessName: process.env.MOBILE_IT_IOS_PROCESS ?? "My Demo App",
|
|
215
|
+
wdaSigning: { teamId: team },
|
|
216
|
+
wdaDerivedDataPath: wdaDir,
|
|
217
|
+
wdaPrebuilt: fs.existsSync(path.join(wdaDir, "Build", "Products", "Debug-iphoneos", "WebDriverAgentRunner-Runner.app")),
|
|
218
|
+
capture: { console: true },
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
async function iosDeviceChecks() {
|
|
223
|
+
if (!process.env.MOBILE_IT_UDID) throw new Error("MOBILE_IT_UDID must be the phone's UDID (xcrun devicectl list devices) for MOBILE_IT_PLATFORM=ios-device");
|
|
224
|
+
if (!/^[A-Z0-9]{10}$/.test(process.env.MOBILE_IT_IOS_TEAM ?? "")) {
|
|
225
|
+
throw new Error("MOBILE_IT_IOS_TEAM must be the 10-character Apple team id (the OU of the Apple Development certificate)");
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
await check("iPhone: the installed app opens on its catalog without clearing anything", async () => {
|
|
229
|
+
const scenario: ScenarioSpec = {
|
|
230
|
+
id: "phone-catalog",
|
|
231
|
+
type: "mobile",
|
|
232
|
+
steps: [
|
|
233
|
+
{ given: { op: "mobile.launch" } },
|
|
234
|
+
{ then: { op: "mobile.expectVisible", with: { locator: acc("Catalog-screen"), timeoutMs: 15000 } } },
|
|
235
|
+
],
|
|
236
|
+
};
|
|
237
|
+
const reporter = new ContentReporter();
|
|
238
|
+
await runFromMetadata({ scenarios: [scenario], mobile: phoneApp(), reporter });
|
|
239
|
+
assert.deepEqual(reporter.scenarioEnds, [{ id: "phone-catalog", ok: true }]);
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
await check("iPhone: a tap moves between screens (More tab, then the menu)", async () => {
|
|
243
|
+
const scenario: ScenarioSpec = {
|
|
244
|
+
id: "phone-menu",
|
|
245
|
+
type: "mobile",
|
|
246
|
+
steps: [
|
|
247
|
+
{ given: { op: "mobile.launch" } },
|
|
248
|
+
{ when: { op: "mobile.tap", with: { locator: acc("More-tab-item") } } },
|
|
249
|
+
{ then: { op: "mobile.expectVisible", with: { locator: acc("GeoLocation-menu-item"), timeoutMs: 15000 } } },
|
|
250
|
+
],
|
|
251
|
+
};
|
|
252
|
+
const reporter = new ContentReporter();
|
|
253
|
+
await runFromMetadata({ scenarios: [scenario], mobile: phoneApp(), reporter });
|
|
254
|
+
assert.deepEqual(reporter.scenarioEnds, [{ id: "phone-menu", ok: true }]);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
await check("iPhone: clearData is refused with the reason, before the app is touched", async () => {
|
|
258
|
+
const scenario: ScenarioSpec = {
|
|
259
|
+
id: "phone-clear",
|
|
260
|
+
type: "mobile",
|
|
261
|
+
steps: [{ given: { op: "mobile.launch", with: { clearData: true } } }],
|
|
262
|
+
};
|
|
263
|
+
const reporter = new ContentReporter();
|
|
264
|
+
await assert.rejects(
|
|
265
|
+
runFromMetadata({ scenarios: [scenario], mobile: phoneApp(), reporter }),
|
|
266
|
+
/Clearing data on an iPhone is not supported: Test Hub uses the app already installed on the phone/,
|
|
267
|
+
);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
await check("iPhone: a failing scenario keeps the recording and a device log with the app's own lines", async () => {
|
|
271
|
+
const failing: ScenarioSpec = {
|
|
272
|
+
id: "phone-fails",
|
|
273
|
+
type: "mobile",
|
|
274
|
+
steps: [
|
|
275
|
+
{ given: { op: "mobile.launch" } },
|
|
276
|
+
{ then: { op: "mobile.expectVisible", with: { locator: acc("does-not-exist"), timeoutMs: 3000 } } },
|
|
277
|
+
],
|
|
278
|
+
};
|
|
279
|
+
const reporter = new ContentReporter();
|
|
280
|
+
await assert.rejects(
|
|
281
|
+
runFromMetadata({ scenarios: [failing], mobile: phoneApp(), reporter }),
|
|
282
|
+
/No element matches \{ by: "accessibilityId", value: "does-not-exist" \} after 3000 ms/,
|
|
283
|
+
);
|
|
284
|
+
assert.deepEqual(reporter.runArtifacts.map((a) => a.name), ["run.mp4"]);
|
|
285
|
+
assert.ok(reporter.runArtifacts[0].bytes > 1000, "recording looks empty");
|
|
286
|
+
const log = reporter.contents.get("phone-fails/console.json");
|
|
287
|
+
assert.ok(log, "no console.json was attached");
|
|
288
|
+
const entries = JSON.parse(log) as Array<{ type: string; text: string }>;
|
|
289
|
+
const own = entries.filter((e) => e.text.includes(`${process.env.MOBILE_IT_IOS_PROCESS ?? "My Demo App"}`));
|
|
290
|
+
assert.ok(own.length > 0, `the device log has no line from the app (${entries.length} lines kept)`);
|
|
291
|
+
assert.ok(!entries.some((e) => e.text.includes("WebDriverAgentRunner-Runner")), "WebDriverAgent's own lines should be filtered out");
|
|
292
|
+
console.log(` ${entries.length} log lines kept, ${own.length} from the app; recording ${reporter.runArtifacts[0].bytes} bytes`);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** Reads the duration, in seconds, from an MP4's movie header. */
|
|
297
|
+
function mp4Duration(data: Buffer): number {
|
|
298
|
+
const at = data.indexOf("mvhd");
|
|
299
|
+
const timescale = data.readUInt32BE(at + 16);
|
|
300
|
+
return data.readUInt32BE(at + 20) / timescale;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const results: Array<{ name: string; ok: boolean; seconds: number; error?: string }> = [];
|
|
304
|
+
async function check(name: string, fn: () => Promise<void>) {
|
|
305
|
+
const startedAt = Date.now();
|
|
306
|
+
try {
|
|
307
|
+
await fn();
|
|
308
|
+
results.push({ name, ok: true, seconds: Math.round((Date.now() - startedAt) / 1000) });
|
|
309
|
+
console.log(`PASS ${name}`);
|
|
310
|
+
} catch (error: any) {
|
|
311
|
+
results.push({ name, ok: false, seconds: Math.round((Date.now() - startedAt) / 1000), error: String(error?.message ?? error) });
|
|
312
|
+
console.log(`FAIL ${name}\n ${String(error?.message ?? error).split("\n")[0]}`);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
async function main() {
|
|
317
|
+
if (IOS_DEVICE) {
|
|
318
|
+
await iosDeviceChecks();
|
|
319
|
+
const failedPhone = results.filter((r) => !r.ok);
|
|
320
|
+
console.log(`\n${results.length - failedPhone.length}/${results.length} checks passed`);
|
|
321
|
+
process.exit(failedPhone.length ? 1 : 0);
|
|
322
|
+
}
|
|
323
|
+
if (IOS) {
|
|
324
|
+
await iosChecks();
|
|
325
|
+
const failedIos = results.filter((r) => !r.ok);
|
|
326
|
+
console.log(`\n${results.length - failedIos.length}/${results.length} checks passed`);
|
|
327
|
+
process.exit(failedIos.length ? 1 : 0);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
await check("ApiDemos: uploaded APK, bare-id locator, text assertion", async () => {
|
|
331
|
+
const reporter = new RecordingReporter();
|
|
332
|
+
await runFromMetadata({ scenarios: [apiDemosFlow], mobile: apiDemos, reporter });
|
|
333
|
+
assert.deepEqual(reporter.scenarioEnds, [{ id: "apidemos-controls", ok: true }]);
|
|
334
|
+
assert.deepEqual(reporter.runArtifacts, [], "a passing run keeps no recording");
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
await check("React Native demo: installed app; two logins in one run prove each scenario starts clean", async () => {
|
|
338
|
+
const reporter = new RecordingReporter();
|
|
339
|
+
await runFromMetadata({ scenarios: [rnLogin("rn-login-1"), rnLogin("rn-login-2")], mobile: rnDemo, reporter });
|
|
340
|
+
assert.deepEqual(reporter.scenarioEnds, [
|
|
341
|
+
{ id: "rn-login-1", ok: true },
|
|
342
|
+
{ id: "rn-login-2", ok: true },
|
|
343
|
+
]);
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
await check("a failing scenario still gets the recording, and no screenshot is uploaded", async () => {
|
|
347
|
+
const failing: ScenarioSpec = {
|
|
348
|
+
id: "rn-fails",
|
|
349
|
+
type: "mobile",
|
|
350
|
+
steps: [
|
|
351
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
352
|
+
{ then: { op: "mobile.expectVisible", with: { locator: acc("does-not-exist"), timeoutMs: 3000 } } },
|
|
353
|
+
],
|
|
354
|
+
};
|
|
355
|
+
const reporter = new RecordingReporter();
|
|
356
|
+
await assert.rejects(
|
|
357
|
+
runFromMetadata({ scenarios: [failing], mobile: rnDemo, reporter }),
|
|
358
|
+
/No element matches \{ by: "accessibilityId", value: "does-not-exist" \} after 3000 ms/,
|
|
359
|
+
);
|
|
360
|
+
const names = reporter.attachments.filter((a) => a.scenarioId === "rn-fails").map((a) => a.name);
|
|
361
|
+
assert.ok(!names.includes("screenshot.png"), `screenshot.png should not be attached by default, got: ${names.join(", ")}`);
|
|
362
|
+
assert.deepEqual(reporter.runArtifacts.map((a) => a.name), ["run.mp4"]);
|
|
363
|
+
assert.ok(reporter.runArtifacts[0].bytes > 1000, "recording looks empty");
|
|
364
|
+
console.log(` attachments: ${names.join(", ")}; recording ${reporter.runArtifacts[0].bytes} bytes`);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
if (process.env.MOBILE_IT_LONG === "1") {
|
|
368
|
+
await check("a four-minute run: how much of it does the recording cover?", async () => {
|
|
369
|
+
const waits = Array.from({ length: 11 }, () => [
|
|
370
|
+
{ op: "util.sleep", with: { ms: 20_000 } },
|
|
371
|
+
{ op: "mobile.expectVisible", with: { locator: acc("products screen") } },
|
|
372
|
+
]).flat();
|
|
373
|
+
const long: ScenarioSpec = {
|
|
374
|
+
id: "rn-long",
|
|
375
|
+
type: "mobile",
|
|
376
|
+
steps: [
|
|
377
|
+
{ given: { op: "mobile.launch", with: { clearData: true } } },
|
|
378
|
+
...waits,
|
|
379
|
+
{ then: { op: "mobile.expectVisible", with: { locator: acc("does-not-exist"), timeoutMs: 2000 } } },
|
|
380
|
+
],
|
|
381
|
+
};
|
|
382
|
+
const captured: Buffer[] = [];
|
|
383
|
+
const reporter = new RecordingReporter();
|
|
384
|
+
const original = reporter.attachRunArtifact.bind(reporter);
|
|
385
|
+
reporter.attachRunArtifact = (args: { name: string; data: Buffer | string }) => {
|
|
386
|
+
captured.push(Buffer.from(args.data));
|
|
387
|
+
original(args);
|
|
388
|
+
};
|
|
389
|
+
const startedAt = Date.now();
|
|
390
|
+
await assert.rejects(runFromMetadata({ scenarios: [long], mobile: rnDemo, reporter }));
|
|
391
|
+
assert.equal(captured.length, 1, "expected one recording");
|
|
392
|
+
const outcome = {
|
|
393
|
+
ranSeconds: Math.round((Date.now() - startedAt) / 1000),
|
|
394
|
+
recordedSeconds: Math.round(mp4Duration(captured[0])),
|
|
395
|
+
bytes: captured[0].length,
|
|
396
|
+
};
|
|
397
|
+
console.log(` ${JSON.stringify(outcome)}`);
|
|
398
|
+
const outDir = path.join(APPS_DIR, "..", "out");
|
|
399
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
400
|
+
fs.writeFileSync(path.join(outDir, "long-recording.json"), JSON.stringify(outcome, null, 2));
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const failed = results.filter((r) => !r.ok);
|
|
405
|
+
console.log(`\n${results.length - failed.length}/${results.length} checks passed`);
|
|
406
|
+
process.exit(failed.length ? 1 : 0);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
void main();
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { buildCapabilities, IOS_ALLOW_BUTTON_SELECTOR } from "./capabilities";
|
|
2
|
+
import type { MobileAdapterOptions } from "./mobile.types";
|
|
3
|
+
|
|
4
|
+
const base: MobileAdapterOptions = {
|
|
5
|
+
appiumUrl: "http://localhost:4723",
|
|
6
|
+
udid: "emulator-5554",
|
|
7
|
+
appSource: "installed",
|
|
8
|
+
appPackage: "com.acme.app",
|
|
9
|
+
appActivity: ".MainActivity",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
describe("buildCapabilities", () => {
|
|
13
|
+
it("sets the base capabilities for every session", () => {
|
|
14
|
+
const caps = buildCapabilities(base);
|
|
15
|
+
expect(caps).toMatchObject({
|
|
16
|
+
platformName: "Android",
|
|
17
|
+
"appium:automationName": "UiAutomator2",
|
|
18
|
+
"appium:udid": "emulator-5554",
|
|
19
|
+
"appium:newCommandTimeout": 120,
|
|
20
|
+
"appium:autoGrantPermissions": true,
|
|
21
|
+
"appium:settings[waitForIdleTimeout]": 500,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("lets extra capabilities change the idle wait, for a device that needs another value", () => {
|
|
26
|
+
const caps = buildCapabilities({ ...base, extraCapabilities: { "appium:settings[waitForIdleTimeout]": 0 } });
|
|
27
|
+
expect(caps["appium:settings[waitForIdleTimeout]"]).toBe(0);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("installed: opens the app by id, keeps its data and restarts it", () => {
|
|
31
|
+
const caps = buildCapabilities(base);
|
|
32
|
+
expect(caps).toMatchObject({
|
|
33
|
+
"appium:appPackage": "com.acme.app",
|
|
34
|
+
"appium:appActivity": ".MainActivity",
|
|
35
|
+
"appium:noReset": true,
|
|
36
|
+
"appium:forceAppLaunch": true,
|
|
37
|
+
"appium:shouldTerminateApp": true,
|
|
38
|
+
});
|
|
39
|
+
expect(caps).not.toHaveProperty("appium:app");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("upload: passes the APK and leaves noReset unset", () => {
|
|
43
|
+
const caps = buildCapabilities({ ...base, appSource: "upload", appPath: "/tmp/app.apk", appActivity: undefined });
|
|
44
|
+
expect(caps["appium:app"]).toBe("/tmp/app.apk");
|
|
45
|
+
expect(caps).not.toHaveProperty("appium:noReset");
|
|
46
|
+
expect(caps).not.toHaveProperty("appium:appActivity");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("merges extra capabilities last, so they can override", () => {
|
|
50
|
+
const caps = buildCapabilities({
|
|
51
|
+
...base,
|
|
52
|
+
extraCapabilities: { "appium:newCommandTimeout": 300, "appium:language": "en" },
|
|
53
|
+
});
|
|
54
|
+
expect(caps["appium:newCommandTimeout"]).toBe(300);
|
|
55
|
+
expect(caps["appium:language"]).toBe("en");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("never asks Appium to boot an emulator", () => {
|
|
59
|
+
expect(buildCapabilities(base)).not.toHaveProperty("appium:avd");
|
|
60
|
+
expect(buildCapabilities({ ...base, extraCapabilities: {} })).not.toHaveProperty("appium:avdArgs");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("requires a device", () => {
|
|
64
|
+
expect(() => buildCapabilities({ ...base, udid: "" })).toThrow("A device is required (udid)");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("requires appPackage", () => {
|
|
68
|
+
expect(() => buildCapabilities({ ...base, appPackage: "" })).toThrow("appPackage is required");
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('requires appPath for "upload"', () => {
|
|
72
|
+
expect(() => buildCapabilities({ ...base, appSource: "upload" })).toThrow(
|
|
73
|
+
'appPath is required when appSource is "upload"',
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('requires appActivity for "installed"', () => {
|
|
78
|
+
expect(() => buildCapabilities({ ...base, appActivity: undefined })).toThrow(
|
|
79
|
+
'appActivity is required when appSource is "installed"',
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("rejects an unknown app source", () => {
|
|
84
|
+
expect(() => buildCapabilities({ ...base, appSource: "store" as any })).toThrow('appSource must be "upload" or "installed"');
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
describe("buildCapabilities: iOS", () => {
|
|
89
|
+
const ios: MobileAdapterOptions = {
|
|
90
|
+
appiumUrl: "http://localhost:4723",
|
|
91
|
+
udid: "1674E718-0EBA-4568-9644-F18E0DDF7705",
|
|
92
|
+
platformName: "iOS",
|
|
93
|
+
appSource: "installed",
|
|
94
|
+
appPackage: "io.solidx.testhub.sample",
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
it("uses XCUITest and the simulator's UDID", () => {
|
|
98
|
+
expect(buildCapabilities(ios)).toMatchObject({
|
|
99
|
+
platformName: "iOS",
|
|
100
|
+
"appium:automationName": "XCUITest",
|
|
101
|
+
"appium:udid": "1674E718-0EBA-4568-9644-F18E0DDF7705",
|
|
102
|
+
"appium:newCommandTimeout": 120,
|
|
103
|
+
"appium:autoAcceptAlerts": true,
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("has no Android-only keys and never an avd", () => {
|
|
108
|
+
const caps = buildCapabilities(ios);
|
|
109
|
+
for (const key of ["appium:avd", "appium:appPackage", "appium:appActivity", "appium:autoGrantPermissions"]) {
|
|
110
|
+
expect(caps).not.toHaveProperty(key);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("installed: opens the app by bundle id, keeps its data and restarts it, without needing an activity", () => {
|
|
115
|
+
const caps = buildCapabilities(ios);
|
|
116
|
+
expect(caps).toMatchObject({
|
|
117
|
+
"appium:bundleId": "io.solidx.testhub.sample",
|
|
118
|
+
"appium:noReset": true,
|
|
119
|
+
"appium:forceAppLaunch": true,
|
|
120
|
+
"appium:shouldTerminateApp": true,
|
|
121
|
+
});
|
|
122
|
+
expect(caps).not.toHaveProperty("appium:app");
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("installed with a build: the build is kept for a reset, not installed at session start", () => {
|
|
126
|
+
const caps = buildCapabilities({ ...ios, appPath: "/builds/Sample.app" });
|
|
127
|
+
expect(caps).not.toHaveProperty("appium:app");
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("upload: passes the .app and needs a path", () => {
|
|
131
|
+
expect(buildCapabilities({ ...ios, appSource: "upload", appPath: "/builds/Sample.app" })["appium:app"]).toBe("/builds/Sample.app");
|
|
132
|
+
expect(() => buildCapabilities({ ...ios, appSource: "upload" })).toThrow('appPath is required when appSource is "upload"');
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("adds the WebDriverAgent cache only when a folder is given", () => {
|
|
136
|
+
expect(buildCapabilities(ios)).not.toHaveProperty("appium:derivedDataPath");
|
|
137
|
+
expect(buildCapabilities({ ...ios, wdaDerivedDataPath: "/w/xcode-27.0" })).toMatchObject({
|
|
138
|
+
"appium:derivedDataPath": "/w/xcode-27.0",
|
|
139
|
+
"appium:usePrebuiltWDA": false,
|
|
140
|
+
});
|
|
141
|
+
expect(buildCapabilities({ ...ios, wdaDerivedDataPath: "/w/xcode-27.0", wdaPrebuilt: true })).toMatchObject({
|
|
142
|
+
"appium:usePrebuiltWDA": true,
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("lets extra capabilities override, for example to leave alerts alone", () => {
|
|
147
|
+
expect(buildCapabilities({ ...ios, extraCapabilities: { "appium:autoAcceptAlerts": false } })).toMatchObject({
|
|
148
|
+
"appium:autoAcceptAlerts": false,
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it("still requires a device and an app id", () => {
|
|
153
|
+
expect(() => buildCapabilities({ ...ios, udid: "" })).toThrow("A device is required");
|
|
154
|
+
expect(() => buildCapabilities({ ...ios, appPackage: "" })).toThrow("appPackage is required");
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe("buildCapabilities: iOS first build", () => {
|
|
159
|
+
const ios: MobileAdapterOptions = {
|
|
160
|
+
appiumUrl: "http://localhost:4723", udid: "U", platformName: "iOS", appSource: "installed", appPackage: "io.solidx.testhub.sample",
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
it("gives WebDriverAgent longer to start until it has been built", () => {
|
|
164
|
+
expect(buildCapabilities(ios)["appium:wdaLaunchTimeout"]).toBe(480_000);
|
|
165
|
+
expect(buildCapabilities({ ...ios, wdaDerivedDataPath: "/w", wdaPrebuilt: false })["appium:wdaLaunchTimeout"]).toBe(480_000);
|
|
166
|
+
expect(buildCapabilities({ ...ios, wdaDerivedDataPath: "/w", wdaPrebuilt: true })["appium:wdaLaunchTimeout"]).toBe(240_000);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
describe("buildCapabilities: iOS on a phone and on the Simulator", () => {
|
|
171
|
+
const TEAM = "LN5367MMM6";
|
|
172
|
+
const phone: MobileAdapterOptions = {
|
|
173
|
+
appiumUrl: "http://localhost:4723",
|
|
174
|
+
udid: "00008140-001A202611B8801C",
|
|
175
|
+
platformName: "iOS",
|
|
176
|
+
simulator: false,
|
|
177
|
+
appSource: "installed",
|
|
178
|
+
appPackage: "com.oswald.mydemoapp",
|
|
179
|
+
};
|
|
180
|
+
const simulator: MobileAdapterOptions = { ...phone, udid: "1674E718-0EBA-4568-9644-F18E0DDF7705", simulator: true };
|
|
181
|
+
const signingKeys = ["appium:xcodeOrgId", "appium:xcodeSigningId", "appium:updatedWDABundleId", "appium:allowProvisioningDeviceRegistration"];
|
|
182
|
+
const SETTING = "appium:settings[acceptAlertButtonSelector]";
|
|
183
|
+
|
|
184
|
+
it("a phone with signing: the team, the identity, WebDriverAgent's own bundle id and permission to register", () => {
|
|
185
|
+
expect(buildCapabilities({ ...phone, wdaSigning: { teamId: TEAM } })).toMatchObject({
|
|
186
|
+
"appium:xcodeOrgId": TEAM,
|
|
187
|
+
"appium:xcodeSigningId": "Apple Development",
|
|
188
|
+
"appium:updatedWDABundleId": "io.solidx.wda.ln5367mmm6",
|
|
189
|
+
"appium:allowProvisioningDeviceRegistration": true,
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it("a signing identity and a WebDriverAgent bundle id given by the caller win over the defaults", () => {
|
|
194
|
+
const caps = buildCapabilities({ ...phone, wdaSigning: { teamId: TEAM, signingId: "iPhone Developer", wdaBundleId: "com.acme.wda" } });
|
|
195
|
+
expect(caps["appium:xcodeSigningId"]).toBe("iPhone Developer");
|
|
196
|
+
expect(caps["appium:updatedWDABundleId"]).toBe("com.acme.wda");
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("a phone allows the permission prompt through a WebDriverAgent setting, not a capability the driver would ignore", () => {
|
|
200
|
+
const caps = buildCapabilities(phone);
|
|
201
|
+
expect(caps[SETTING]).toBe(IOS_ALLOW_BUTTON_SELECTOR);
|
|
202
|
+
expect(Object.keys(caps)).not.toContain("appium:acceptAlertButtonSelector");
|
|
203
|
+
expect(caps["appium:autoAcceptAlerts"]).toBe(true);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it("the allow rule never taps Allow Once", () => {
|
|
207
|
+
expect(IOS_ALLOW_BUTTON_SELECTOR).toContain("Allow While Using App");
|
|
208
|
+
expect(IOS_ALLOW_BUTTON_SELECTOR).not.toContain("Allow Once");
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("a phone without signing still gets the allow rule but none of the signing keys", () => {
|
|
212
|
+
const caps = buildCapabilities(phone);
|
|
213
|
+
expect(Object.keys(caps)).toContain(SETTING);
|
|
214
|
+
for (const key of signingKeys) expect(Object.keys(caps)).not.toContain(key);
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it("the Simulator gets neither signing nor the allow rule", () => {
|
|
218
|
+
const caps = buildCapabilities({ ...simulator, wdaSigning: undefined });
|
|
219
|
+
expect(Object.keys(caps)).not.toContain(SETTING);
|
|
220
|
+
for (const key of signingKeys) expect(Object.keys(caps)).not.toContain(key);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it("the Simulator's capabilities are exactly what they were before phones", () => {
|
|
224
|
+
expect(buildCapabilities(simulator)).toEqual({
|
|
225
|
+
platformName: "iOS",
|
|
226
|
+
"appium:automationName": "XCUITest",
|
|
227
|
+
"appium:udid": "1674E718-0EBA-4568-9644-F18E0DDF7705",
|
|
228
|
+
"appium:newCommandTimeout": 120,
|
|
229
|
+
"appium:autoAcceptAlerts": true,
|
|
230
|
+
"appium:wdaLaunchTimeout": 480_000,
|
|
231
|
+
"appium:bundleId": "com.oswald.mydemoapp",
|
|
232
|
+
"appium:noReset": true,
|
|
233
|
+
"appium:forceAppLaunch": true,
|
|
234
|
+
"appium:shouldTerminateApp": true,
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
it("extraCapabilities still override what the phone sets", () => {
|
|
239
|
+
expect(buildCapabilities({ ...phone, extraCapabilities: { [SETTING]: "custom" } })[SETTING]).toBe("custom");
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
it("Android gets none of it", () => {
|
|
243
|
+
const android = buildCapabilities({ appiumUrl: "http://localhost:4723", udid: "emulator-5554", appSource: "installed", appPackage: "com.acme.app", appActivity: ".Main" });
|
|
244
|
+
expect(Object.keys(android)).not.toContain(SETTING);
|
|
245
|
+
for (const key of signingKeys) expect(Object.keys(android)).not.toContain(key);
|
|
246
|
+
});
|
|
247
|
+
});
|