@solidxai/core 0.1.22-beta.1 → 0.1.22-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/controllers/module-package.controller.d.ts +198 -0
- package/dist/controllers/module-package.controller.d.ts.map +1 -1
- package/dist/controllers/test-run.controller.d.ts +5 -0
- package/dist/controllers/test-run.controller.d.ts.map +1 -1
- package/dist/controllers/test-run.controller.js +17 -0
- package/dist/controllers/test-run.controller.js.map +1 -1
- package/dist/dtos/confirm-module-package-import.dto.d.ts +2 -0
- package/dist/dtos/confirm-module-package-import.dto.d.ts.map +1 -1
- package/dist/dtos/confirm-module-package-import.dto.js +21 -1
- package/dist/dtos/confirm-module-package-import.dto.js.map +1 -1
- package/dist/dtos/create-field-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-field-metadata.dto.js +3 -3
- package/dist/dtos/create-field-metadata.dto.js.map +1 -1
- package/dist/dtos/create-model-metadata.dto.d.ts +6 -6
- package/dist/dtos/create-model-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-model-metadata.dto.js +13 -7
- package/dist/dtos/create-model-metadata.dto.js.map +1 -1
- package/dist/dtos/test-run-request.dto.d.ts +12 -1
- package/dist/dtos/test-run-request.dto.d.ts.map +1 -1
- package/dist/dtos/test-run-request.dto.js +16 -1
- package/dist/dtos/test-run-request.dto.js.map +1 -1
- package/dist/helpers/module-package-sync.helper.d.ts +71 -0
- package/dist/helpers/module-package-sync.helper.d.ts.map +1 -0
- package/dist/helpers/module-package-sync.helper.js +318 -0
- package/dist/helpers/module-package-sync.helper.js.map +1 -0
- package/dist/helpers/module-package-sync.helper.spec.d.ts +2 -0
- package/dist/helpers/module-package-sync.helper.spec.d.ts.map +1 -0
- package/dist/helpers/module-package-sync.helper.spec.js +229 -0
- package/dist/helpers/module-package-sync.helper.spec.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts +3 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.js +19 -6
- package/dist/jobs/database/test-run-queue-subscriber-database.service.js.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts +9 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +138 -0
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +0 -47
- package/dist/services/module-package.service.d.ts +38 -0
- package/dist/services/module-package.service.d.ts.map +1 -1
- package/dist/services/module-package.service.js +314 -33
- package/dist/services/module-package.service.js.map +1 -1
- package/dist/services/module-package.service.spec.d.ts +2 -0
- package/dist/services/module-package.service.spec.d.ts.map +1 -0
- package/dist/services/module-package.service.spec.js +347 -0
- package/dist/services/module-package.service.spec.js.map +1 -0
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +5 -4
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/testing/__integration__/mobile-emulator.integration.d.ts +2 -0
- package/dist/testing/__integration__/mobile-emulator.integration.d.ts.map +1 -0
- package/dist/testing/__integration__/mobile-emulator.integration.js +368 -0
- package/dist/testing/__integration__/mobile-emulator.integration.js.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.d.ts +4 -0
- package/dist/testing/adapters/mobile/capabilities.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.js +85 -0
- package/dist/testing/adapters/mobile/capabilities.js.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/capabilities.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/capabilities.spec.js +215 -0
- package/dist/testing/adapters/mobile/capabilities.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/fake-driver.d.ts +113 -0
- package/dist/testing/adapters/mobile/fake-driver.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/fake-driver.js +122 -0
- package/dist/testing/adapters/mobile/fake-driver.js.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.d.ts +31 -0
- package/dist/testing/adapters/mobile/ios-keyboard.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.js +157 -0
- package/dist/testing/adapters/mobile/ios-keyboard.js.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.js +36 -0
- package/dist/testing/adapters/mobile/ios-keyboard.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/locator.d.ts +12 -0
- package/dist/testing/adapters/mobile/locator.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/locator.js +96 -0
- package/dist/testing/adapters/mobile/locator.js.map +1 -0
- package/dist/testing/adapters/mobile/locator.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/locator.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/locator.spec.js +136 -0
- package/dist/testing/adapters/mobile/locator.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/logcat.d.ts +9 -0
- package/dist/testing/adapters/mobile/logcat.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/logcat.js +28 -0
- package/dist/testing/adapters/mobile/logcat.js.map +1 -0
- package/dist/testing/adapters/mobile/logcat.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/logcat.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/logcat.spec.js +46 -0
- package/dist/testing/adapters/mobile/logcat.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.d.ts +67 -0
- package/dist/testing/adapters/mobile/mobile-adapter.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.js +240 -0
- package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.js +494 -0
- package/dist/testing/adapters/mobile/mobile-adapter.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.js +567 -0
- package/dist/testing/adapters/mobile/mobile-adapter.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/mobile.types.d.ts +111 -0
- package/dist/testing/adapters/mobile/mobile.types.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/mobile.types.js +3 -0
- package/dist/testing/adapters/mobile/mobile.types.js.map +1 -0
- package/dist/testing/adapters/mobile/phone-errors.d.ts +6 -0
- package/dist/testing/adapters/mobile/phone-errors.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/phone-errors.js +43 -0
- package/dist/testing/adapters/mobile/phone-errors.js.map +1 -0
- package/dist/testing/adapters/mobile/platform.d.ts +7 -0
- package/dist/testing/adapters/mobile/platform.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/platform.js +11 -0
- package/dist/testing/adapters/mobile/platform.js.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.d.ts +6 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.js +95 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.js.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.js +199 -0
- package/dist/testing/adapters/mobile/resolve-mobile-target.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/run-options.d.ts +11 -0
- package/dist/testing/adapters/mobile/run-options.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/run-options.js +41 -0
- package/dist/testing/adapters/mobile/run-options.js.map +1 -0
- package/dist/testing/adapters/mobile/run-options.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/run-options.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/run-options.spec.js +100 -0
- package/dist/testing/adapters/mobile/run-options.spec.js.map +1 -0
- package/dist/testing/adapters/mobile/syslog.d.ts +9 -0
- package/dist/testing/adapters/mobile/syslog.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/syslog.js +45 -0
- package/dist/testing/adapters/mobile/syslog.js.map +1 -0
- package/dist/testing/adapters/mobile/syslog.spec.d.ts +2 -0
- package/dist/testing/adapters/mobile/syslog.spec.d.ts.map +1 -0
- package/dist/testing/adapters/mobile/syslog.spec.js +81 -0
- package/dist/testing/adapters/mobile/syslog.spec.js.map +1 -0
- package/dist/testing/adapters/ui/playwright-adapter.d.ts +24 -3
- package/dist/testing/adapters/ui/playwright-adapter.d.ts.map +1 -1
- package/dist/testing/adapters/ui/playwright-adapter.js +113 -14
- package/dist/testing/adapters/ui/playwright-adapter.js.map +1 -1
- package/dist/testing/adapters/ui/resolve-target.d.ts +12 -0
- package/dist/testing/adapters/ui/resolve-target.d.ts.map +1 -0
- package/dist/testing/adapters/ui/resolve-target.js +95 -0
- package/dist/testing/adapters/ui/resolve-target.js.map +1 -0
- package/dist/testing/adapters/ui/ui.types.d.ts +12 -0
- package/dist/testing/adapters/ui/ui.types.d.ts.map +1 -1
- package/dist/testing/adapters/ui/ui.types.js.map +1 -1
- package/dist/testing/contracts/runtime-context.types.d.ts +14 -0
- package/dist/testing/contracts/runtime-context.types.d.ts.map +1 -1
- package/dist/testing/contracts/runtime-context.types.js.map +1 -1
- package/dist/testing/contracts/testing-metadata.types.d.ts +28 -1
- package/dist/testing/contracts/testing-metadata.types.d.ts.map +1 -1
- package/dist/testing/contracts/testing-metadata.types.js.map +1 -1
- package/dist/testing/core/step-registry.d.ts +1 -0
- package/dist/testing/core/step-registry.d.ts.map +1 -1
- package/dist/testing/core/step-registry.js +3 -0
- package/dist/testing/core/step-registry.js.map +1 -1
- package/dist/testing/core/testing-engine.d.ts +16 -4
- package/dist/testing/core/testing-engine.d.ts.map +1 -1
- package/dist/testing/core/testing-engine.js +109 -33
- package/dist/testing/core/testing-engine.js.map +1 -1
- package/dist/testing/reporter/console-reporter.d.ts +7 -13
- package/dist/testing/reporter/console-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/console-reporter.js +15 -1
- package/dist/testing/reporter/console-reporter.js.map +1 -1
- package/dist/testing/reporter/file-service-artifact-sink.d.ts +2 -0
- package/dist/testing/reporter/file-service-artifact-sink.d.ts.map +1 -1
- package/dist/testing/reporter/file-service-artifact-sink.js +2 -1
- package/dist/testing/reporter/file-service-artifact-sink.js.map +1 -1
- package/dist/testing/reporter/lifecycle-events.types.d.ts +11 -0
- package/dist/testing/reporter/lifecycle-events.types.d.ts.map +1 -1
- package/dist/testing/reporter/lifecycle-events.types.js.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts +7 -5
- package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.js +25 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.js.map +1 -1
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.d.ts +2 -0
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.d.ts.map +1 -0
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.js +72 -0
- package/dist/testing/reporter/lifecycle-webhook-reporter.spec.js.map +1 -0
- package/dist/testing/reporter/progress-reporter.d.ts +4 -13
- package/dist/testing/reporter/progress-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/progress-reporter.js +5 -1
- package/dist/testing/reporter/progress-reporter.js.map +1 -1
- package/dist/testing/reporter/reporter.types.d.ts +27 -13
- package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
- package/dist/testing/reporter/reporter.types.js.map +1 -1
- package/dist/testing/runner/lifecycle.d.ts +8 -0
- package/dist/testing/runner/lifecycle.d.ts.map +1 -1
- package/dist/testing/runner/lifecycle.js +80 -0
- package/dist/testing/runner/lifecycle.js.map +1 -1
- package/dist/testing/runner/lifecycle.spec.d.ts +2 -0
- package/dist/testing/runner/lifecycle.spec.d.ts.map +1 -0
- package/dist/testing/runner/lifecycle.spec.js +33 -0
- package/dist/testing/runner/lifecycle.spec.js.map +1 -0
- package/dist/testing/runner/mobile-session.d.ts +24 -0
- package/dist/testing/runner/mobile-session.d.ts.map +1 -0
- package/dist/testing/runner/mobile-session.js +96 -0
- package/dist/testing/runner/mobile-session.js.map +1 -0
- package/dist/testing/runner/mobile-session.spec.d.ts +2 -0
- package/dist/testing/runner/mobile-session.spec.d.ts.map +1 -0
- package/dist/testing/runner/mobile-session.spec.js +89 -0
- package/dist/testing/runner/mobile-session.spec.js.map +1 -0
- package/dist/testing/runner/recording-reporter.d.ts +62 -0
- package/dist/testing/runner/recording-reporter.d.ts.map +1 -0
- package/dist/testing/runner/recording-reporter.js +35 -0
- package/dist/testing/runner/recording-reporter.js.map +1 -0
- package/dist/testing/runner/run-cancellation.d.ts +7 -0
- package/dist/testing/runner/run-cancellation.d.ts.map +1 -0
- package/dist/testing/runner/run-cancellation.js +30 -0
- package/dist/testing/runner/run-cancellation.js.map +1 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.d.ts +2 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.d.ts.map +1 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.js +58 -0
- package/dist/testing/runner/run-from-metadata.cancel.spec.js.map +1 -0
- package/dist/testing/runner/run-from-metadata.d.ts +4 -0
- package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
- package/dist/testing/runner/run-from-metadata.js +152 -25
- package/dist/testing/runner/run-from-metadata.js.map +1 -1
- package/dist/testing/runner/run-from-metadata.mobile.spec.d.ts +2 -0
- package/dist/testing/runner/run-from-metadata.mobile.spec.d.ts.map +1 -0
- package/dist/testing/runner/run-from-metadata.mobile.spec.js +498 -0
- package/dist/testing/runner/run-from-metadata.mobile.spec.js.map +1 -0
- package/dist/testing/runner/run-from-metadata.spec.js +188 -0
- package/dist/testing/runner/run-from-metadata.spec.js.map +1 -1
- package/dist/testing/runner/scenario-graph.d.ts +8 -0
- package/dist/testing/runner/scenario-graph.d.ts.map +1 -0
- package/dist/testing/runner/scenario-graph.js +120 -0
- package/dist/testing/runner/scenario-graph.js.map +1 -0
- package/dist/testing/runner/scenario-graph.spec.d.ts +2 -0
- package/dist/testing/runner/scenario-graph.spec.d.ts.map +1 -0
- package/dist/testing/runner/scenario-graph.spec.js +97 -0
- package/dist/testing/runner/scenario-graph.spec.js.map +1 -0
- package/dist/testing/runtime/default-registry.d.ts +3 -0
- package/dist/testing/runtime/default-registry.d.ts.map +1 -0
- package/dist/testing/runtime/default-registry.js +21 -0
- package/dist/testing/runtime/default-registry.js.map +1 -0
- package/dist/testing/runtime/index.d.ts +22 -0
- package/dist/testing/runtime/index.d.ts.map +1 -0
- package/dist/testing/runtime/index.js +63 -0
- package/dist/testing/runtime/index.js.map +1 -0
- package/dist/testing/runtime/mobile-step-executor.spec.d.ts +2 -0
- package/dist/testing/runtime/mobile-step-executor.spec.d.ts.map +1 -0
- package/dist/testing/runtime/mobile-step-executor.spec.js +157 -0
- package/dist/testing/runtime/mobile-step-executor.spec.js.map +1 -0
- package/dist/testing/runtime/step-executor.d.ts +92 -0
- package/dist/testing/runtime/step-executor.d.ts.map +1 -0
- package/dist/testing/runtime/step-executor.js +171 -0
- package/dist/testing/runtime/step-executor.js.map +1 -0
- package/dist/testing/runtime/step-executor.spec.d.ts +2 -0
- package/dist/testing/runtime/step-executor.spec.d.ts.map +1 -0
- package/dist/testing/runtime/step-executor.spec.js +137 -0
- package/dist/testing/runtime/step-executor.spec.js.map +1 -0
- package/dist/testing/steps/mobile/actions.step.d.ts +3 -0
- package/dist/testing/steps/mobile/actions.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/actions.step.js +151 -0
- package/dist/testing/steps/mobile/actions.step.js.map +1 -0
- package/dist/testing/steps/mobile/app.step.d.ts +3 -0
- package/dist/testing/steps/mobile/app.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/app.step.js +20 -0
- package/dist/testing/steps/mobile/app.step.js.map +1 -0
- package/dist/testing/steps/mobile/assertions.step.d.ts +3 -0
- package/dist/testing/steps/mobile/assertions.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/assertions.step.js +55 -0
- package/dist/testing/steps/mobile/assertions.step.js.map +1 -0
- package/dist/testing/steps/mobile/gestures.step.d.ts +3 -0
- package/dist/testing/steps/mobile/gestures.step.d.ts.map +1 -0
- package/dist/testing/steps/mobile/gestures.step.js +85 -0
- package/dist/testing/steps/mobile/gestures.step.js.map +1 -0
- package/dist/testing/steps/mobile/index.d.ts +3 -0
- package/dist/testing/steps/mobile/index.d.ts.map +1 -0
- package/dist/testing/steps/mobile/index.js +14 -0
- package/dist/testing/steps/mobile/index.js.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.d.ts +2 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.d.ts.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.js +315 -0
- package/dist/testing/steps/mobile/mobile-steps.ios.spec.js.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.d.ts +2 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.d.ts.map +1 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.js +338 -0
- package/dist/testing/steps/mobile/mobile-steps.spec.js.map +1 -0
- package/dist/testing/steps/mobile/shared.d.ts +13 -0
- package/dist/testing/steps/mobile/shared.d.ts.map +1 -0
- package/dist/testing/steps/mobile/shared.js +41 -0
- package/dist/testing/steps/mobile/shared.js.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.d.ts +14 -0
- package/dist/testing/steps/mobile/swipe-line.d.ts.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.js +20 -0
- package/dist/testing/steps/mobile/swipe-line.js.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.spec.d.ts +2 -0
- package/dist/testing/steps/mobile/swipe-line.spec.d.ts.map +1 -0
- package/dist/testing/steps/mobile/swipe-line.spec.js +25 -0
- package/dist/testing/steps/mobile/swipe-line.spec.js.map +1 -0
- package/dist/testing/steps/ui/actions.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/actions.step.js +8 -5
- package/dist/testing/steps/ui/actions.step.js.map +1 -1
- package/dist/testing/steps/ui/aria-snapshot.step.d.ts +3 -0
- package/dist/testing/steps/ui/aria-snapshot.step.d.ts.map +1 -0
- package/dist/testing/steps/ui/aria-snapshot.step.js +70 -0
- package/dist/testing/steps/ui/aria-snapshot.step.js.map +1 -0
- package/dist/testing/steps/ui/assertions.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/assertions.step.js +5 -2
- package/dist/testing/steps/ui/assertions.step.js.map +1 -1
- package/dist/testing/steps/ui/form.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/form.step.js +7 -3
- package/dist/testing/steps/ui/form.step.js.map +1 -1
- package/dist/testing/steps/ui/index.d.ts.map +1 -1
- package/dist/testing/steps/ui/index.js +2 -0
- package/dist/testing/steps/ui/index.js.map +1 -1
- package/package.json +15 -5
- package/src/controllers/test-run.controller.ts +17 -1
- package/src/dtos/confirm-module-package-import.dto.ts +16 -0
- package/src/dtos/create-field-metadata.dto.ts +4 -3
- package/src/dtos/create-model-metadata.dto.ts +19 -13
- package/src/dtos/test-run-request.dto.ts +18 -0
- package/src/entities/media-migration-plan.md +20 -0
- package/src/helpers/module-package-sync.helper.spec.ts +253 -0
- package/src/helpers/module-package-sync.helper.ts +381 -0
- package/src/index.ts +3 -0
- package/src/jobs/database/test-run-queue-subscriber-database.service.ts +21 -5
- package/src/seeders/module-metadata-seeder.service.ts +154 -0
- package/src/seeders/seed-data/solid-core-metadata.json +0 -47
- package/src/services/module-package.service.spec.ts +398 -0
- package/src/services/module-package.service.ts +433 -37
- package/src/services/view-metadata.service.ts +6 -4
- package/src/testing/README.md +198 -1
- package/src/testing/__integration__/mobile-emulator.integration.ts +409 -0
- package/src/testing/adapters/mobile/capabilities.spec.ts +247 -0
- package/src/testing/adapters/mobile/capabilities.ts +108 -0
- package/src/testing/adapters/mobile/fake-driver.ts +133 -0
- package/src/testing/adapters/mobile/ios-keyboard.spec.ts +40 -0
- package/src/testing/adapters/mobile/ios-keyboard.ts +187 -0
- package/src/testing/adapters/mobile/locator.spec.ts +200 -0
- package/src/testing/adapters/mobile/locator.ts +118 -0
- package/src/testing/adapters/mobile/logcat.spec.ts +63 -0
- package/src/testing/adapters/mobile/logcat.ts +44 -0
- package/src/testing/adapters/mobile/mobile-adapter.ios.spec.ts +277 -0
- package/src/testing/adapters/mobile/mobile-adapter.spec.ts +632 -0
- package/src/testing/adapters/mobile/mobile-adapter.ts +599 -0
- package/src/testing/adapters/mobile/mobile.types.ts +177 -0
- package/src/testing/adapters/mobile/phone-errors.ts +59 -0
- package/src/testing/adapters/mobile/platform.ts +15 -0
- package/src/testing/adapters/mobile/resolve-mobile-target.spec.ts +227 -0
- package/src/testing/adapters/mobile/resolve-mobile-target.ts +104 -0
- package/src/testing/adapters/mobile/run-options.spec.ts +121 -0
- package/src/testing/adapters/mobile/run-options.ts +49 -0
- package/src/testing/adapters/mobile/syslog.spec.ts +108 -0
- package/src/testing/adapters/mobile/syslog.ts +57 -0
- package/src/testing/adapters/ui/playwright-adapter.ts +149 -22
- package/src/testing/adapters/ui/resolve-target.ts +121 -0
- package/src/testing/adapters/ui/ui.types.ts +23 -0
- package/src/testing/contracts/runtime-context.types.ts +24 -0
- package/src/testing/contracts/testing-metadata.types.ts +72 -1
- package/src/testing/core/step-registry.ts +4 -0
- package/src/testing/core/testing-engine.ts +148 -42
- package/src/testing/reporter/console-reporter.ts +22 -10
- package/src/testing/reporter/file-service-artifact-sink.ts +9 -3
- package/src/testing/reporter/lifecycle-events.types.ts +17 -0
- package/src/testing/reporter/lifecycle-webhook-reporter.spec.ts +77 -0
- package/src/testing/reporter/lifecycle-webhook-reporter.ts +31 -2
- package/src/testing/reporter/progress-reporter.ts +9 -10
- package/src/testing/reporter/reporter.types.ts +37 -9
- package/src/testing/runner/lifecycle.spec.ts +41 -0
- package/src/testing/runner/lifecycle.ts +95 -0
- package/src/testing/runner/mobile-session.spec.ts +106 -0
- package/src/testing/runner/mobile-session.ts +138 -0
- package/src/testing/runner/recording-reporter.ts +34 -0
- package/src/testing/runner/run-cancellation.ts +38 -0
- package/src/testing/runner/run-from-metadata.cancel.spec.ts +75 -0
- package/src/testing/runner/run-from-metadata.mobile.spec.ts +580 -0
- package/src/testing/runner/run-from-metadata.spec.ts +180 -2
- package/src/testing/runner/run-from-metadata.ts +215 -33
- package/src/testing/runner/scenario-graph.spec.ts +122 -0
- package/src/testing/runner/scenario-graph.ts +142 -0
- package/src/testing/runtime/default-registry.ts +19 -0
- package/src/testing/runtime/index.ts +79 -0
- package/src/testing/runtime/mobile-step-executor.spec.ts +177 -0
- package/src/testing/runtime/step-executor.spec.ts +156 -0
- package/src/testing/runtime/step-executor.ts +315 -0
- package/src/testing/steps/mobile/actions.step.ts +176 -0
- package/src/testing/steps/mobile/app.step.ts +23 -0
- package/src/testing/steps/mobile/assertions.step.ts +59 -0
- package/src/testing/steps/mobile/gestures.step.ts +102 -0
- package/src/testing/steps/mobile/index.ts +12 -0
- package/src/testing/steps/mobile/mobile-steps.ios.spec.ts +364 -0
- package/src/testing/steps/mobile/mobile-steps.spec.ts +415 -0
- package/src/testing/steps/mobile/shared.ts +48 -0
- package/src/testing/steps/mobile/swipe-line.spec.ts +27 -0
- package/src/testing/steps/mobile/swipe-line.ts +30 -0
- package/src/testing/steps/ui/actions.step.ts +11 -8
- package/src/testing/steps/ui/aria-snapshot.step.ts +101 -0
- package/src/testing/steps/ui/assertions.step.ts +7 -9
- package/src/testing/steps/ui/form.step.ts +10 -10
- package/src/testing/steps/ui/index.ts +2 -0
|
@@ -0,0 +1,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
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { MobileAdapterOptions } from "./mobile.types";
|
|
2
|
+
import { isIos } from "./platform";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Appium capabilities for a session (D8). Every session names its device (`udid`): Appium must never
|
|
6
|
+
* pick one itself, and `appium:avd` is never used because Test Hub boots emulators itself (D10).
|
|
7
|
+
*/
|
|
8
|
+
export function buildCapabilities(o: MobileAdapterOptions): Record<string, unknown> {
|
|
9
|
+
if (!o.udid) {
|
|
10
|
+
throw new Error("A device is required (udid): Appium must not pick a device itself");
|
|
11
|
+
}
|
|
12
|
+
if (!o.appPackage) {
|
|
13
|
+
throw new Error("appPackage is required for a mobile session");
|
|
14
|
+
}
|
|
15
|
+
return isIos(o) ? iosCapabilities(o) : androidCapabilities(o);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function androidCapabilities(o: MobileAdapterOptions): Record<string, unknown> {
|
|
19
|
+
const caps: Record<string, unknown> = {
|
|
20
|
+
platformName: "Android",
|
|
21
|
+
"appium:automationName": "UiAutomator2",
|
|
22
|
+
"appium:udid": o.udid,
|
|
23
|
+
"appium:newCommandTimeout": 120,
|
|
24
|
+
"appium:autoGrantPermissions": true,
|
|
25
|
+
// UiAutomator2 waits up to 10 s for the UI to go idle before every lookup, and keyboards, autofill and animations
|
|
26
|
+
// keep some screens busy for all of it. 500 ms still lets the app apply a tap before the next one (0 let a tap
|
|
27
|
+
// land before the previous one had taken effect), and our own polling does the real waiting.
|
|
28
|
+
"appium:settings[waitForIdleTimeout]": 500,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (o.appSource === "upload") {
|
|
32
|
+
if (!o.appPath) {
|
|
33
|
+
throw new Error('appPath is required when appSource is "upload"');
|
|
34
|
+
}
|
|
35
|
+
// Appium installs the APK if needed and clears the app's data at session start.
|
|
36
|
+
caps["appium:app"] = o.appPath;
|
|
37
|
+
} else if (o.appSource === "installed") {
|
|
38
|
+
if (!o.appActivity) {
|
|
39
|
+
throw new Error('appActivity is required when appSource is "installed"');
|
|
40
|
+
}
|
|
41
|
+
caps["appium:appPackage"] = o.appPackage;
|
|
42
|
+
caps["appium:appActivity"] = o.appActivity;
|
|
43
|
+
// Keep the app's data, but restart it so the session starts on its home screen, not on
|
|
44
|
+
// whatever screen the previous session left it on.
|
|
45
|
+
caps["appium:noReset"] = true;
|
|
46
|
+
caps["appium:forceAppLaunch"] = true;
|
|
47
|
+
caps["appium:shouldTerminateApp"] = true;
|
|
48
|
+
} else {
|
|
49
|
+
throw new Error(`appSource must be "upload" or "installed", got "${String(o.appSource)}"`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return { ...caps, ...(o.extraCapabilities ?? {}) };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The class chain of the buttons that allow a permission prompt on a phone (D44). "Allow Once" is left out on purpose: it is
|
|
57
|
+
* listed before "Allow While Using App" on the location prompt, and its grant would not last. English labels only.
|
|
58
|
+
*/
|
|
59
|
+
export const IOS_ALLOW_BUTTON_SELECTOR = '**/XCUIElementTypeButton[`label IN {"Allow While Using App", "Allow", "OK"}`]';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* XCUITest session. `autoAcceptAlerts` handles the app's own alerts, but it denies permission prompts, so permissions are
|
|
63
|
+
* granted another way (D28). WebDriverAgent is built once into `wdaDerivedDataPath` and reused (D34).
|
|
64
|
+
*/
|
|
65
|
+
function iosCapabilities(o: MobileAdapterOptions): Record<string, unknown> {
|
|
66
|
+
const caps: Record<string, unknown> = {
|
|
67
|
+
platformName: "iOS",
|
|
68
|
+
"appium:automationName": "XCUITest",
|
|
69
|
+
"appium:udid": o.udid,
|
|
70
|
+
"appium:newCommandTimeout": 120,
|
|
71
|
+
"appium:autoAcceptAlerts": true,
|
|
72
|
+
// The first session builds WebDriverAgent, which took 4.5 minutes on a small Mac; later ones reuse it (D34).
|
|
73
|
+
"appium:wdaLaunchTimeout": o.wdaPrebuilt ? 240_000 : 480_000,
|
|
74
|
+
};
|
|
75
|
+
if (o.wdaDerivedDataPath) {
|
|
76
|
+
caps["appium:derivedDataPath"] = o.wdaDerivedDataPath;
|
|
77
|
+
caps["appium:usePrebuiltWDA"] = !!o.wdaPrebuilt;
|
|
78
|
+
}
|
|
79
|
+
// A phone only runs apps that are signed for it, and WebDriverAgent is one (D42). The team comes from the Mac's certificate.
|
|
80
|
+
if (o.wdaSigning) {
|
|
81
|
+
caps["appium:xcodeOrgId"] = o.wdaSigning.teamId;
|
|
82
|
+
caps["appium:xcodeSigningId"] = o.wdaSigning.signingId ?? "Apple Development";
|
|
83
|
+
caps["appium:updatedWDABundleId"] = o.wdaSigning.wdaBundleId ?? `io.solidx.wda.${o.wdaSigning.teamId.toLowerCase()}`;
|
|
84
|
+
caps["appium:allowProvisioningDeviceRegistration"] = true;
|
|
85
|
+
}
|
|
86
|
+
if (!o.simulator) {
|
|
87
|
+
// A WebDriverAgent setting, not a capability: as "appium:acceptAlertButtonSelector" the driver ignores it, and
|
|
88
|
+
// WebDriverAgent's default rule then taps "Don't Allow" on a location prompt (spikes/mobile-ios/FINDINGS-ios-device.md).
|
|
89
|
+
caps["appium:settings[acceptAlertButtonSelector]"] = IOS_ALLOW_BUTTON_SELECTOR;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (o.appSource === "upload") {
|
|
93
|
+
if (!o.appPath) {
|
|
94
|
+
throw new Error('appPath is required when appSource is "upload"');
|
|
95
|
+
}
|
|
96
|
+
// Appium installs the .app folder.
|
|
97
|
+
caps["appium:app"] = o.appPath;
|
|
98
|
+
} else if (o.appSource === "installed") {
|
|
99
|
+
caps["appium:bundleId"] = o.appPackage;
|
|
100
|
+
caps["appium:noReset"] = true;
|
|
101
|
+
caps["appium:forceAppLaunch"] = true;
|
|
102
|
+
caps["appium:shouldTerminateApp"] = true;
|
|
103
|
+
} else {
|
|
104
|
+
throw new Error(`appSource must be "upload" or "installed", got "${String(o.appSource)}"`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return { ...caps, ...(o.extraCapabilities ?? {}) };
|
|
108
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Test helper: an in-memory stand-in for the WebdriverIO driver, so mobile adapter and step tests
|
|
2
|
+
// run without Appium or a device. Not used at runtime.
|
|
3
|
+
import type { MobileClock, MobileDriver, MobileElement } from "./mobile.types";
|
|
4
|
+
|
|
5
|
+
export class FakeElement implements MobileElement {
|
|
6
|
+
calls: string[] = [];
|
|
7
|
+
displayed: boolean;
|
|
8
|
+
text: string;
|
|
9
|
+
location: { x: number; y: number };
|
|
10
|
+
size: { width: number; height: number };
|
|
11
|
+
|
|
12
|
+
constructor(opts: { displayed?: boolean; text?: string; location?: { x: number; y: number }; size?: { width: number; height: number } } = {}) {
|
|
13
|
+
this.displayed = opts.displayed ?? true;
|
|
14
|
+
this.text = opts.text ?? "";
|
|
15
|
+
this.location = opts.location ?? { x: 100, y: 200 };
|
|
16
|
+
this.size = opts.size ?? { width: 300, height: 400 };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async click() { this.calls.push("click"); }
|
|
20
|
+
async setValue(value: string) { this.calls.push(`setValue:${value}`); this.text = value; }
|
|
21
|
+
async addValue(value: string) { this.calls.push(`addValue:${value}`); this.text += value; }
|
|
22
|
+
async clearValue() { this.calls.push("clearValue"); this.text = ""; }
|
|
23
|
+
async getText() { this.calls.push("getText"); return this.text; }
|
|
24
|
+
/** How many times the display state was read; a poll should read it once, not once per helper. */
|
|
25
|
+
displayChecks = 0;
|
|
26
|
+
/** Real milliseconds a display check takes, to stand in for a stalled device. */
|
|
27
|
+
isDisplayedDelayMs = 0;
|
|
28
|
+
async isDisplayed() {
|
|
29
|
+
this.displayChecks += 1;
|
|
30
|
+
if (this.isDisplayedDelayMs) await new Promise((resolve) => setTimeout(resolve, this.isDisplayedDelayMs));
|
|
31
|
+
return this.displayed;
|
|
32
|
+
}
|
|
33
|
+
async getLocation() { return this.location; }
|
|
34
|
+
async getSize() { return this.size; }
|
|
35
|
+
async waitForDisplayed(opts?: { timeout?: number; timeoutMsg?: string }) {
|
|
36
|
+
this.calls.push(`waitForDisplayed:${opts?.timeout ?? ""}`);
|
|
37
|
+
if (!this.displayed) throw new Error(opts?.timeoutMsg ?? "element not displayed");
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class FakeDriver implements MobileDriver {
|
|
43
|
+
/** Elements by WebdriverIO selector string. */
|
|
44
|
+
elements = new Map<string, FakeElement[]>();
|
|
45
|
+
calls: Array<{ method: string; args: unknown[] }> = [];
|
|
46
|
+
logs: Array<{ level?: string; message?: string }> = [];
|
|
47
|
+
screenshotBase64 = Buffer.from("png-bytes").toString("base64");
|
|
48
|
+
recordingBase64 = Buffer.from("mp4-bytes").toString("base64");
|
|
49
|
+
appState = 4;
|
|
50
|
+
/** What `getPageSource` returns. */
|
|
51
|
+
pageSource = "<hierarchy rotation=\"0\"></hierarchy>";
|
|
52
|
+
/** States returned by `mobile: queryAppState`, one per call, before `appState` takes over. */
|
|
53
|
+
appStates: number[] = [];
|
|
54
|
+
keyboardShown = false;
|
|
55
|
+
/** Where the keyboard is while it is shown; without it, a keyboard has no frame to look up. */
|
|
56
|
+
keyboardRect?: { x: number; y: number; width: number; height: number };
|
|
57
|
+
/** Which ways of hiding the keyboard work. Unset: the driver's own call does, as before. */
|
|
58
|
+
hideWith?: Set<"driver" | "tapOutside" | "swipeDown">;
|
|
59
|
+
windowSize = { width: 1080, height: 2400 };
|
|
60
|
+
/** Methods listed here throw when called. */
|
|
61
|
+
failing = new Set<string>();
|
|
62
|
+
/** The message a failing method throws, when it is not the default. */
|
|
63
|
+
failureMessages = new Map<string, string>();
|
|
64
|
+
/** `execute` scripts listed here throw when called, for example "mobile: removeApp". */
|
|
65
|
+
failingScripts = new Set<string>();
|
|
66
|
+
|
|
67
|
+
add(selector: string, ...elements: FakeElement[]): FakeElement[] {
|
|
68
|
+
this.elements.set(selector, [...(this.elements.get(selector) ?? []), ...elements]);
|
|
69
|
+
return elements;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
callsTo(method: string) {
|
|
73
|
+
return this.calls.filter((call) => call.method === method);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private record(method: string, args: unknown[]) {
|
|
77
|
+
this.calls.push({ method, args });
|
|
78
|
+
if (this.failing.has(method)) throw new Error(this.failureMessages.get(method) ?? `${method} failed`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async $(selector: string) {
|
|
82
|
+
this.record("$", [selector]);
|
|
83
|
+
return this.elements.get(selector)?.[0] ?? new FakeElement({ displayed: false });
|
|
84
|
+
}
|
|
85
|
+
/** Real milliseconds a lookup takes, from a number or per selector, to stand in for a stalled device. */
|
|
86
|
+
lookupDelayMs: number | ((selector: string) => number) = 0;
|
|
87
|
+
async $$(selector: string) {
|
|
88
|
+
this.record("$$", [selector]);
|
|
89
|
+
const delay = typeof this.lookupDelayMs === "function" ? this.lookupDelayMs(selector) : this.lookupDelayMs;
|
|
90
|
+
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
|
|
91
|
+
if (selector === "-ios class chain:**/XCUIElementTypeKeyboard" && this.keyboardRect && this.keyboardShown) {
|
|
92
|
+
const { x, y, width, height } = this.keyboardRect;
|
|
93
|
+
return [new FakeElement({ location: { x, y }, size: { width, height } })];
|
|
94
|
+
}
|
|
95
|
+
return [...(this.elements.get(selector) ?? [])];
|
|
96
|
+
}
|
|
97
|
+
// No real waiting: poll the condition a few times, then fail with the supplied message.
|
|
98
|
+
async waitUntil(condition: () => Promise<boolean>, opts?: { timeoutMsg?: string }) {
|
|
99
|
+
this.record("waitUntil", [opts]);
|
|
100
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
101
|
+
if (await condition()) return true;
|
|
102
|
+
}
|
|
103
|
+
throw new Error(opts?.timeoutMsg ?? "waitUntil timed out");
|
|
104
|
+
}
|
|
105
|
+
async execute(script: string, ...args: unknown[]) {
|
|
106
|
+
this.record("execute", [script, ...args]);
|
|
107
|
+
if (this.failingScripts.has(script)) throw new Error(`${script} failed`);
|
|
108
|
+
if (script === "mobile: tap" && this.hideWith?.has("tapOutside")) this.keyboardShown = false;
|
|
109
|
+
if (script === "mobile: dragFromToForDuration" && this.hideWith?.has("swipeDown")) this.keyboardShown = false;
|
|
110
|
+
return script === "mobile: queryAppState" ? (this.appStates.length ? this.appStates.shift() : this.appState) : undefined;
|
|
111
|
+
}
|
|
112
|
+
async back() { this.record("back", []); }
|
|
113
|
+
async isKeyboardShown() { this.record("isKeyboardShown", []); return this.keyboardShown; }
|
|
114
|
+
async hideKeyboard() { this.record("hideKeyboard", []); if (!this.hideWith || this.hideWith.has("driver")) this.keyboardShown = false; }
|
|
115
|
+
async getWindowSize() { this.record("getWindowSize", []); return this.windowSize; }
|
|
116
|
+
async takeScreenshot() { this.record("takeScreenshot", []); return this.screenshotBase64; }
|
|
117
|
+
async getPageSource() { this.record("getPageSource", []); return this.pageSource; }
|
|
118
|
+
async getLogs(type: string) { this.record("getLogs", [type]); const out = this.logs; this.logs = []; return out; }
|
|
119
|
+
async startRecordingScreen(opts?: Record<string, unknown>) { this.record("startRecordingScreen", [opts]); }
|
|
120
|
+
async stopRecordingScreen() { this.record("stopRecordingScreen", []); return this.recordingBase64; }
|
|
121
|
+
async deleteSession() { this.record("deleteSession", []); }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** A clock that moves only when the adapter sleeps, so polling for a missing element takes no real time. */
|
|
125
|
+
export class FakeClock implements MobileClock {
|
|
126
|
+
sleeps: number[] = [];
|
|
127
|
+
private current = 0;
|
|
128
|
+
now() { return this.current; }
|
|
129
|
+
async sleep(ms: number) {
|
|
130
|
+
this.sleeps.push(ms);
|
|
131
|
+
this.current += ms;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { neutralPoint } from "./ios-keyboard";
|
|
2
|
+
|
|
3
|
+
const WINDOW = { width: 400, height: 800 };
|
|
4
|
+
const control = (type: string, x: number, y: number, w: number, h: number, extra = "") =>
|
|
5
|
+
`<XCUIElementType${type} ${extra} x="${x}" y="${y}" width="${w}" height="${h}"/>`;
|
|
6
|
+
|
|
7
|
+
describe("neutralPoint", () => {
|
|
8
|
+
it("returns a point above the keyboard that is on no control", () => {
|
|
9
|
+
const source = [
|
|
10
|
+
control("Button", 0, 50, 100, 40, 'name="Back"'),
|
|
11
|
+
control("TextField", 20, 200, 360, 40),
|
|
12
|
+
control("Button", 20, 440, 360, 60),
|
|
13
|
+
].join("\n");
|
|
14
|
+
const point = neutralPoint(source, 500, WINDOW)!;
|
|
15
|
+
expect(point).toBeDefined();
|
|
16
|
+
expect(point.y).toBeLessThanOrEqual(500 - 16);
|
|
17
|
+
for (const [x, y, w, h] of [[0, 50, 100, 40], [20, 200, 360, 40], [20, 440, 360, 60]]) {
|
|
18
|
+
expect(point.x >= x && point.x <= x + w && point.y >= y && point.y <= y + h).toBe(false);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("reads attributes in any order", () => {
|
|
23
|
+
const source = '<XCUIElementTypeButton width="400" height="800" y="0" x="0" name="Everything"/>';
|
|
24
|
+
expect(neutralPoint(source, 500, WINDOW)).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("treats an accessible view as a control, and a plain one as free", () => {
|
|
28
|
+
const touchable = control("Other", 0, 0, 400, 800, 'accessible="true"');
|
|
29
|
+
expect(neutralPoint(touchable, 500, WINDOW)).toBeUndefined();
|
|
30
|
+
expect(neutralPoint(control("Other", 0, 0, 400, 800, 'accessible="false"'), 500, WINDOW)).toBeDefined();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("is undefined when every control covers the area", () => {
|
|
34
|
+
expect(neutralPoint(control("Cell", 0, 0, 400, 800), 500, WINDOW)).toBeUndefined();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("stays below the status bar", () => {
|
|
38
|
+
expect(neutralPoint("", 500, WINDOW)!.y).toBeGreaterThanOrEqual(60);
|
|
39
|
+
});
|
|
40
|
+
});
|