@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,4 @@
|
|
|
1
|
+
import type { MobileAdapterOptions } from "./mobile.types";
|
|
2
|
+
export declare function buildCapabilities(o: MobileAdapterOptions): Record<string, unknown>;
|
|
3
|
+
export declare const IOS_ALLOW_BUTTON_SELECTOR = "**/XCUIElementTypeButton[`label IN {\"Allow While Using App\", \"Allow\", \"OK\"}`]";
|
|
4
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/testing/adapters/mobile/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAO3D,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQlF;AA2CD,eAAO,MAAM,yBAAyB,wFAAkF,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IOS_ALLOW_BUTTON_SELECTOR = void 0;
|
|
4
|
+
exports.buildCapabilities = buildCapabilities;
|
|
5
|
+
const platform_1 = require("./platform");
|
|
6
|
+
function buildCapabilities(o) {
|
|
7
|
+
if (!o.udid) {
|
|
8
|
+
throw new Error("A device is required (udid): Appium must not pick a device itself");
|
|
9
|
+
}
|
|
10
|
+
if (!o.appPackage) {
|
|
11
|
+
throw new Error("appPackage is required for a mobile session");
|
|
12
|
+
}
|
|
13
|
+
return (0, platform_1.isIos)(o) ? iosCapabilities(o) : androidCapabilities(o);
|
|
14
|
+
}
|
|
15
|
+
function androidCapabilities(o) {
|
|
16
|
+
const caps = {
|
|
17
|
+
platformName: "Android",
|
|
18
|
+
"appium:automationName": "UiAutomator2",
|
|
19
|
+
"appium:udid": o.udid,
|
|
20
|
+
"appium:newCommandTimeout": 120,
|
|
21
|
+
"appium:autoGrantPermissions": true,
|
|
22
|
+
"appium:settings[waitForIdleTimeout]": 500,
|
|
23
|
+
};
|
|
24
|
+
if (o.appSource === "upload") {
|
|
25
|
+
if (!o.appPath) {
|
|
26
|
+
throw new Error('appPath is required when appSource is "upload"');
|
|
27
|
+
}
|
|
28
|
+
caps["appium:app"] = o.appPath;
|
|
29
|
+
}
|
|
30
|
+
else if (o.appSource === "installed") {
|
|
31
|
+
if (!o.appActivity) {
|
|
32
|
+
throw new Error('appActivity is required when appSource is "installed"');
|
|
33
|
+
}
|
|
34
|
+
caps["appium:appPackage"] = o.appPackage;
|
|
35
|
+
caps["appium:appActivity"] = o.appActivity;
|
|
36
|
+
caps["appium:noReset"] = true;
|
|
37
|
+
caps["appium:forceAppLaunch"] = true;
|
|
38
|
+
caps["appium:shouldTerminateApp"] = true;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
throw new Error(`appSource must be "upload" or "installed", got "${String(o.appSource)}"`);
|
|
42
|
+
}
|
|
43
|
+
return { ...caps, ...(o.extraCapabilities ?? {}) };
|
|
44
|
+
}
|
|
45
|
+
exports.IOS_ALLOW_BUTTON_SELECTOR = '**/XCUIElementTypeButton[`label IN {"Allow While Using App", "Allow", "OK"}`]';
|
|
46
|
+
function iosCapabilities(o) {
|
|
47
|
+
const caps = {
|
|
48
|
+
platformName: "iOS",
|
|
49
|
+
"appium:automationName": "XCUITest",
|
|
50
|
+
"appium:udid": o.udid,
|
|
51
|
+
"appium:newCommandTimeout": 120,
|
|
52
|
+
"appium:autoAcceptAlerts": true,
|
|
53
|
+
"appium:wdaLaunchTimeout": o.wdaPrebuilt ? 240_000 : 480_000,
|
|
54
|
+
};
|
|
55
|
+
if (o.wdaDerivedDataPath) {
|
|
56
|
+
caps["appium:derivedDataPath"] = o.wdaDerivedDataPath;
|
|
57
|
+
caps["appium:usePrebuiltWDA"] = !!o.wdaPrebuilt;
|
|
58
|
+
}
|
|
59
|
+
if (o.wdaSigning) {
|
|
60
|
+
caps["appium:xcodeOrgId"] = o.wdaSigning.teamId;
|
|
61
|
+
caps["appium:xcodeSigningId"] = o.wdaSigning.signingId ?? "Apple Development";
|
|
62
|
+
caps["appium:updatedWDABundleId"] = o.wdaSigning.wdaBundleId ?? `io.solidx.wda.${o.wdaSigning.teamId.toLowerCase()}`;
|
|
63
|
+
caps["appium:allowProvisioningDeviceRegistration"] = true;
|
|
64
|
+
}
|
|
65
|
+
if (!o.simulator) {
|
|
66
|
+
caps["appium:settings[acceptAlertButtonSelector]"] = exports.IOS_ALLOW_BUTTON_SELECTOR;
|
|
67
|
+
}
|
|
68
|
+
if (o.appSource === "upload") {
|
|
69
|
+
if (!o.appPath) {
|
|
70
|
+
throw new Error('appPath is required when appSource is "upload"');
|
|
71
|
+
}
|
|
72
|
+
caps["appium:app"] = o.appPath;
|
|
73
|
+
}
|
|
74
|
+
else if (o.appSource === "installed") {
|
|
75
|
+
caps["appium:bundleId"] = o.appPackage;
|
|
76
|
+
caps["appium:noReset"] = true;
|
|
77
|
+
caps["appium:forceAppLaunch"] = true;
|
|
78
|
+
caps["appium:shouldTerminateApp"] = true;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
throw new Error(`appSource must be "upload" or "installed", got "${String(o.appSource)}"`);
|
|
82
|
+
}
|
|
83
|
+
return { ...caps, ...(o.extraCapabilities ?? {}) };
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../../src/testing/adapters/mobile/capabilities.ts"],"names":[],"mappings":";;;AAOA,8CAQC;AAdD,yCAAmC;AAMnC,SAAgB,iBAAiB,CAAC,CAAuB;IACvD,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,mEA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4C,CAAC,GAAG,iCAAyB,CAAC;IACjF,CAAC;IAED,IAAI,CAAC,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;IACjC,CAAC;SAAM,IAAI,CAAC,CAAC,SAAS,KAAK,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC;QACrC,IAAI,CAAC,2BAA2B,CAAC,GAAG,IAAI,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,mDAAmD,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import type { MobileAdapterOptions } from \"./mobile.types\";\nimport { isIos } from \"./platform\";\n\n/**\n * Appium capabilities for a session (D8). Every session names its device (`udid`): Appium must never\n * pick one itself, and `appium:avd` is never used because Test Hub boots emulators itself (D10).\n */\nexport function buildCapabilities(o: MobileAdapterOptions): Record<string, unknown> {\n if (!o.udid) {\n throw new Error(\"A device is required (udid): Appium must not pick a device itself\");\n }\n if (!o.appPackage) {\n throw new Error(\"appPackage is required for a mobile session\");\n }\n return isIos(o) ? iosCapabilities(o) : androidCapabilities(o);\n}\n\nfunction androidCapabilities(o: MobileAdapterOptions): Record<string, unknown> {\n const caps: Record<string, unknown> = {\n platformName: \"Android\",\n \"appium:automationName\": \"UiAutomator2\",\n \"appium:udid\": o.udid,\n \"appium:newCommandTimeout\": 120,\n \"appium:autoGrantPermissions\": true,\n // UiAutomator2 waits up to 10 s for the UI to go idle before every lookup, and keyboards, autofill and animations\n // 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\n // land before the previous one had taken effect), and our own polling does the real waiting.\n \"appium:settings[waitForIdleTimeout]\": 500,\n };\n\n if (o.appSource === \"upload\") {\n if (!o.appPath) {\n throw new Error('appPath is required when appSource is \"upload\"');\n }\n // Appium installs the APK if needed and clears the app's data at session start.\n caps[\"appium:app\"] = o.appPath;\n } else if (o.appSource === \"installed\") {\n if (!o.appActivity) {\n throw new Error('appActivity is required when appSource is \"installed\"');\n }\n caps[\"appium:appPackage\"] = o.appPackage;\n caps[\"appium:appActivity\"] = o.appActivity;\n // Keep the app's data, but restart it so the session starts on its home screen, not on\n // whatever screen the previous session left it on.\n caps[\"appium:noReset\"] = true;\n caps[\"appium:forceAppLaunch\"] = true;\n caps[\"appium:shouldTerminateApp\"] = true;\n } else {\n throw new Error(`appSource must be \"upload\" or \"installed\", got \"${String(o.appSource)}\"`);\n }\n\n return { ...caps, ...(o.extraCapabilities ?? {}) };\n}\n\n/**\n * The class chain of the buttons that allow a permission prompt on a phone (D44). \"Allow Once\" is left out on purpose: it is\n * listed before \"Allow While Using App\" on the location prompt, and its grant would not last. English labels only.\n */\nexport const IOS_ALLOW_BUTTON_SELECTOR = '**/XCUIElementTypeButton[`label IN {\"Allow While Using App\", \"Allow\", \"OK\"}`]';\n\n/**\n * XCUITest session. `autoAcceptAlerts` handles the app's own alerts, but it denies permission prompts, so permissions are\n * granted another way (D28). WebDriverAgent is built once into `wdaDerivedDataPath` and reused (D34).\n */\nfunction iosCapabilities(o: MobileAdapterOptions): Record<string, unknown> {\n const caps: Record<string, unknown> = {\n platformName: \"iOS\",\n \"appium:automationName\": \"XCUITest\",\n \"appium:udid\": o.udid,\n \"appium:newCommandTimeout\": 120,\n \"appium:autoAcceptAlerts\": true,\n // The first session builds WebDriverAgent, which took 4.5 minutes on a small Mac; later ones reuse it (D34).\n \"appium:wdaLaunchTimeout\": o.wdaPrebuilt ? 240_000 : 480_000,\n };\n if (o.wdaDerivedDataPath) {\n caps[\"appium:derivedDataPath\"] = o.wdaDerivedDataPath;\n caps[\"appium:usePrebuiltWDA\"] = !!o.wdaPrebuilt;\n }\n // A phone only runs apps that are signed for it, and WebDriverAgent is one (D42). The team comes from the Mac's certificate.\n if (o.wdaSigning) {\n caps[\"appium:xcodeOrgId\"] = o.wdaSigning.teamId;\n caps[\"appium:xcodeSigningId\"] = o.wdaSigning.signingId ?? \"Apple Development\";\n caps[\"appium:updatedWDABundleId\"] = o.wdaSigning.wdaBundleId ?? `io.solidx.wda.${o.wdaSigning.teamId.toLowerCase()}`;\n caps[\"appium:allowProvisioningDeviceRegistration\"] = true;\n }\n if (!o.simulator) {\n // A WebDriverAgent setting, not a capability: as \"appium:acceptAlertButtonSelector\" the driver ignores it, and\n // WebDriverAgent's default rule then taps \"Don't Allow\" on a location prompt (spikes/mobile-ios/FINDINGS-ios-device.md).\n caps[\"appium:settings[acceptAlertButtonSelector]\"] = IOS_ALLOW_BUTTON_SELECTOR;\n }\n\n if (o.appSource === \"upload\") {\n if (!o.appPath) {\n throw new Error('appPath is required when appSource is \"upload\"');\n }\n // Appium installs the .app folder.\n caps[\"appium:app\"] = o.appPath;\n } else if (o.appSource === \"installed\") {\n caps[\"appium:bundleId\"] = o.appPackage;\n caps[\"appium:noReset\"] = true;\n caps[\"appium:forceAppLaunch\"] = true;\n caps[\"appium:shouldTerminateApp\"] = true;\n } else {\n throw new Error(`appSource must be \"upload\" or \"installed\", got \"${String(o.appSource)}\"`);\n }\n\n return { ...caps, ...(o.extraCapabilities ?? {}) };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.spec.d.ts","sourceRoot":"","sources":["../../../../src/testing/adapters/mobile/capabilities.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const capabilities_1 = require("./capabilities");
|
|
4
|
+
const base = {
|
|
5
|
+
appiumUrl: "http://localhost:4723",
|
|
6
|
+
udid: "emulator-5554",
|
|
7
|
+
appSource: "installed",
|
|
8
|
+
appPackage: "com.acme.app",
|
|
9
|
+
appActivity: ".MainActivity",
|
|
10
|
+
};
|
|
11
|
+
describe("buildCapabilities", () => {
|
|
12
|
+
it("sets the base capabilities for every session", () => {
|
|
13
|
+
const caps = (0, capabilities_1.buildCapabilities)(base);
|
|
14
|
+
expect(caps).toMatchObject({
|
|
15
|
+
platformName: "Android",
|
|
16
|
+
"appium:automationName": "UiAutomator2",
|
|
17
|
+
"appium:udid": "emulator-5554",
|
|
18
|
+
"appium:newCommandTimeout": 120,
|
|
19
|
+
"appium:autoGrantPermissions": true,
|
|
20
|
+
"appium:settings[waitForIdleTimeout]": 500,
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
it("lets extra capabilities change the idle wait, for a device that needs another value", () => {
|
|
24
|
+
const caps = (0, capabilities_1.buildCapabilities)({ ...base, extraCapabilities: { "appium:settings[waitForIdleTimeout]": 0 } });
|
|
25
|
+
expect(caps["appium:settings[waitForIdleTimeout]"]).toBe(0);
|
|
26
|
+
});
|
|
27
|
+
it("installed: opens the app by id, keeps its data and restarts it", () => {
|
|
28
|
+
const caps = (0, capabilities_1.buildCapabilities)(base);
|
|
29
|
+
expect(caps).toMatchObject({
|
|
30
|
+
"appium:appPackage": "com.acme.app",
|
|
31
|
+
"appium:appActivity": ".MainActivity",
|
|
32
|
+
"appium:noReset": true,
|
|
33
|
+
"appium:forceAppLaunch": true,
|
|
34
|
+
"appium:shouldTerminateApp": true,
|
|
35
|
+
});
|
|
36
|
+
expect(caps).not.toHaveProperty("appium:app");
|
|
37
|
+
});
|
|
38
|
+
it("upload: passes the APK and leaves noReset unset", () => {
|
|
39
|
+
const caps = (0, capabilities_1.buildCapabilities)({ ...base, appSource: "upload", appPath: "/tmp/app.apk", appActivity: undefined });
|
|
40
|
+
expect(caps["appium:app"]).toBe("/tmp/app.apk");
|
|
41
|
+
expect(caps).not.toHaveProperty("appium:noReset");
|
|
42
|
+
expect(caps).not.toHaveProperty("appium:appActivity");
|
|
43
|
+
});
|
|
44
|
+
it("merges extra capabilities last, so they can override", () => {
|
|
45
|
+
const caps = (0, capabilities_1.buildCapabilities)({
|
|
46
|
+
...base,
|
|
47
|
+
extraCapabilities: { "appium:newCommandTimeout": 300, "appium:language": "en" },
|
|
48
|
+
});
|
|
49
|
+
expect(caps["appium:newCommandTimeout"]).toBe(300);
|
|
50
|
+
expect(caps["appium:language"]).toBe("en");
|
|
51
|
+
});
|
|
52
|
+
it("never asks Appium to boot an emulator", () => {
|
|
53
|
+
expect((0, capabilities_1.buildCapabilities)(base)).not.toHaveProperty("appium:avd");
|
|
54
|
+
expect((0, capabilities_1.buildCapabilities)({ ...base, extraCapabilities: {} })).not.toHaveProperty("appium:avdArgs");
|
|
55
|
+
});
|
|
56
|
+
it("requires a device", () => {
|
|
57
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...base, udid: "" })).toThrow("A device is required (udid)");
|
|
58
|
+
});
|
|
59
|
+
it("requires appPackage", () => {
|
|
60
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...base, appPackage: "" })).toThrow("appPackage is required");
|
|
61
|
+
});
|
|
62
|
+
it('requires appPath for "upload"', () => {
|
|
63
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...base, appSource: "upload" })).toThrow('appPath is required when appSource is "upload"');
|
|
64
|
+
});
|
|
65
|
+
it('requires appActivity for "installed"', () => {
|
|
66
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...base, appActivity: undefined })).toThrow('appActivity is required when appSource is "installed"');
|
|
67
|
+
});
|
|
68
|
+
it("rejects an unknown app source", () => {
|
|
69
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...base, appSource: "store" })).toThrow('appSource must be "upload" or "installed"');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe("buildCapabilities: iOS", () => {
|
|
73
|
+
const ios = {
|
|
74
|
+
appiumUrl: "http://localhost:4723",
|
|
75
|
+
udid: "1674E718-0EBA-4568-9644-F18E0DDF7705",
|
|
76
|
+
platformName: "iOS",
|
|
77
|
+
appSource: "installed",
|
|
78
|
+
appPackage: "io.solidx.testhub.sample",
|
|
79
|
+
};
|
|
80
|
+
it("uses XCUITest and the simulator's UDID", () => {
|
|
81
|
+
expect((0, capabilities_1.buildCapabilities)(ios)).toMatchObject({
|
|
82
|
+
platformName: "iOS",
|
|
83
|
+
"appium:automationName": "XCUITest",
|
|
84
|
+
"appium:udid": "1674E718-0EBA-4568-9644-F18E0DDF7705",
|
|
85
|
+
"appium:newCommandTimeout": 120,
|
|
86
|
+
"appium:autoAcceptAlerts": true,
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
it("has no Android-only keys and never an avd", () => {
|
|
90
|
+
const caps = (0, capabilities_1.buildCapabilities)(ios);
|
|
91
|
+
for (const key of ["appium:avd", "appium:appPackage", "appium:appActivity", "appium:autoGrantPermissions"]) {
|
|
92
|
+
expect(caps).not.toHaveProperty(key);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
it("installed: opens the app by bundle id, keeps its data and restarts it, without needing an activity", () => {
|
|
96
|
+
const caps = (0, capabilities_1.buildCapabilities)(ios);
|
|
97
|
+
expect(caps).toMatchObject({
|
|
98
|
+
"appium:bundleId": "io.solidx.testhub.sample",
|
|
99
|
+
"appium:noReset": true,
|
|
100
|
+
"appium:forceAppLaunch": true,
|
|
101
|
+
"appium:shouldTerminateApp": true,
|
|
102
|
+
});
|
|
103
|
+
expect(caps).not.toHaveProperty("appium:app");
|
|
104
|
+
});
|
|
105
|
+
it("installed with a build: the build is kept for a reset, not installed at session start", () => {
|
|
106
|
+
const caps = (0, capabilities_1.buildCapabilities)({ ...ios, appPath: "/builds/Sample.app" });
|
|
107
|
+
expect(caps).not.toHaveProperty("appium:app");
|
|
108
|
+
});
|
|
109
|
+
it("upload: passes the .app and needs a path", () => {
|
|
110
|
+
expect((0, capabilities_1.buildCapabilities)({ ...ios, appSource: "upload", appPath: "/builds/Sample.app" })["appium:app"]).toBe("/builds/Sample.app");
|
|
111
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...ios, appSource: "upload" })).toThrow('appPath is required when appSource is "upload"');
|
|
112
|
+
});
|
|
113
|
+
it("adds the WebDriverAgent cache only when a folder is given", () => {
|
|
114
|
+
expect((0, capabilities_1.buildCapabilities)(ios)).not.toHaveProperty("appium:derivedDataPath");
|
|
115
|
+
expect((0, capabilities_1.buildCapabilities)({ ...ios, wdaDerivedDataPath: "/w/xcode-27.0" })).toMatchObject({
|
|
116
|
+
"appium:derivedDataPath": "/w/xcode-27.0",
|
|
117
|
+
"appium:usePrebuiltWDA": false,
|
|
118
|
+
});
|
|
119
|
+
expect((0, capabilities_1.buildCapabilities)({ ...ios, wdaDerivedDataPath: "/w/xcode-27.0", wdaPrebuilt: true })).toMatchObject({
|
|
120
|
+
"appium:usePrebuiltWDA": true,
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
it("lets extra capabilities override, for example to leave alerts alone", () => {
|
|
124
|
+
expect((0, capabilities_1.buildCapabilities)({ ...ios, extraCapabilities: { "appium:autoAcceptAlerts": false } })).toMatchObject({
|
|
125
|
+
"appium:autoAcceptAlerts": false,
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
it("still requires a device and an app id", () => {
|
|
129
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...ios, udid: "" })).toThrow("A device is required");
|
|
130
|
+
expect(() => (0, capabilities_1.buildCapabilities)({ ...ios, appPackage: "" })).toThrow("appPackage is required");
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
describe("buildCapabilities: iOS first build", () => {
|
|
134
|
+
const ios = {
|
|
135
|
+
appiumUrl: "http://localhost:4723", udid: "U", platformName: "iOS", appSource: "installed", appPackage: "io.solidx.testhub.sample",
|
|
136
|
+
};
|
|
137
|
+
it("gives WebDriverAgent longer to start until it has been built", () => {
|
|
138
|
+
expect((0, capabilities_1.buildCapabilities)(ios)["appium:wdaLaunchTimeout"]).toBe(480_000);
|
|
139
|
+
expect((0, capabilities_1.buildCapabilities)({ ...ios, wdaDerivedDataPath: "/w", wdaPrebuilt: false })["appium:wdaLaunchTimeout"]).toBe(480_000);
|
|
140
|
+
expect((0, capabilities_1.buildCapabilities)({ ...ios, wdaDerivedDataPath: "/w", wdaPrebuilt: true })["appium:wdaLaunchTimeout"]).toBe(240_000);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
describe("buildCapabilities: iOS on a phone and on the Simulator", () => {
|
|
144
|
+
const TEAM = "LN5367MMM6";
|
|
145
|
+
const phone = {
|
|
146
|
+
appiumUrl: "http://localhost:4723",
|
|
147
|
+
udid: "00008140-001A202611B8801C",
|
|
148
|
+
platformName: "iOS",
|
|
149
|
+
simulator: false,
|
|
150
|
+
appSource: "installed",
|
|
151
|
+
appPackage: "com.oswald.mydemoapp",
|
|
152
|
+
};
|
|
153
|
+
const simulator = { ...phone, udid: "1674E718-0EBA-4568-9644-F18E0DDF7705", simulator: true };
|
|
154
|
+
const signingKeys = ["appium:xcodeOrgId", "appium:xcodeSigningId", "appium:updatedWDABundleId", "appium:allowProvisioningDeviceRegistration"];
|
|
155
|
+
const SETTING = "appium:settings[acceptAlertButtonSelector]";
|
|
156
|
+
it("a phone with signing: the team, the identity, WebDriverAgent's own bundle id and permission to register", () => {
|
|
157
|
+
expect((0, capabilities_1.buildCapabilities)({ ...phone, wdaSigning: { teamId: TEAM } })).toMatchObject({
|
|
158
|
+
"appium:xcodeOrgId": TEAM,
|
|
159
|
+
"appium:xcodeSigningId": "Apple Development",
|
|
160
|
+
"appium:updatedWDABundleId": "io.solidx.wda.ln5367mmm6",
|
|
161
|
+
"appium:allowProvisioningDeviceRegistration": true,
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
it("a signing identity and a WebDriverAgent bundle id given by the caller win over the defaults", () => {
|
|
165
|
+
const caps = (0, capabilities_1.buildCapabilities)({ ...phone, wdaSigning: { teamId: TEAM, signingId: "iPhone Developer", wdaBundleId: "com.acme.wda" } });
|
|
166
|
+
expect(caps["appium:xcodeSigningId"]).toBe("iPhone Developer");
|
|
167
|
+
expect(caps["appium:updatedWDABundleId"]).toBe("com.acme.wda");
|
|
168
|
+
});
|
|
169
|
+
it("a phone allows the permission prompt through a WebDriverAgent setting, not a capability the driver would ignore", () => {
|
|
170
|
+
const caps = (0, capabilities_1.buildCapabilities)(phone);
|
|
171
|
+
expect(caps[SETTING]).toBe(capabilities_1.IOS_ALLOW_BUTTON_SELECTOR);
|
|
172
|
+
expect(Object.keys(caps)).not.toContain("appium:acceptAlertButtonSelector");
|
|
173
|
+
expect(caps["appium:autoAcceptAlerts"]).toBe(true);
|
|
174
|
+
});
|
|
175
|
+
it("the allow rule never taps Allow Once", () => {
|
|
176
|
+
expect(capabilities_1.IOS_ALLOW_BUTTON_SELECTOR).toContain("Allow While Using App");
|
|
177
|
+
expect(capabilities_1.IOS_ALLOW_BUTTON_SELECTOR).not.toContain("Allow Once");
|
|
178
|
+
});
|
|
179
|
+
it("a phone without signing still gets the allow rule but none of the signing keys", () => {
|
|
180
|
+
const caps = (0, capabilities_1.buildCapabilities)(phone);
|
|
181
|
+
expect(Object.keys(caps)).toContain(SETTING);
|
|
182
|
+
for (const key of signingKeys)
|
|
183
|
+
expect(Object.keys(caps)).not.toContain(key);
|
|
184
|
+
});
|
|
185
|
+
it("the Simulator gets neither signing nor the allow rule", () => {
|
|
186
|
+
const caps = (0, capabilities_1.buildCapabilities)({ ...simulator, wdaSigning: undefined });
|
|
187
|
+
expect(Object.keys(caps)).not.toContain(SETTING);
|
|
188
|
+
for (const key of signingKeys)
|
|
189
|
+
expect(Object.keys(caps)).not.toContain(key);
|
|
190
|
+
});
|
|
191
|
+
it("the Simulator's capabilities are exactly what they were before phones", () => {
|
|
192
|
+
expect((0, capabilities_1.buildCapabilities)(simulator)).toEqual({
|
|
193
|
+
platformName: "iOS",
|
|
194
|
+
"appium:automationName": "XCUITest",
|
|
195
|
+
"appium:udid": "1674E718-0EBA-4568-9644-F18E0DDF7705",
|
|
196
|
+
"appium:newCommandTimeout": 120,
|
|
197
|
+
"appium:autoAcceptAlerts": true,
|
|
198
|
+
"appium:wdaLaunchTimeout": 480_000,
|
|
199
|
+
"appium:bundleId": "com.oswald.mydemoapp",
|
|
200
|
+
"appium:noReset": true,
|
|
201
|
+
"appium:forceAppLaunch": true,
|
|
202
|
+
"appium:shouldTerminateApp": true,
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
it("extraCapabilities still override what the phone sets", () => {
|
|
206
|
+
expect((0, capabilities_1.buildCapabilities)({ ...phone, extraCapabilities: { [SETTING]: "custom" } })[SETTING]).toBe("custom");
|
|
207
|
+
});
|
|
208
|
+
it("Android gets none of it", () => {
|
|
209
|
+
const android = (0, capabilities_1.buildCapabilities)({ appiumUrl: "http://localhost:4723", udid: "emulator-5554", appSource: "installed", appPackage: "com.acme.app", appActivity: ".Main" });
|
|
210
|
+
expect(Object.keys(android)).not.toContain(SETTING);
|
|
211
|
+
for (const key of signingKeys)
|
|
212
|
+
expect(Object.keys(android)).not.toContain(key);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
//# sourceMappingURL=capabilities.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.spec.js","sourceRoot":"","sources":["../../../../src/testing/adapters/mobile/capabilities.spec.ts"],"names":[],"mappings":";;AAAA,iDAA8E;AAG9E,MAAM,IAAI,GAAyB;IACjC,SAAS,EAAE,uBAAuB;IAClC,IAAI,EAAE,eAAe;IACrB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,cAAc;IAC1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OAAO,CAAC,CAAC;QACpD,KAAK,MAAM,GAAG,IAAI,WAAW;YAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { buildCapabilities, IOS_ALLOW_BUTTON_SELECTOR } from \"./capabilities\";\nimport type { MobileAdapterOptions } from \"./mobile.types\";\n\nconst base: MobileAdapterOptions = {\n appiumUrl: \"http://localhost:4723\",\n udid: \"emulator-5554\",\n appSource: \"installed\",\n appPackage: \"com.acme.app\",\n appActivity: \".MainActivity\",\n};\n\ndescribe(\"buildCapabilities\", () => {\n it(\"sets the base capabilities for every session\", () => {\n const caps = buildCapabilities(base);\n expect(caps).toMatchObject({\n platformName: \"Android\",\n \"appium:automationName\": \"UiAutomator2\",\n \"appium:udid\": \"emulator-5554\",\n \"appium:newCommandTimeout\": 120,\n \"appium:autoGrantPermissions\": true,\n \"appium:settings[waitForIdleTimeout]\": 500,\n });\n });\n\n it(\"lets extra capabilities change the idle wait, for a device that needs another value\", () => {\n const caps = buildCapabilities({ ...base, extraCapabilities: { \"appium:settings[waitForIdleTimeout]\": 0 } });\n expect(caps[\"appium:settings[waitForIdleTimeout]\"]).toBe(0);\n });\n\n it(\"installed: opens the app by id, keeps its data and restarts it\", () => {\n const caps = buildCapabilities(base);\n expect(caps).toMatchObject({\n \"appium:appPackage\": \"com.acme.app\",\n \"appium:appActivity\": \".MainActivity\",\n \"appium:noReset\": true,\n \"appium:forceAppLaunch\": true,\n \"appium:shouldTerminateApp\": true,\n });\n expect(caps).not.toHaveProperty(\"appium:app\");\n });\n\n it(\"upload: passes the APK and leaves noReset unset\", () => {\n const caps = buildCapabilities({ ...base, appSource: \"upload\", appPath: \"/tmp/app.apk\", appActivity: undefined });\n expect(caps[\"appium:app\"]).toBe(\"/tmp/app.apk\");\n expect(caps).not.toHaveProperty(\"appium:noReset\");\n expect(caps).not.toHaveProperty(\"appium:appActivity\");\n });\n\n it(\"merges extra capabilities last, so they can override\", () => {\n const caps = buildCapabilities({\n ...base,\n extraCapabilities: { \"appium:newCommandTimeout\": 300, \"appium:language\": \"en\" },\n });\n expect(caps[\"appium:newCommandTimeout\"]).toBe(300);\n expect(caps[\"appium:language\"]).toBe(\"en\");\n });\n\n it(\"never asks Appium to boot an emulator\", () => {\n expect(buildCapabilities(base)).not.toHaveProperty(\"appium:avd\");\n expect(buildCapabilities({ ...base, extraCapabilities: {} })).not.toHaveProperty(\"appium:avdArgs\");\n });\n\n it(\"requires a device\", () => {\n expect(() => buildCapabilities({ ...base, udid: \"\" })).toThrow(\"A device is required (udid)\");\n });\n\n it(\"requires appPackage\", () => {\n expect(() => buildCapabilities({ ...base, appPackage: \"\" })).toThrow(\"appPackage is required\");\n });\n\n it('requires appPath for \"upload\"', () => {\n expect(() => buildCapabilities({ ...base, appSource: \"upload\" })).toThrow(\n 'appPath is required when appSource is \"upload\"',\n );\n });\n\n it('requires appActivity for \"installed\"', () => {\n expect(() => buildCapabilities({ ...base, appActivity: undefined })).toThrow(\n 'appActivity is required when appSource is \"installed\"',\n );\n });\n\n it(\"rejects an unknown app source\", () => {\n expect(() => buildCapabilities({ ...base, appSource: \"store\" as any })).toThrow('appSource must be \"upload\" or \"installed\"');\n });\n});\n\ndescribe(\"buildCapabilities: iOS\", () => {\n const ios: MobileAdapterOptions = {\n appiumUrl: \"http://localhost:4723\",\n udid: \"1674E718-0EBA-4568-9644-F18E0DDF7705\",\n platformName: \"iOS\",\n appSource: \"installed\",\n appPackage: \"io.solidx.testhub.sample\",\n };\n\n it(\"uses XCUITest and the simulator's UDID\", () => {\n expect(buildCapabilities(ios)).toMatchObject({\n platformName: \"iOS\",\n \"appium:automationName\": \"XCUITest\",\n \"appium:udid\": \"1674E718-0EBA-4568-9644-F18E0DDF7705\",\n \"appium:newCommandTimeout\": 120,\n \"appium:autoAcceptAlerts\": true,\n });\n });\n\n it(\"has no Android-only keys and never an avd\", () => {\n const caps = buildCapabilities(ios);\n for (const key of [\"appium:avd\", \"appium:appPackage\", \"appium:appActivity\", \"appium:autoGrantPermissions\"]) {\n expect(caps).not.toHaveProperty(key);\n }\n });\n\n it(\"installed: opens the app by bundle id, keeps its data and restarts it, without needing an activity\", () => {\n const caps = buildCapabilities(ios);\n expect(caps).toMatchObject({\n \"appium:bundleId\": \"io.solidx.testhub.sample\",\n \"appium:noReset\": true,\n \"appium:forceAppLaunch\": true,\n \"appium:shouldTerminateApp\": true,\n });\n expect(caps).not.toHaveProperty(\"appium:app\");\n });\n\n it(\"installed with a build: the build is kept for a reset, not installed at session start\", () => {\n const caps = buildCapabilities({ ...ios, appPath: \"/builds/Sample.app\" });\n expect(caps).not.toHaveProperty(\"appium:app\");\n });\n\n it(\"upload: passes the .app and needs a path\", () => {\n expect(buildCapabilities({ ...ios, appSource: \"upload\", appPath: \"/builds/Sample.app\" })[\"appium:app\"]).toBe(\"/builds/Sample.app\");\n expect(() => buildCapabilities({ ...ios, appSource: \"upload\" })).toThrow('appPath is required when appSource is \"upload\"');\n });\n\n it(\"adds the WebDriverAgent cache only when a folder is given\", () => {\n expect(buildCapabilities(ios)).not.toHaveProperty(\"appium:derivedDataPath\");\n expect(buildCapabilities({ ...ios, wdaDerivedDataPath: \"/w/xcode-27.0\" })).toMatchObject({\n \"appium:derivedDataPath\": \"/w/xcode-27.0\",\n \"appium:usePrebuiltWDA\": false,\n });\n expect(buildCapabilities({ ...ios, wdaDerivedDataPath: \"/w/xcode-27.0\", wdaPrebuilt: true })).toMatchObject({\n \"appium:usePrebuiltWDA\": true,\n });\n });\n\n it(\"lets extra capabilities override, for example to leave alerts alone\", () => {\n expect(buildCapabilities({ ...ios, extraCapabilities: { \"appium:autoAcceptAlerts\": false } })).toMatchObject({\n \"appium:autoAcceptAlerts\": false,\n });\n });\n\n it(\"still requires a device and an app id\", () => {\n expect(() => buildCapabilities({ ...ios, udid: \"\" })).toThrow(\"A device is required\");\n expect(() => buildCapabilities({ ...ios, appPackage: \"\" })).toThrow(\"appPackage is required\");\n });\n});\n\ndescribe(\"buildCapabilities: iOS first build\", () => {\n const ios: MobileAdapterOptions = {\n appiumUrl: \"http://localhost:4723\", udid: \"U\", platformName: \"iOS\", appSource: \"installed\", appPackage: \"io.solidx.testhub.sample\",\n };\n\n it(\"gives WebDriverAgent longer to start until it has been built\", () => {\n expect(buildCapabilities(ios)[\"appium:wdaLaunchTimeout\"]).toBe(480_000);\n expect(buildCapabilities({ ...ios, wdaDerivedDataPath: \"/w\", wdaPrebuilt: false })[\"appium:wdaLaunchTimeout\"]).toBe(480_000);\n expect(buildCapabilities({ ...ios, wdaDerivedDataPath: \"/w\", wdaPrebuilt: true })[\"appium:wdaLaunchTimeout\"]).toBe(240_000);\n });\n});\n\ndescribe(\"buildCapabilities: iOS on a phone and on the Simulator\", () => {\n const TEAM = \"LN5367MMM6\";\n const phone: MobileAdapterOptions = {\n appiumUrl: \"http://localhost:4723\",\n udid: \"00008140-001A202611B8801C\",\n platformName: \"iOS\",\n simulator: false,\n appSource: \"installed\",\n appPackage: \"com.oswald.mydemoapp\",\n };\n const simulator: MobileAdapterOptions = { ...phone, udid: \"1674E718-0EBA-4568-9644-F18E0DDF7705\", simulator: true };\n const signingKeys = [\"appium:xcodeOrgId\", \"appium:xcodeSigningId\", \"appium:updatedWDABundleId\", \"appium:allowProvisioningDeviceRegistration\"];\n const SETTING = \"appium:settings[acceptAlertButtonSelector]\";\n\n it(\"a phone with signing: the team, the identity, WebDriverAgent's own bundle id and permission to register\", () => {\n expect(buildCapabilities({ ...phone, wdaSigning: { teamId: TEAM } })).toMatchObject({\n \"appium:xcodeOrgId\": TEAM,\n \"appium:xcodeSigningId\": \"Apple Development\",\n \"appium:updatedWDABundleId\": \"io.solidx.wda.ln5367mmm6\",\n \"appium:allowProvisioningDeviceRegistration\": true,\n });\n });\n\n it(\"a signing identity and a WebDriverAgent bundle id given by the caller win over the defaults\", () => {\n const caps = buildCapabilities({ ...phone, wdaSigning: { teamId: TEAM, signingId: \"iPhone Developer\", wdaBundleId: \"com.acme.wda\" } });\n expect(caps[\"appium:xcodeSigningId\"]).toBe(\"iPhone Developer\");\n expect(caps[\"appium:updatedWDABundleId\"]).toBe(\"com.acme.wda\");\n });\n\n it(\"a phone allows the permission prompt through a WebDriverAgent setting, not a capability the driver would ignore\", () => {\n const caps = buildCapabilities(phone);\n expect(caps[SETTING]).toBe(IOS_ALLOW_BUTTON_SELECTOR);\n expect(Object.keys(caps)).not.toContain(\"appium:acceptAlertButtonSelector\");\n expect(caps[\"appium:autoAcceptAlerts\"]).toBe(true);\n });\n\n it(\"the allow rule never taps Allow Once\", () => {\n expect(IOS_ALLOW_BUTTON_SELECTOR).toContain(\"Allow While Using App\");\n expect(IOS_ALLOW_BUTTON_SELECTOR).not.toContain(\"Allow Once\");\n });\n\n it(\"a phone without signing still gets the allow rule but none of the signing keys\", () => {\n const caps = buildCapabilities(phone);\n expect(Object.keys(caps)).toContain(SETTING);\n for (const key of signingKeys) expect(Object.keys(caps)).not.toContain(key);\n });\n\n it(\"the Simulator gets neither signing nor the allow rule\", () => {\n const caps = buildCapabilities({ ...simulator, wdaSigning: undefined });\n expect(Object.keys(caps)).not.toContain(SETTING);\n for (const key of signingKeys) expect(Object.keys(caps)).not.toContain(key);\n });\n\n it(\"the Simulator's capabilities are exactly what they were before phones\", () => {\n expect(buildCapabilities(simulator)).toEqual({\n platformName: \"iOS\",\n \"appium:automationName\": \"XCUITest\",\n \"appium:udid\": \"1674E718-0EBA-4568-9644-F18E0DDF7705\",\n \"appium:newCommandTimeout\": 120,\n \"appium:autoAcceptAlerts\": true,\n \"appium:wdaLaunchTimeout\": 480_000,\n \"appium:bundleId\": \"com.oswald.mydemoapp\",\n \"appium:noReset\": true,\n \"appium:forceAppLaunch\": true,\n \"appium:shouldTerminateApp\": true,\n });\n });\n\n it(\"extraCapabilities still override what the phone sets\", () => {\n expect(buildCapabilities({ ...phone, extraCapabilities: { [SETTING]: \"custom\" } })[SETTING]).toBe(\"custom\");\n });\n\n it(\"Android gets none of it\", () => {\n const android = buildCapabilities({ appiumUrl: \"http://localhost:4723\", udid: \"emulator-5554\", appSource: \"installed\", appPackage: \"com.acme.app\", appActivity: \".Main\" });\n expect(Object.keys(android)).not.toContain(SETTING);\n for (const key of signingKeys) expect(Object.keys(android)).not.toContain(key);\n });\n});\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { MobileClock, MobileDriver, MobileElement } from "./mobile.types";
|
|
2
|
+
export declare class FakeElement implements MobileElement {
|
|
3
|
+
calls: string[];
|
|
4
|
+
displayed: boolean;
|
|
5
|
+
text: string;
|
|
6
|
+
location: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
size: {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
constructor(opts?: {
|
|
15
|
+
displayed?: boolean;
|
|
16
|
+
text?: string;
|
|
17
|
+
location?: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
size?: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
click(): Promise<void>;
|
|
27
|
+
setValue(value: string): Promise<void>;
|
|
28
|
+
addValue(value: string): Promise<void>;
|
|
29
|
+
clearValue(): Promise<void>;
|
|
30
|
+
getText(): Promise<string>;
|
|
31
|
+
displayChecks: number;
|
|
32
|
+
isDisplayedDelayMs: number;
|
|
33
|
+
isDisplayed(): Promise<boolean>;
|
|
34
|
+
getLocation(): Promise<{
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}>;
|
|
38
|
+
getSize(): Promise<{
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
}>;
|
|
42
|
+
waitForDisplayed(opts?: {
|
|
43
|
+
timeout?: number;
|
|
44
|
+
timeoutMsg?: string;
|
|
45
|
+
}): Promise<boolean>;
|
|
46
|
+
}
|
|
47
|
+
export declare class FakeDriver implements MobileDriver {
|
|
48
|
+
elements: Map<string, FakeElement[]>;
|
|
49
|
+
calls: Array<{
|
|
50
|
+
method: string;
|
|
51
|
+
args: unknown[];
|
|
52
|
+
}>;
|
|
53
|
+
logs: Array<{
|
|
54
|
+
level?: string;
|
|
55
|
+
message?: string;
|
|
56
|
+
}>;
|
|
57
|
+
screenshotBase64: string;
|
|
58
|
+
recordingBase64: string;
|
|
59
|
+
appState: number;
|
|
60
|
+
pageSource: string;
|
|
61
|
+
appStates: number[];
|
|
62
|
+
keyboardShown: boolean;
|
|
63
|
+
keyboardRect?: {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
};
|
|
69
|
+
hideWith?: Set<"driver" | "tapOutside" | "swipeDown">;
|
|
70
|
+
windowSize: {
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
};
|
|
74
|
+
failing: Set<string>;
|
|
75
|
+
failureMessages: Map<string, string>;
|
|
76
|
+
failingScripts: Set<string>;
|
|
77
|
+
add(selector: string, ...elements: FakeElement[]): FakeElement[];
|
|
78
|
+
callsTo(method: string): {
|
|
79
|
+
method: string;
|
|
80
|
+
args: unknown[];
|
|
81
|
+
}[];
|
|
82
|
+
private record;
|
|
83
|
+
$(selector: string): Promise<FakeElement>;
|
|
84
|
+
lookupDelayMs: number | ((selector: string) => number);
|
|
85
|
+
$$(selector: string): Promise<FakeElement[]>;
|
|
86
|
+
waitUntil(condition: () => Promise<boolean>, opts?: {
|
|
87
|
+
timeoutMsg?: string;
|
|
88
|
+
}): Promise<boolean>;
|
|
89
|
+
execute(script: string, ...args: unknown[]): Promise<number>;
|
|
90
|
+
back(): Promise<void>;
|
|
91
|
+
isKeyboardShown(): Promise<boolean>;
|
|
92
|
+
hideKeyboard(): Promise<void>;
|
|
93
|
+
getWindowSize(): Promise<{
|
|
94
|
+
width: number;
|
|
95
|
+
height: number;
|
|
96
|
+
}>;
|
|
97
|
+
takeScreenshot(): Promise<string>;
|
|
98
|
+
getPageSource(): Promise<string>;
|
|
99
|
+
getLogs(type: string): Promise<{
|
|
100
|
+
level?: string;
|
|
101
|
+
message?: string;
|
|
102
|
+
}[]>;
|
|
103
|
+
startRecordingScreen(opts?: Record<string, unknown>): Promise<void>;
|
|
104
|
+
stopRecordingScreen(): Promise<string>;
|
|
105
|
+
deleteSession(): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
export declare class FakeClock implements MobileClock {
|
|
108
|
+
sleeps: number[];
|
|
109
|
+
private current;
|
|
110
|
+
now(): number;
|
|
111
|
+
sleep(ms: number): Promise<void>;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=fake-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-driver.d.ts","sourceRoot":"","sources":["../../../../src/testing/adapters/mobile/fake-driver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/E,qBAAa,WAAY,YAAW,aAAa;IAC/C,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;gBAE5B,IAAI,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SA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nC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE;IAKhE,OAAO,CAAC,MAAM,EAAE,MAAM;gBA3BC,MAAM;cAAQ,OAAO,EAAE;;IA+B9C,OAAO,CAAC,MAAM;IAKR,CAAC,CAAC,QAAQ,EAAE,MAAM;IAKxB,aAAa,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAK;IACrD,EAAE,CAAC,QAAQ,EAAE,MAAM;IAWnB,SAAS,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAO3E,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAO1C,IAAI;IACJ,eAAe;IACf,YAAY;IACZ,aAAa;;;;IACb,cAAc;IACd,aAAa;IACb,OAAO,CAAC,IAAI,EAAE,MAAM;gBAxEJ,MAAM;kBAAY,MAAM;;IAyExC,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnD,mBAAmB;IACnB,aAAa;CACpB;AAGD,qBAAa,SAAU,YAAW,WAAW;IAC3C,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,OAAO,CAAC,OAAO,CAAK;IACpB,GAAG;IACG,KAAK,CAAC,EAAE,EAAE,MAAM;CAIvB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FakeClock = exports.FakeDriver = exports.FakeElement = void 0;
|
|
4
|
+
class FakeElement {
|
|
5
|
+
constructor(opts = {}) {
|
|
6
|
+
this.calls = [];
|
|
7
|
+
this.displayChecks = 0;
|
|
8
|
+
this.isDisplayedDelayMs = 0;
|
|
9
|
+
this.displayed = opts.displayed ?? true;
|
|
10
|
+
this.text = opts.text ?? "";
|
|
11
|
+
this.location = opts.location ?? { x: 100, y: 200 };
|
|
12
|
+
this.size = opts.size ?? { width: 300, height: 400 };
|
|
13
|
+
}
|
|
14
|
+
async click() { this.calls.push("click"); }
|
|
15
|
+
async setValue(value) { this.calls.push(`setValue:${value}`); this.text = value; }
|
|
16
|
+
async addValue(value) { this.calls.push(`addValue:${value}`); this.text += value; }
|
|
17
|
+
async clearValue() { this.calls.push("clearValue"); this.text = ""; }
|
|
18
|
+
async getText() { this.calls.push("getText"); return this.text; }
|
|
19
|
+
async isDisplayed() {
|
|
20
|
+
this.displayChecks += 1;
|
|
21
|
+
if (this.isDisplayedDelayMs)
|
|
22
|
+
await new Promise((resolve) => setTimeout(resolve, this.isDisplayedDelayMs));
|
|
23
|
+
return this.displayed;
|
|
24
|
+
}
|
|
25
|
+
async getLocation() { return this.location; }
|
|
26
|
+
async getSize() { return this.size; }
|
|
27
|
+
async waitForDisplayed(opts) {
|
|
28
|
+
this.calls.push(`waitForDisplayed:${opts?.timeout ?? ""}`);
|
|
29
|
+
if (!this.displayed)
|
|
30
|
+
throw new Error(opts?.timeoutMsg ?? "element not displayed");
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.FakeElement = FakeElement;
|
|
35
|
+
class FakeDriver {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.elements = new Map();
|
|
38
|
+
this.calls = [];
|
|
39
|
+
this.logs = [];
|
|
40
|
+
this.screenshotBase64 = Buffer.from("png-bytes").toString("base64");
|
|
41
|
+
this.recordingBase64 = Buffer.from("mp4-bytes").toString("base64");
|
|
42
|
+
this.appState = 4;
|
|
43
|
+
this.pageSource = "<hierarchy rotation=\"0\"></hierarchy>";
|
|
44
|
+
this.appStates = [];
|
|
45
|
+
this.keyboardShown = false;
|
|
46
|
+
this.windowSize = { width: 1080, height: 2400 };
|
|
47
|
+
this.failing = new Set();
|
|
48
|
+
this.failureMessages = new Map();
|
|
49
|
+
this.failingScripts = new Set();
|
|
50
|
+
this.lookupDelayMs = 0;
|
|
51
|
+
}
|
|
52
|
+
add(selector, ...elements) {
|
|
53
|
+
this.elements.set(selector, [...(this.elements.get(selector) ?? []), ...elements]);
|
|
54
|
+
return elements;
|
|
55
|
+
}
|
|
56
|
+
callsTo(method) {
|
|
57
|
+
return this.calls.filter((call) => call.method === method);
|
|
58
|
+
}
|
|
59
|
+
record(method, args) {
|
|
60
|
+
this.calls.push({ method, args });
|
|
61
|
+
if (this.failing.has(method))
|
|
62
|
+
throw new Error(this.failureMessages.get(method) ?? `${method} failed`);
|
|
63
|
+
}
|
|
64
|
+
async $(selector) {
|
|
65
|
+
this.record("$", [selector]);
|
|
66
|
+
return this.elements.get(selector)?.[0] ?? new FakeElement({ displayed: false });
|
|
67
|
+
}
|
|
68
|
+
async $$(selector) {
|
|
69
|
+
this.record("$$", [selector]);
|
|
70
|
+
const delay = typeof this.lookupDelayMs === "function" ? this.lookupDelayMs(selector) : this.lookupDelayMs;
|
|
71
|
+
if (delay > 0)
|
|
72
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
73
|
+
if (selector === "-ios class chain:**/XCUIElementTypeKeyboard" && this.keyboardRect && this.keyboardShown) {
|
|
74
|
+
const { x, y, width, height } = this.keyboardRect;
|
|
75
|
+
return [new FakeElement({ location: { x, y }, size: { width, height } })];
|
|
76
|
+
}
|
|
77
|
+
return [...(this.elements.get(selector) ?? [])];
|
|
78
|
+
}
|
|
79
|
+
async waitUntil(condition, opts) {
|
|
80
|
+
this.record("waitUntil", [opts]);
|
|
81
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
82
|
+
if (await condition())
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
throw new Error(opts?.timeoutMsg ?? "waitUntil timed out");
|
|
86
|
+
}
|
|
87
|
+
async execute(script, ...args) {
|
|
88
|
+
this.record("execute", [script, ...args]);
|
|
89
|
+
if (this.failingScripts.has(script))
|
|
90
|
+
throw new Error(`${script} failed`);
|
|
91
|
+
if (script === "mobile: tap" && this.hideWith?.has("tapOutside"))
|
|
92
|
+
this.keyboardShown = false;
|
|
93
|
+
if (script === "mobile: dragFromToForDuration" && this.hideWith?.has("swipeDown"))
|
|
94
|
+
this.keyboardShown = false;
|
|
95
|
+
return script === "mobile: queryAppState" ? (this.appStates.length ? this.appStates.shift() : this.appState) : undefined;
|
|
96
|
+
}
|
|
97
|
+
async back() { this.record("back", []); }
|
|
98
|
+
async isKeyboardShown() { this.record("isKeyboardShown", []); return this.keyboardShown; }
|
|
99
|
+
async hideKeyboard() { this.record("hideKeyboard", []); if (!this.hideWith || this.hideWith.has("driver"))
|
|
100
|
+
this.keyboardShown = false; }
|
|
101
|
+
async getWindowSize() { this.record("getWindowSize", []); return this.windowSize; }
|
|
102
|
+
async takeScreenshot() { this.record("takeScreenshot", []); return this.screenshotBase64; }
|
|
103
|
+
async getPageSource() { this.record("getPageSource", []); return this.pageSource; }
|
|
104
|
+
async getLogs(type) { this.record("getLogs", [type]); const out = this.logs; this.logs = []; return out; }
|
|
105
|
+
async startRecordingScreen(opts) { this.record("startRecordingScreen", [opts]); }
|
|
106
|
+
async stopRecordingScreen() { this.record("stopRecordingScreen", []); return this.recordingBase64; }
|
|
107
|
+
async deleteSession() { this.record("deleteSession", []); }
|
|
108
|
+
}
|
|
109
|
+
exports.FakeDriver = FakeDriver;
|
|
110
|
+
class FakeClock {
|
|
111
|
+
constructor() {
|
|
112
|
+
this.sleeps = [];
|
|
113
|
+
this.current = 0;
|
|
114
|
+
}
|
|
115
|
+
now() { return this.current; }
|
|
116
|
+
async sleep(ms) {
|
|
117
|
+
this.sleeps.push(ms);
|
|
118
|
+
this.current += ms;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.FakeClock = FakeClock;
|
|
122
|
+
//# sourceMappingURL=fake-driver.js.map
|