appium-mcp 0.0.1 → 1.1.5
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/.github/workflows/ci.yml +37 -0
- package/.github/workflows/pr-title.yml +15 -0
- package/.github/workflows/publish.yml +31 -0
- package/.gitmodules +9 -0
- package/.prettierignore +29 -0
- package/.prettierrc +10 -0
- package/.releaserc +37 -0
- package/CHANGELOG.md +43 -0
- package/LICENSE +21 -0
- package/README.md +153 -0
- package/dist/devicemanager/adb-manager.d.ts +71 -0
- package/dist/devicemanager/adb-manager.js +140 -0
- package/dist/devicemanager/adb-manager.js.map +1 -0
- package/dist/devicemanager/ios-manager.d.ts +58 -0
- package/dist/devicemanager/ios-manager.js +122 -0
- package/dist/devicemanager/ios-manager.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/locators/element-filter.d.ts +13 -0
- package/dist/locators/element-filter.js +79 -0
- package/dist/locators/element-filter.js.map +1 -0
- package/dist/locators/generate-all-locators.d.ts +21 -0
- package/dist/locators/generate-all-locators.js +72 -0
- package/dist/locators/generate-all-locators.js.map +1 -0
- package/dist/locators/locator-generation.d.ts +36 -0
- package/dist/locators/locator-generation.js +501 -0
- package/dist/locators/locator-generation.js.map +1 -0
- package/dist/locators/logger.d.ts +5 -0
- package/dist/locators/logger.js +9 -0
- package/dist/locators/logger.js.map +1 -0
- package/dist/locators/source-parsing.d.ts +43 -0
- package/dist/locators/source-parsing.js +100 -0
- package/dist/locators/source-parsing.js.map +1 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.js +7 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/java/template.d.ts +4 -0
- package/dist/resources/java/template.js +82 -0
- package/dist/resources/java/template.js.map +1 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +5 -0
- package/dist/schema.js.map +1 -0
- package/dist/scripts/simple-index-documentation.d.ts +20 -0
- package/dist/scripts/simple-index-documentation.js +77 -0
- package/dist/scripts/simple-index-documentation.js.map +1 -0
- package/dist/scripts/simple-query-documentation.d.ts +12 -0
- package/dist/scripts/simple-query-documentation.js +52 -0
- package/dist/scripts/simple-query-documentation.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +37 -0
- package/dist/server.js.map +1 -0
- package/dist/tests/__mocks__/@appium/support.d.ts +21 -0
- package/dist/tests/__mocks__/@appium/support.js +30 -0
- package/dist/tests/__mocks__/@appium/support.js.map +1 -0
- package/dist/tests/generate-all-locators.test.d.ts +1 -0
- package/dist/tests/generate-all-locators.test.js +140 -0
- package/dist/tests/generate-all-locators.test.js.map +1 -0
- package/dist/tests/test-setup-wda.d.ts +1 -0
- package/dist/tests/test-setup-wda.js +202 -0
- package/dist/tests/test-setup-wda.js.map +1 -0
- package/dist/tools/answer-appium.d.ts +1 -0
- package/dist/tools/answer-appium.js +71 -0
- package/dist/tools/answer-appium.js.map +1 -0
- package/dist/tools/boot-simulator.d.ts +1 -0
- package/dist/tools/boot-simulator.js +71 -0
- package/dist/tools/boot-simulator.js.map +1 -0
- package/dist/tools/create-session.d.ts +1 -0
- package/dist/tools/create-session.js +192 -0
- package/dist/tools/create-session.js.map +1 -0
- package/dist/tools/delete-session.d.ts +1 -0
- package/dist/tools/delete-session.js +47 -0
- package/dist/tools/delete-session.js.map +1 -0
- package/dist/tools/documentation/index.d.ts +28 -0
- package/dist/tools/documentation/index.js +63 -0
- package/dist/tools/documentation/index.js.map +1 -0
- package/dist/tools/documentation/reasoning-rag.d.ts +88 -0
- package/dist/tools/documentation/reasoning-rag.js +281 -0
- package/dist/tools/documentation/reasoning-rag.js.map +1 -0
- package/dist/tools/documentation/sentence-transformers-embeddings.d.ts +34 -0
- package/dist/tools/documentation/sentence-transformers-embeddings.js +111 -0
- package/dist/tools/documentation/sentence-transformers-embeddings.js.map +1 -0
- package/dist/tools/documentation/simple-pdf-indexer.d.ts +45 -0
- package/dist/tools/documentation/simple-pdf-indexer.js +402 -0
- package/dist/tools/documentation/simple-pdf-indexer.js.map +1 -0
- package/dist/tools/documentation/uploads/documents.json +1 -0
- package/dist/tools/generate-tests.d.ts +2 -0
- package/dist/tools/generate-tests.js +46 -0
- package/dist/tools/generate-tests.js.map +1 -0
- package/dist/tools/index.d.ts +16 -0
- package/dist/tools/index.js +114 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/install-wda.d.ts +1 -0
- package/dist/tools/install-wda.js +219 -0
- package/dist/tools/install-wda.js.map +1 -0
- package/dist/tools/interactions/activate-app.d.ts +2 -0
- package/dist/tools/interactions/activate-app.js +44 -0
- package/dist/tools/interactions/activate-app.js.map +1 -0
- package/dist/tools/interactions/click.d.ts +2 -0
- package/dist/tools/interactions/click.js +45 -0
- package/dist/tools/interactions/click.js.map +1 -0
- package/dist/tools/interactions/double-tap.d.ts +2 -0
- package/dist/tools/interactions/double-tap.js +81 -0
- package/dist/tools/interactions/double-tap.js.map +1 -0
- package/dist/tools/interactions/find.d.ts +13 -0
- package/dist/tools/interactions/find.js +55 -0
- package/dist/tools/interactions/find.js.map +1 -0
- package/dist/tools/interactions/get-page-source.d.ts +2 -0
- package/dist/tools/interactions/get-page-source.js +48 -0
- package/dist/tools/interactions/get-page-source.js.map +1 -0
- package/dist/tools/interactions/get-text.d.ts +2 -0
- package/dist/tools/interactions/get-text.js +45 -0
- package/dist/tools/interactions/get-text.js.map +1 -0
- package/dist/tools/interactions/install-app.d.ts +2 -0
- package/dist/tools/interactions/install-app.js +43 -0
- package/dist/tools/interactions/install-app.js.map +1 -0
- package/dist/tools/interactions/list-apps.d.ts +2 -0
- package/dist/tools/interactions/list-apps.js +59 -0
- package/dist/tools/interactions/list-apps.js.map +1 -0
- package/dist/tools/interactions/screenshot.d.ts +2 -0
- package/dist/tools/interactions/screenshot.js +49 -0
- package/dist/tools/interactions/screenshot.js.map +1 -0
- package/dist/tools/interactions/set-value.d.ts +2 -0
- package/dist/tools/interactions/set-value.js +46 -0
- package/dist/tools/interactions/set-value.js.map +1 -0
- package/dist/tools/interactions/terminate-app.d.ts +2 -0
- package/dist/tools/interactions/terminate-app.js +45 -0
- package/dist/tools/interactions/terminate-app.js.map +1 -0
- package/dist/tools/interactions/uninstall-app.d.ts +2 -0
- package/dist/tools/interactions/uninstall-app.js +45 -0
- package/dist/tools/interactions/uninstall-app.js.map +1 -0
- package/dist/tools/locators.d.ts +1 -0
- package/dist/tools/locators.js +71 -0
- package/dist/tools/locators.js.map +1 -0
- package/dist/tools/scroll-to-element.d.ts +1 -0
- package/dist/tools/scroll-to-element.js +155 -0
- package/dist/tools/scroll-to-element.js.map +1 -0
- package/dist/tools/scroll.d.ts +1 -0
- package/dist/tools/scroll.js +91 -0
- package/dist/tools/scroll.js.map +1 -0
- package/dist/tools/select-device.d.ts +5 -0
- package/dist/tools/select-device.js +222 -0
- package/dist/tools/select-device.js.map +1 -0
- package/dist/tools/select-platform.d.ts +1 -0
- package/dist/tools/select-platform.js +195 -0
- package/dist/tools/select-platform.js.map +1 -0
- package/dist/tools/session-store.d.ts +7 -0
- package/dist/tools/session-store.js +64 -0
- package/dist/tools/session-store.js.map +1 -0
- package/dist/tools/setup-wda.d.ts +1 -0
- package/dist/tools/setup-wda.js +177 -0
- package/dist/tools/setup-wda.js.map +1 -0
- package/docs/CONTRIBUTING.md +424 -0
- package/eslint.config.js +49 -0
- package/examples/android-gmail.md +7 -0
- package/examples/android-todo-app.md +9 -0
- package/jest.config.js +23 -0
- package/package.json +71 -6
- package/scripts/setup-submodules-sparse.sh +53 -0
- package/scripts/update-submodules.sh +14 -0
- package/src/devicemanager/adb-manager.ts +164 -0
- package/src/devicemanager/ios-manager.ts +145 -0
- package/src/index.ts +47 -0
- package/src/locators/element-filter.ts +134 -0
- package/src/locators/generate-all-locators.ts +149 -0
- package/src/locators/locator-generation.ts +657 -0
- package/src/locators/logger.ts +11 -0
- package/src/locators/source-parsing.ts +149 -0
- package/src/resources/caps.json +697 -0
- package/src/resources/index.ts +7 -0
- package/src/resources/java/template.ts +83 -0
- package/src/resources/submodules/appium/.github/PULL_REQUEST_TEMPLATE.md +28 -0
- package/src/resources/submodules/appium/CHANGELOG.md +45 -0
- package/src/resources/submodules/appium/CONDUCT.md +48 -0
- package/src/resources/submodules/appium/GOVERNANCE.md +185 -0
- package/src/resources/submodules/appium/IDEAS.md +16 -0
- package/src/resources/submodules/appium/README.md +221 -0
- package/src/resources/submodules/appium/ROADMAP.md +30 -0
- package/src/resources/submodules/appium/SPONSORS.md +3 -0
- package/src/resources/submodules/appium/docs/README.md +6 -0
- package/src/resources/submodules/appium/docs/payout.md +35 -0
- package/src/resources/submodules/appium/packages/appium/CHANGELOG.md +1437 -0
- package/src/resources/submodules/appium/packages/appium/README.md +221 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/index.md +2 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-appiumconf2024.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-headspin-as-development-partner.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-lambdatest-as-strategic-partner.md +42 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-sponsorship-program.md +48 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/appium3.md +40 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/hello-world.md +15 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/contributing/index.md +150 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-docs.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-doctor-checks.md +141 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-drivers.md +860 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-plugins.md +514 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/config-system.md +451 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/index.md +18 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/sensitive.md +49 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/clients.md +132 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/drivers.md +207 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/index.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/plugins.md +138 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/tools.md +83 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/branch-testing.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/caching.md +76 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/caps.md +275 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/config.md +98 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/context.md +44 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/event-timing.md +73 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/execute-methods.md +122 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/grid.md +166 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/headers.md +17 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/log-filters.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/managing-exts.md +87 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/migrating-1-to-2.md +368 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/migrating-2-to-3.md +464 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/security.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/settings.md +68 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/tls.md +42 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/index.md +59 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/appium.md +202 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/clients.md +127 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/drivers.md +188 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/history.md +196 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/index.md +39 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/index.md +29 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/install.md +50 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/next-steps.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/requirements.md +29 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-dotnet.md +105 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-java.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-js.md +75 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-py.md +60 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-rb.md +83 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/uiauto2-driver.md +144 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/appium.md +394 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/bidi.md +70 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/index.md +30 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/jsonwp.md +214 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/mjsonwp.md +151 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/others.md +671 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/plugins.md +289 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/webdriver.md +1114 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/env-vars.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/extensions.md +239 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/index.md +35 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/server.md +76 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/setup.md +76 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/index.md +25 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/resources/index.md +28 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/sponsors/index.md +64 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/index.md +2 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-appiumconf2024.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-headspin-as-development-partner.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-lambdatest-as-strategic-partner.md +41 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-sponsorship-program.md +48 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/appium3.md +40 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/hello-world.md +15 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/contributing/index.md +158 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-docs.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-doctor-checks.md +141 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-drivers.md +866 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-plugins.md +520 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/config-system.md +468 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/index.md +18 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/sensitive.md +49 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/clients.md +143 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/drivers.md +219 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/index.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/plugins.md +140 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/tools.md +87 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/branch-testing.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/caching.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/caps.md +259 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/config.md +102 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/context.md +44 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/event-timing.md +75 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/execute-methods.md +142 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/grid.md +166 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/headers.md +17 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/log-filters.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/managing-exts.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/migrating-1-to-2.md +402 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/migrating-2-to-3.md +458 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/security.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/settings.md +70 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/tls.md +43 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/index.md +55 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/appium.md +191 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/clients.md +139 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/drivers.md +188 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/history.md +196 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/index.md +39 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/index.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/install.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/next-steps.md +19 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/requirements.md +29 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-dotnet.md +107 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-java.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-js.md +77 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-py.md +63 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-rb.md +85 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/uiauto2-driver.md +148 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/appium.md +395 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/bidi.md +71 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/index.md +30 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/jsonwp.md +215 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/mjsonwp.md +152 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/others.md +672 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/plugins.md +291 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/webdriver.md +1114 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/env-vars.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/extensions.md +240 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/index.md +35 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/server.md +76 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/setup.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/index.md +25 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/resources/index.md +28 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/sponsors/index.md +61 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-horiz-white.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-horiz.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-white.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-dark.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-light.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-lambdatest-dark.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-lambdatest-light.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-sauce.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/index.md +2 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-appiumconf2024.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-headspin-as-development-partner.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-lambdatest-as-strategic-partner.md +41 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-sponsorship-program.md +48 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/appium3.md +40 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/hello-world.md +15 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/contributing/index.md +132 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-docs.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-doctor-checks.md +141 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-drivers.md +866 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-plugins.md +520 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/config-system.md +468 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/index.md +18 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/sensitive.md +49 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/clients.md +143 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/drivers.md +219 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/index.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/plugins.md +140 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/tools.md +87 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/branch-testing.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/caching.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/caps.md +284 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/config.md +102 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/context.md +44 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/event-timing.md +75 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/execute-methods.md +142 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/grid.md +166 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/headers.md +17 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/log-filters.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/managing-exts.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/migrating-1-to-2.md +410 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/migrating-2-to-3.md +459 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/security.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/settings.md +70 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/tls.md +43 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/index.md +54 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/appium.md +200 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/clients.md +139 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/drivers.md +188 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/history.md +196 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/index.md +39 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/index.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/install.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/next-steps.md +19 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/requirements.md +21 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-dotnet.md +99 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-java.md +20 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-js.md +62 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-py.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-rb.md +80 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/uiauto2-driver.md +148 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/appium.md +395 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/bidi.md +71 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/index.md +30 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/jsonwp.md +215 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/mjsonwp.md +152 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/others.md +672 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/plugins.md +291 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/webdriver.md +1114 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/env-vars.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/extensions.md +240 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/index.md +35 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/server.md +76 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/setup.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/index.md +25 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/resources/index.md +28 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/sponsors/index.md +61 -0
- package/src/resources/submodules/appium/packages/appium/types/manifest/README.md +30 -0
- package/src/resources/submodules/appium/packages/base-driver/CHANGELOG.md +1131 -0
- package/src/resources/submodules/appium/packages/base-driver/README.md +15 -0
- package/src/resources/submodules/appium/packages/base-driver/docs/mjsonwp/errors.md +82 -0
- package/src/resources/submodules/appium/packages/base-driver/docs/mjsonwp/protocol-methods.md +182 -0
- package/src/resources/submodules/appium/packages/base-driver/static/appium.png +0 -0
- package/src/resources/submodules/appium/packages/base-plugin/CHANGELOG.md +672 -0
- package/src/resources/submodules/appium/packages/base-plugin/README.md +15 -0
- package/src/resources/submodules/appium/packages/docutils/CHANGELOG.md +948 -0
- package/src/resources/submodules/appium/packages/docutils/README.md +27 -0
- package/src/resources/submodules/appium/packages/driver-test-support/CHANGELOG.md +717 -0
- package/src/resources/submodules/appium/packages/driver-test-support/README.md +112 -0
- package/src/resources/submodules/appium/packages/eslint-config-appium-ts/CHANGELOG.md +168 -0
- package/src/resources/submodules/appium/packages/eslint-config-appium-ts/README.md +33 -0
- package/src/resources/submodules/appium/packages/execute-driver-plugin/CHANGELOG.md +603 -0
- package/src/resources/submodules/appium/packages/execute-driver-plugin/README.md +42 -0
- package/src/resources/submodules/appium/packages/fake-driver/CHANGELOG.md +545 -0
- package/src/resources/submodules/appium/packages/fake-driver/README.md +7 -0
- package/src/resources/submodules/appium/packages/fake-driver/lib/screen.png +0 -0
- package/src/resources/submodules/appium/packages/fake-plugin/CHANGELOG.md +683 -0
- package/src/resources/submodules/appium/packages/fake-plugin/README.md +7 -0
- package/src/resources/submodules/appium/packages/images-plugin/CHANGELOG.md +602 -0
- package/src/resources/submodules/appium/packages/images-plugin/README.md +27 -0
- package/src/resources/submodules/appium/packages/images-plugin/docs/find-by-image.md +65 -0
- package/src/resources/submodules/appium/packages/images-plugin/docs/image-comparison.md +203 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/appstore.png +0 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img1.png +0 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img2.png +0 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img2_part.png +0 -0
- package/src/resources/submodules/appium/packages/logger/CHANGELOG.md +162 -0
- package/src/resources/submodules/appium/packages/logger/README.md +31 -0
- package/src/resources/submodules/appium/packages/opencv/CHANGELOG.md +384 -0
- package/src/resources/submodules/appium/packages/opencv/README.md +68 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/appium-diagram.jpg +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc1.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc2.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc_rotated.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/findwaldo.jpg +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/number5.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/waldo.jpg +0 -0
- package/src/resources/submodules/appium/packages/plugin-test-support/CHANGELOG.md +539 -0
- package/src/resources/submodules/appium/packages/plugin-test-support/README.md +49 -0
- package/src/resources/submodules/appium/packages/relaxed-caps-plugin/CHANGELOG.md +154 -0
- package/src/resources/submodules/appium/packages/relaxed-caps-plugin/README.md +35 -0
- package/src/resources/submodules/appium/packages/schema/CHANGELOG.md +271 -0
- package/src/resources/submodules/appium/packages/schema/README.md +50 -0
- package/src/resources/submodules/appium/packages/storage-plugin/CHANGELOG.md +73 -0
- package/src/resources/submodules/appium/packages/storage-plugin/README.md +83 -0
- package/src/resources/submodules/appium/packages/strongbox/CHANGELOG.md +94 -0
- package/src/resources/submodules/appium/packages/strongbox/README.md +96 -0
- package/src/resources/submodules/appium/packages/support/CHANGELOG.md +1054 -0
- package/src/resources/submodules/appium/packages/support/README.md +161 -0
- package/src/resources/submodules/appium/packages/test-support/CHANGELOG.md +712 -0
- package/src/resources/submodules/appium/packages/test-support/README.md +61 -0
- package/src/resources/submodules/appium/packages/tsconfig/CHANGELOG.md +131 -0
- package/src/resources/submodules/appium/packages/tsconfig/README.md +19 -0
- package/src/resources/submodules/appium/packages/types/CHANGELOG.md +793 -0
- package/src/resources/submodules/appium/packages/types/README.md +21 -0
- package/src/resources/submodules/appium/packages/universal-xml-plugin/CHANGELOG.md +435 -0
- package/src/resources/submodules/appium/packages/universal-xml-plugin/README.md +53 -0
- package/src/resources/submodules/appium/renovate/README.md +63 -0
- package/src/resources/submodules/appium-uiautomator2-driver/CHANGELOG.md +1204 -0
- package/src/resources/submodules/appium-uiautomator2-driver/README.md +2077 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/actions.md +72 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/activity-startup.md +47 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/android-appbundle.md +69 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/android-mobile-gestures.md +352 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/bidi.md +50 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/capability-sets.md +136 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/scheduled-actions.md +155 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/uiautomator-uiselector.md +51 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/main.md +95 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/screen1.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/screen2.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/checkered-squares.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/start-button.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/stop-button.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/.github/ISSUE_TEMPLATE.md +4 -0
- package/src/resources/submodules/appium-xcuitest-driver/CHANGELOG.md +2594 -0
- package/src/resources/submodules/appium-xcuitest-driver/README.md +55 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-logo-white.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-logo.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-plus-xctest.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/contributing.md +45 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/endpoints-wda.md +61 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/endpoints.md +98 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/keynote.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/on_my_iphone.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/top_files.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/attach-to-running-wda.md +43 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/audio-capture.md +78 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/capability-sets.md +169 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/ci-setup.md +47 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/clipboard.md +47 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/elements-lookup-troubleshooting.md +158 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/file-transfer.md +147 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/gestures.md +52 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/hybrid.md +137 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/input-events.md +67 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/install-certificate.md +19 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/multiple-xcode-versions.md +37 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/parallel-tests.md +39 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/run-prebuilt-wda.md +135 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/run-preinstalled-wda.md +178 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/touch-id.md +33 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/troubleshooting.md +191 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/tvos.md +114 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/wda-custom-server.md +283 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/wda-slowness.md +231 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/index.md +36 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/installation/index.md +137 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/overview.md +19 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/check-prov-prof.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/create-new-project.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/create-single-page.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/no-prov-prof.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/project-prov-prof.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/set-up-bundle.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/untrusted-dev.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/xcode-bundle-id.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/xcode-config.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/xcode-facebook-fail.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/assets/images/xcode-facebook-succeed.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/index.md +51 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/prov-profile-basic-auto.md +49 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/prov-profile-basic-manual.md +40 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/prov-profile-full-manual.md +50 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/prov-profile-generic-manual.md +49 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/preparation/real-device-config.md +100 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/assets/images/useXctestrunFile.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/bidi.md +75 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/capabilities.md +165 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/commands.md +490 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/element-attributes.md +27 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/execute-methods.md +2206 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/ios-predicate.md +196 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/locator-strategies.md +19 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/scripts.md +29 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/security-flags.md +22 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/server-args.md +16 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/settings.md +49 -0
- package/src/resources/submodules/appium-xcuitest-driver/test/assets/TestApp-iphonesimulator.app/Default-568h@2x.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/test/assets/test.png +0 -0
- package/src/schema.ts +5 -0
- package/src/scripts/simple-index-documentation.ts +93 -0
- package/src/scripts/simple-query-documentation.ts +61 -0
- package/src/server.ts +40 -0
- package/src/tests/README.md +83 -0
- package/src/tests/__mocks__/@appium/support.ts +31 -0
- package/src/tests/generate-all-locators.test.ts +179 -0
- package/src/tests/test-setup-wda.ts +247 -0
- package/src/tools/README.md +171 -0
- package/src/tools/answer-appium.ts +75 -0
- package/src/tools/boot-simulator.ts +87 -0
- package/src/tools/create-session.ts +270 -0
- package/src/tools/delete-session.ts +46 -0
- package/src/tools/documentation/index.ts +97 -0
- package/src/tools/documentation/reasoning-rag.ts +434 -0
- package/src/tools/documentation/sentence-transformers-embeddings.ts +142 -0
- package/src/tools/documentation/simple-pdf-indexer.ts +509 -0
- package/src/tools/documentation/uploads/documents.json +1 -0
- package/src/tools/generate-tests.ts +50 -0
- package/src/tools/index.ts +135 -0
- package/src/tools/install-wda.ts +277 -0
- package/src/tools/interactions/activate-app.ts +46 -0
- package/src/tools/interactions/click.ts +47 -0
- package/src/tools/interactions/double-tap.ts +87 -0
- package/src/tools/interactions/find.ts +58 -0
- package/src/tools/interactions/get-page-source.ts +52 -0
- package/src/tools/interactions/get-text.ts +47 -0
- package/src/tools/interactions/install-app.ts +45 -0
- package/src/tools/interactions/list-apps.ts +65 -0
- package/src/tools/interactions/screenshot.ts +56 -0
- package/src/tools/interactions/set-value.ts +48 -0
- package/src/tools/interactions/terminate-app.ts +47 -0
- package/src/tools/interactions/uninstall-app.ts +47 -0
- package/src/tools/locators.ts +83 -0
- package/src/tools/scroll-to-element.ts +188 -0
- package/src/tools/scroll.ts +97 -0
- package/src/tools/select-device.ts +298 -0
- package/src/tools/select-platform.ts +243 -0
- package/src/tools/session-store.ts +72 -0
- package/src/tools/setup-wda.ts +218 -0
- package/src/types/appium-ios-device.d.ts +8 -0
- package/src/types/appium-xcuitest-driver.d.ts +5 -0
- package/tsconfig.json +23 -0
- package/index.js +0 -0
|
@@ -0,0 +1,866 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Building Drivers
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Appium wants to make it easy for anyone to develop their own automation drivers as part of the
|
|
6
|
+
Appium ecosystem. This guide will explain what's involved and how you can accomplish various driver
|
|
7
|
+
development tasks using the tools Appium provides. This guide assumes you (1) are a competent user of
|
|
8
|
+
Appium, (2) are a competent Node.js developer, and (3) that you have read and understood the
|
|
9
|
+
[Driver Intro](../intro/drivers.md).
|
|
10
|
+
|
|
11
|
+
If that describes you, great! This guide will get you started.
|
|
12
|
+
|
|
13
|
+
## Before you create your driver
|
|
14
|
+
|
|
15
|
+
Before you get to work implementing your driver, it's important to have a few things sorted out.
|
|
16
|
+
For example, you need to know what your driver will do. Which platform is it trying to expose
|
|
17
|
+
WebDriver automation for?
|
|
18
|
+
|
|
19
|
+
Appium doesn't magically give you the power to automate any platform. All it does is give you a set
|
|
20
|
+
of convenient tools for implementing the WebDriver Protocol. So if you want to create, for example,
|
|
21
|
+
a driver for a new app platform, you'll need to know how to automate apps on that platform _without Appium_.
|
|
22
|
+
|
|
23
|
+
This usually means that you need to be very familiar with app development for a given platform. And
|
|
24
|
+
it usually means that you will rely on tools or SDKs provided by the platform vendor.
|
|
25
|
+
|
|
26
|
+
Basically, if you can't answer the question **"how would I launch, remotely trigger behaviours, and
|
|
27
|
+
read state from an app on this platform?" then you're not quite ready to write an Appium driver**.
|
|
28
|
+
Make sure you do the research to feel comfortable that there _is_ a path forward. Once there is,
|
|
29
|
+
coding it up and making it available as an Appium driver should be the easy part!
|
|
30
|
+
|
|
31
|
+
## Other drivers to reference
|
|
32
|
+
|
|
33
|
+
One of the greatest things about building an Appium driver is that there are already a number of
|
|
34
|
+
open source Appium drivers which you can look at for reference. There is
|
|
35
|
+
a [fake-driver](https://github.com/appium/appium/tree/master/packages/fake-driver) sample driver which
|
|
36
|
+
does basically nothing other than showcase some of the things described in this guide.
|
|
37
|
+
|
|
38
|
+
And of course, all of Appium's official drivers are open source and available in repositories at
|
|
39
|
+
the project's GitHub organization. So if you ever find yourself asking, "how does a driver do X?",
|
|
40
|
+
read the code for these drivers! Also don't be afraid to ask questions of the Appium developers if
|
|
41
|
+
you get stuck; we're always happy to help make sure the driver development experience is a good
|
|
42
|
+
one!
|
|
43
|
+
|
|
44
|
+
## Basic requirements for Appium drivers
|
|
45
|
+
|
|
46
|
+
These are the things your driver _must_ do (or be), if you want it to be a valid Appium driver.
|
|
47
|
+
|
|
48
|
+
### Node.js package with Appium extension metadata
|
|
49
|
+
|
|
50
|
+
All Appium drivers are fundamentally Node.js packages, and therefore must have a valid
|
|
51
|
+
`package.json`. Your driver is not _limited_ to Node.js, but it must provide an adapter written in Node.js so it can be loaded by Appium.
|
|
52
|
+
|
|
53
|
+
Your `package.json` must include `appium` as a `peerDependency`. The requirements for the
|
|
54
|
+
dependency versions should be as loose as possible (unless you happen to know your driver will only
|
|
55
|
+
work with certain versions of Appium). For Appium 2, for example, this would look something like
|
|
56
|
+
`^2.0.0`, declaring that your driver works with any version of Appium that starts with 2.x.
|
|
57
|
+
|
|
58
|
+
Your `package.json` must contain an `appium` field, like this (we call this the 'Appium extension
|
|
59
|
+
metadata'):
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
...,
|
|
64
|
+
"appium": {
|
|
65
|
+
"driverName": "fake",
|
|
66
|
+
"automationName": "Fake",
|
|
67
|
+
"platformNames": [
|
|
68
|
+
"Fake"
|
|
69
|
+
],
|
|
70
|
+
"mainClass": "FakeDriver"
|
|
71
|
+
},
|
|
72
|
+
...
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The required subfields are:
|
|
77
|
+
|
|
78
|
+
- `driverName`: this should be a short name for your driver.
|
|
79
|
+
- `automationName`: this should be the string users will use for their `appium:automationName`
|
|
80
|
+
capability to tell Appium to use _your_ driver.
|
|
81
|
+
- `platformNames`: this is an array of one or more platform names considered valid for your driver.
|
|
82
|
+
When a user sends in the `platformName` capability to start a session, it must be included in
|
|
83
|
+
this list for your driver to handle the session. Known platform name strings include: `iOS`,
|
|
84
|
+
`tvOS`, `macOS`, `Windows`, `Android`.
|
|
85
|
+
- `mainClass`: this is a named export (in CommonJS style) from your `main` field. It must be a
|
|
86
|
+
class which extends Appium's `BaseDriver` (see below).
|
|
87
|
+
|
|
88
|
+
### Extend Appium's `BaseDriver` class
|
|
89
|
+
|
|
90
|
+
Ultimately, your driver is much easier to write because most of the hard work of implementing the
|
|
91
|
+
WebDriver protocol and handling certain common logic is taken care of already by Appium. This is
|
|
92
|
+
all encoded up as a class which Appium exports for you to use, called `BaseDriver`. It is exported
|
|
93
|
+
from `appium/driver`, so you can use one of these styles to import it and create your _own_ class
|
|
94
|
+
that extends it:
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
import {BaseDriver} from 'appium/driver';
|
|
98
|
+
// or: const {BaseDriver} = require('appium/driver');
|
|
99
|
+
|
|
100
|
+
export class MyDriver extends BaseDriver {
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Make your driver available
|
|
105
|
+
|
|
106
|
+
That's basically it! With a Node.js package exporting a driver class and with correct Appium
|
|
107
|
+
extension metadata, you've got yourself an Appium driver! Now it doesn't _do_ anything, but you can
|
|
108
|
+
load it up in Appium, start and stop sessions with it, etc...
|
|
109
|
+
|
|
110
|
+
To make it available to users, you could publish it via NPM. When you do so, your driver will be
|
|
111
|
+
installable via the Appium CLI:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
appium driver install --source=npm <driver-package-on-npm>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
It's a good idea to test your driver first, of course. One way to see how it works within Appium is
|
|
118
|
+
to install it locally first:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
appium driver install --source=local /path/to/your/driver
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Developing your driver
|
|
125
|
+
|
|
126
|
+
How you develop your driver is up to you. It is convenient, however, to run it from within Appium
|
|
127
|
+
without having to do lots of publishing and installing. The most straightforward way to do this is
|
|
128
|
+
to include the most recent version of Appium as a `devDependency`, and then also your own driver,
|
|
129
|
+
like this:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"devDependencies": {
|
|
134
|
+
...,
|
|
135
|
+
"appium": "^2.0.0",
|
|
136
|
+
"your-driver": "file:.",
|
|
137
|
+
...
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Now, you can run Appium locally (`npm exec appium` or `npx appium`), and because your driver is
|
|
143
|
+
listed as a dependency alongside it, it will be automatically "installed" and available. You can
|
|
144
|
+
design your e2e tests this way, or if you're writing them in Node.js, you can simply import
|
|
145
|
+
Appium's start server methods to handle starting and stopping the Appium server in Node. (TODO:
|
|
146
|
+
reference an implementation of this in one of the open source drivers when ready).
|
|
147
|
+
|
|
148
|
+
Another way to do local development with an existing Appium server install is to simply install
|
|
149
|
+
your driver locally:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
appium driver install --source=local /path/to/your/driver/dev/dir
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Refreshing your driver during development
|
|
156
|
+
|
|
157
|
+
When the Appium server starts, it loads your driver into memory. Changes to your driver code will
|
|
158
|
+
not take effect until the next time the Appium server starts. Simply starting a new session is not
|
|
159
|
+
sufficient to cause your driver's code to be reloaded.
|
|
160
|
+
|
|
161
|
+
However, you can set the `APPIUM_RELOAD_EXTENSIONS` environment variable to `1` to request that
|
|
162
|
+
Appium clear its module cache and reload extensions whenever a new session is requested. This may
|
|
163
|
+
obviate the need to restart the server when you make code changes to your driver.
|
|
164
|
+
|
|
165
|
+
## Standard driver implementation ideas
|
|
166
|
+
|
|
167
|
+
These are things you will probably find yourself wanting to do when creating a driver.
|
|
168
|
+
|
|
169
|
+
### Set up state in a constructor
|
|
170
|
+
|
|
171
|
+
If you define your own constructor, you'll need to call `super` to make sure all the standard state
|
|
172
|
+
is set up correctly:
|
|
173
|
+
|
|
174
|
+
```js
|
|
175
|
+
constructor(...args) {
|
|
176
|
+
super(...args);
|
|
177
|
+
// now do your own thing
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The `args` parameter here is the object containing all the CLI args used to start the Appium
|
|
182
|
+
server.
|
|
183
|
+
|
|
184
|
+
### Define and validate accepted capabilities
|
|
185
|
+
|
|
186
|
+
You can define your own capabilities and basic validation for them. Users will always be able to
|
|
187
|
+
send in capabilities that you don't define, but if they send in capabilities you have explicitly
|
|
188
|
+
defined, then Appium will validate that they are of the correct type (and will check for the
|
|
189
|
+
presence of required capabilities).
|
|
190
|
+
|
|
191
|
+
If you want to turn capability validation off entirely, set `this.shouldValidateCaps` to `false` in
|
|
192
|
+
your constructor.
|
|
193
|
+
|
|
194
|
+
To give Appium your validation constraints, set `this.desiredCapConstraints` to a validation object
|
|
195
|
+
in your constructor. Validation objects can be somewhat complex. Here's an example from the
|
|
196
|
+
UiAutomator2 driver:
|
|
197
|
+
|
|
198
|
+
```js
|
|
199
|
+
{
|
|
200
|
+
app: {
|
|
201
|
+
presence: true,
|
|
202
|
+
isString: true
|
|
203
|
+
},
|
|
204
|
+
automationName: {
|
|
205
|
+
isString: true
|
|
206
|
+
},
|
|
207
|
+
browserName: {
|
|
208
|
+
isString: true
|
|
209
|
+
},
|
|
210
|
+
launchTimeout: {
|
|
211
|
+
isNumber: true
|
|
212
|
+
},
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Start a session and read capabilities
|
|
217
|
+
|
|
218
|
+
Appium's `BaseDriver` already implements the `createSession` command, so you don't have to. However
|
|
219
|
+
it's very common to need to perform your own startup actions (launching an app, running some
|
|
220
|
+
platform code, or doing different things based on capabilities you have defined for your driver).
|
|
221
|
+
So you'll probably end up overriding `createSession`. You can do so by defining the method in your
|
|
222
|
+
driver:
|
|
223
|
+
|
|
224
|
+
```js
|
|
225
|
+
async createSession(jwpCaps, reqCaps, w3cCaps, otherDriverData) {
|
|
226
|
+
const [sessionId, caps] = super.createSession(w3cCaps);
|
|
227
|
+
// do your own stuff here
|
|
228
|
+
return [sessionId, caps];
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
For legacy reasons, your function will receive old-style JSON Wire Protocol desired and required
|
|
233
|
+
caps as the first two arguments. Given that the old protocol isn't supported anymore and clients
|
|
234
|
+
have all been updated, you can instead only rely on the `w3cCaps` parameter. (For a discussion
|
|
235
|
+
about what `otherDriverData` is about, see the section below on concurrent drivers).
|
|
236
|
+
|
|
237
|
+
You'll want to make sure to call `super.createSession` in order to get the session ID as well as
|
|
238
|
+
the processed capabilities (note that capabilities are also set on `this.caps`; modifying `caps`
|
|
239
|
+
locally here would have no effect other than changing what the user sees in the create session
|
|
240
|
+
response).
|
|
241
|
+
|
|
242
|
+
So that's it! You can fill out the middle section with whatever startup logic your driver requires.
|
|
243
|
+
|
|
244
|
+
### End a session
|
|
245
|
+
|
|
246
|
+
If your driver requires any cleanup or shutdown logic, it's best to do it as part of overriding the
|
|
247
|
+
implementation of `deleteSession`:
|
|
248
|
+
|
|
249
|
+
```js
|
|
250
|
+
async deleteSession() {
|
|
251
|
+
// do your own cleanup here
|
|
252
|
+
// don't forget to call super!
|
|
253
|
+
await super.deleteSession();
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
It's very important not to throw any errors here if possible so that all parts of session cleanup
|
|
258
|
+
can succeed!
|
|
259
|
+
|
|
260
|
+
### Access capabilities and CLI args
|
|
261
|
+
|
|
262
|
+
You'll often want to read parameters the user has set for the session, whether as CLI args or as
|
|
263
|
+
capabilities. The easiest way to do this is to access `this.opts`, which is a merge of all options,
|
|
264
|
+
from the CLI or from capabilities. So for example to access the `appium:app` capability, you could
|
|
265
|
+
simply get the value of `this.opts.app`.
|
|
266
|
+
|
|
267
|
+
If you care about knowing whether something was sent in as a CLI arg _or_ a capability, you can
|
|
268
|
+
access the `this.cliArgs` and `this.caps` objects explicitly.
|
|
269
|
+
|
|
270
|
+
In all cases, the `appium:` capability prefix will have been stripped away by the time you are
|
|
271
|
+
accessing values here, for convenience.
|
|
272
|
+
|
|
273
|
+
### Implement WebDriver classic commands
|
|
274
|
+
|
|
275
|
+
You handle WebDriver commands by implementing functions in your driver class. Each member of the
|
|
276
|
+
WebDriver Protocol, plus the various Appium extensions, has a corresponding function that you
|
|
277
|
+
implement if you want to support that command in your driver. The best way to see which commands
|
|
278
|
+
Appium supports and which method you need to implement for each command is to look at Appium's
|
|
279
|
+
[routes.js](https://github.com/appium/appium/blob/master/packages/base-driver/lib/protocol/routes.js).
|
|
280
|
+
Each route object in this file tells you the command name as well as the parameters you'd expect to
|
|
281
|
+
receive for that command.
|
|
282
|
+
|
|
283
|
+
Let's take this block for example:
|
|
284
|
+
|
|
285
|
+
```js
|
|
286
|
+
'/session/:sessionId/url': {
|
|
287
|
+
GET: {command: 'getUrl'},
|
|
288
|
+
POST: {command: 'setUrl', payloadParams: {required: ['url']}},
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Here we see that the route `/session/:sessionId/url` is mapped to two commands, one for a `GET`
|
|
293
|
+
request and one for a `POST` request. If we want to allow our driver to change the "url" (or
|
|
294
|
+
whatever that might mean for our driver), we can therefore implement the `setUrl` command, knowing
|
|
295
|
+
it will take the `url` parameter:
|
|
296
|
+
|
|
297
|
+
```js
|
|
298
|
+
async setUrl(url) {
|
|
299
|
+
// your implementation here
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
A few notes:
|
|
304
|
+
|
|
305
|
+
- all command methods should be `async` functions or otherwise return a `Promise`
|
|
306
|
+
- you don't need to worry about protocol encoding/decoding. You will get JS objects as params, and
|
|
307
|
+
can return JSON-serializable objects in response. Appium will take care of wrapping it up in the
|
|
308
|
+
WebDriver protocol response format, turning it into JSON, etc...
|
|
309
|
+
- all session-based commands receive the `sessionId` parameter as the last parameter
|
|
310
|
+
- all element-based commands receive the `elementId` parameter as the second-to-last parameter
|
|
311
|
+
- if your driver doesn't implement a command, users can still try to access the command, and will
|
|
312
|
+
get a `501 Not Yet Implemented` response error.
|
|
313
|
+
|
|
314
|
+
### Implement WebDriver BiDi commands
|
|
315
|
+
|
|
316
|
+
[WebDriver BiDi](https://w3c.github.io/webdriver-bidi) is a newer version of the WebDriver spec
|
|
317
|
+
which is implemented over Websockets instead of HTTP. As an Appium driver author you can take
|
|
318
|
+
advantage of Appium's BiDi support without having to know anything about the BiDi protocol or
|
|
319
|
+
Websockets. Implementing handlers for BiDi commands works just the same as implementing handlers
|
|
320
|
+
for WebDriver classic commands (described in the previous section). You simply define a method on
|
|
321
|
+
your driver of the appropriate name, and it will be called when the BiDi command is requested by
|
|
322
|
+
the client. To see which specific names you should use for BiDi commands, have a look at
|
|
323
|
+
[bidi-commands.js](https://github.com/appium/appium/blob/master/packages/base-driver/lib/protocol/bidi-commands.js)
|
|
324
|
+
|
|
325
|
+
You are not limited to BiDi commands that are defined in the official BiDi specification. If you
|
|
326
|
+
wish to define new commands, you may do so; you just need to tell Appium about them! See
|
|
327
|
+
[below](#extend-the-existing-protocol-with-new-commands) for more information.
|
|
328
|
+
|
|
329
|
+
### Implement element finding
|
|
330
|
+
|
|
331
|
+
Element finding is a special command implementation case. You don't actually want to override
|
|
332
|
+
`findElement` or `findElements`, even though those are what are listed in `routes.js`. Appium does
|
|
333
|
+
a lot of work for you if instead you implement this function:
|
|
334
|
+
|
|
335
|
+
```js
|
|
336
|
+
async findElOrEls(strategy, selector, mult, context) {
|
|
337
|
+
// find your element here
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Here's what gets passed in:
|
|
342
|
+
|
|
343
|
+
- `strategy` - a string, the locator strategy being used
|
|
344
|
+
- `selector` - a string, the selector
|
|
345
|
+
- `mult` - boolean, whether the user has requested one element or all elements matching the
|
|
346
|
+
selector
|
|
347
|
+
- `context` - (optional) if defined, will be a W3C Element (i.e., a JS object with the W3C element
|
|
348
|
+
identifier as the key and the element ID as the value)
|
|
349
|
+
|
|
350
|
+
And you need to return one of the following:
|
|
351
|
+
|
|
352
|
+
- a single W3C element (an object as described above)
|
|
353
|
+
- an array of W3C elements
|
|
354
|
+
|
|
355
|
+
Note that you can import that W3C web element identifier from `appium/support`:
|
|
356
|
+
|
|
357
|
+
```js
|
|
358
|
+
import {util} from 'appium/support';
|
|
359
|
+
const { W3C_WEB_ELEMENT_IDENTIFIER } = util;
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
What you do with elements is up to you! Usually you end up keeping a cache map of IDs to actual
|
|
363
|
+
element "objects" or whatever the equivalent is for your platform.
|
|
364
|
+
|
|
365
|
+
### Define valid locator strategies
|
|
366
|
+
|
|
367
|
+
Your driver might only support a subset of the standard WebDriver locator strategies, or it might
|
|
368
|
+
add its own custom locator strategies. To tell Appium which strategies are considered valid for
|
|
369
|
+
your driver, create an array of strategies and assign it to `this.locatorStrategies`:
|
|
370
|
+
|
|
371
|
+
```js
|
|
372
|
+
this.locatorStrategies = ['xpath', 'custom-strategy'];
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Appium will throw an error if the user attempts to use any strategies other than the allowed ones,
|
|
376
|
+
which enables you to keep your element finding code clean and deal with only the strategies you
|
|
377
|
+
know about.
|
|
378
|
+
|
|
379
|
+
By default, the list of valid strategies is empty, so if your driver isn't simply proxying to
|
|
380
|
+
another WebDriver endpoint, you'll need to define some. The protocol-standard locator strategies
|
|
381
|
+
are defined [here](https://www.w3.org/TR/webdriver/#locator-strategies).
|
|
382
|
+
|
|
383
|
+
### Throw WebDriver-specific errors
|
|
384
|
+
|
|
385
|
+
The WebDriver spec defines a set of error
|
|
386
|
+
codes to accompany command responses if an
|
|
387
|
+
error occurred. Appium has created error classes for each of these codes, so you can throw the
|
|
388
|
+
appropriate error from inside a command, and it will do the right thing in terms of the protocol
|
|
389
|
+
response to the user. To get access to these error classes, import them from `appium/driver`:
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
import {errors} from 'appium/driver';
|
|
393
|
+
|
|
394
|
+
throw new errors.NoSuchElementError();
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Log messages to the Appium log
|
|
398
|
+
|
|
399
|
+
You can always use `console.log`, of course, but Appium provides a nice logger for you as
|
|
400
|
+
`this.log` (it has `.info`, `.debug`, `.log`, `.warn`, `.error` methods on it for differing log
|
|
401
|
+
levels). If you want to create an Appium logger outside of a driver context (say in a script or
|
|
402
|
+
helper file), you can always construct your own too:
|
|
403
|
+
|
|
404
|
+
```js
|
|
405
|
+
import {logging} from 'appium/support';
|
|
406
|
+
const log = logging.getLogger('MyDriver');
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
## Further possibilities for Appium drivers
|
|
410
|
+
|
|
411
|
+
These are things your driver _can_ do to take advantage of extra driver features or do its job more
|
|
412
|
+
conveniently.
|
|
413
|
+
|
|
414
|
+
### Add a schema for custom command line arguments
|
|
415
|
+
|
|
416
|
+
You can add custom CLI args if you want your driver to receive data from the command line when the
|
|
417
|
+
Appium server is started (for example, ports that a server administrator should set that should not
|
|
418
|
+
be passed in as capabilities.
|
|
419
|
+
|
|
420
|
+
To define CLI arguments (or configuration properties) for the Appium server, your extension must provide a _schema_. In
|
|
421
|
+
the `appium` property of your extension's `package.json`, add a `schema` property. This will either
|
|
422
|
+
a) be a schema itself, or b) be a path to a schema file.
|
|
423
|
+
|
|
424
|
+
The rules for these schemas:
|
|
425
|
+
|
|
426
|
+
- Schemas must conform to [JSON Schema Draft-07](https://ajv.js.org/json-schema.html#draft-07).
|
|
427
|
+
- If the `schema` property is a path to a schema file, the file must be in JSON or JS (CommonJS) format.
|
|
428
|
+
- Custom `$id` values are unsupported. To use `$ref`, provide a value relative to the schema root, e.g., `/properties/foo`.
|
|
429
|
+
- Known values of the `format` keyword are likely supported, but various other keywords may be unsupported. If you find a keyword that is unsupported which you need to use, please [ask for support](https://github.com/appium/appium/issues/new) or send a PR!
|
|
430
|
+
- The schema must be of type `object` (`{"type": "object"}`), containing the arguments in a `properties` keyword. Nested properties are unsupported.
|
|
431
|
+
|
|
432
|
+
Example:
|
|
433
|
+
|
|
434
|
+
```json
|
|
435
|
+
{
|
|
436
|
+
"type": "object",
|
|
437
|
+
"properties": {
|
|
438
|
+
"test-web-server-port": {
|
|
439
|
+
"type": "integer",
|
|
440
|
+
"minimum": 1,
|
|
441
|
+
"maximum": 65535,
|
|
442
|
+
"description": "The port to use for the test web server"
|
|
443
|
+
},
|
|
444
|
+
"test-web-server-host": {
|
|
445
|
+
"type": "string",
|
|
446
|
+
"description": "The host to use for the test web server",
|
|
447
|
+
"default": "sillyhost"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
The above schema defines two properties which can be set via CLI argument or configuration file. If
|
|
454
|
+
this extension is a _driver_ and its name is "horace", the CLI args would be
|
|
455
|
+
`--driver-horace-test-web-server-port` and `--driver-horace-test-web-server-host`, respectively.
|
|
456
|
+
Alternatively, a user could provide a configuration file containing:
|
|
457
|
+
|
|
458
|
+
```json
|
|
459
|
+
{
|
|
460
|
+
"server": {
|
|
461
|
+
"driver": {
|
|
462
|
+
"horace": {
|
|
463
|
+
"test-web-server-port": 1234,
|
|
464
|
+
"test-web-server-host": "localhorse"
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### Add driver scripts
|
|
472
|
+
|
|
473
|
+
Sometimes you might want users of your driver to be able to run scripts outside the context of
|
|
474
|
+
a session (for example, to run a script that pre-builds aspects of your driver). To support this,
|
|
475
|
+
you can add a map of script names and JS files to the `scripts` field within your Appium extension
|
|
476
|
+
metadata. So let's say you've created a script in your project that lives in a `scripts` directory
|
|
477
|
+
in your project, named `driver-prebuild.js`. Then you could add a `scripts` field like this:
|
|
478
|
+
|
|
479
|
+
```json
|
|
480
|
+
{
|
|
481
|
+
"scripts": {
|
|
482
|
+
"prebuild": "./scripts/driver-prebuild.js"
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
Now, assuming your driver is named `mydriver`, users of your driver can run `appium driver run
|
|
488
|
+
mydriver prebuild`, and your script will execute.
|
|
489
|
+
|
|
490
|
+
### Proxy commands to another WebDriver implementation
|
|
491
|
+
|
|
492
|
+
A very common design architecture for Appium drivers is to have some kind of platform-specific
|
|
493
|
+
WebDriver implementation that the Appium driver interfaces with. For example, the Appium
|
|
494
|
+
UiAutomator2 driver interfaces with a special (Java-based) server running on the Android device. In
|
|
495
|
+
webview mode, it also interfaces with Chromedriver.
|
|
496
|
+
|
|
497
|
+
If you find yourself in this situation, it is extremely easy to tell Appium that your driver is
|
|
498
|
+
just going to be proxying WebDriver commands straight to another endpoint.
|
|
499
|
+
|
|
500
|
+
First, let Appium know that your driver _can_ proxy by implementing the `canProxy` method:
|
|
501
|
+
|
|
502
|
+
```js
|
|
503
|
+
canProxy() {
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
Next, tell Appium which WebDriver routes it should _not_ attempt to proxy (there often end up being
|
|
509
|
+
certain routes that you don't want to forward on):
|
|
510
|
+
|
|
511
|
+
```js
|
|
512
|
+
getProxyAvoidList() {
|
|
513
|
+
return [
|
|
514
|
+
['POST', new RegExp('^/session/[^/]+/appium')]
|
|
515
|
+
];
|
|
516
|
+
}
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
The proxy avoidance list should be an array of arrays, where each inner array has an HTTP method as
|
|
520
|
+
its first member, and a regular expression as its second. If the regular expression matches the
|
|
521
|
+
route, then the route will not be proxied and instead will be handled by your driver. In this
|
|
522
|
+
example, we are avoiding proxying all `POST` routes that have the `appium` prefix.
|
|
523
|
+
|
|
524
|
+
Next, we have to set up the proxying itself. The way to do this is to use a special class from
|
|
525
|
+
Appium called `JWProxy`. (The name means "JSON Wire Proxy" and is related to a legacy
|
|
526
|
+
implementation of the protocol). You'll want to create a `JWProxy` object using the details required to
|
|
527
|
+
connect to the remote server:
|
|
528
|
+
|
|
529
|
+
```js
|
|
530
|
+
// import {JWProxy} from 'appium/driver';
|
|
531
|
+
|
|
532
|
+
const proxy = new JWProxy({
|
|
533
|
+
server: 'remote.server',
|
|
534
|
+
port: 1234,
|
|
535
|
+
base: '/',
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
this.proxyReqRes = proxy.proxyReqRes.bind(proxy);
|
|
539
|
+
this.proxyCommand = proxy.command.bind(proxy);
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Here we are creating a proxy object and assigning some of its methods to `this` under the names
|
|
543
|
+
`proxyReqRes` and `proxyCommand`. This is required for Appium to use the proxy, so don't forget
|
|
544
|
+
this step! The `JWProxy` has a variety of other options which you can check out in the source code,
|
|
545
|
+
as well. (TODO: publish options as API docs and link here).
|
|
546
|
+
|
|
547
|
+
Finally, we need a way to tell Appium when the proxy is active. For your driver it might always
|
|
548
|
+
be active, or it might only be active when in a certain context. You can define the logic as an
|
|
549
|
+
implementation of `proxyActive`:
|
|
550
|
+
|
|
551
|
+
```js
|
|
552
|
+
proxyActive() {
|
|
553
|
+
return true; // or use custom logic
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
With those pieces in play, you won't have to reimplement anything that's already implemented by the
|
|
558
|
+
remote endpoint you're proxying to. Appium will take care of all the proxying for you.
|
|
559
|
+
|
|
560
|
+
### Proxy BiDi commands to another BiDi implementation
|
|
561
|
+
|
|
562
|
+
All of the above about proxying WebDriver commands is conceptually also valid for proxying BiDi
|
|
563
|
+
commands specifically. In order to enable BiDi proxying, you need to implement `get bidiProxyUrl`
|
|
564
|
+
on your driver. This should return a Websocket URL which is the address of the upstream socket you
|
|
565
|
+
want BiDi commands to be proxied to.
|
|
566
|
+
|
|
567
|
+
The intended pattern here is for you to start a session on the upstream implementation, check
|
|
568
|
+
whether it has an active BiDi socket in the returned capabilities (e.g., the `webSocketUrl`
|
|
569
|
+
capability), and then to set an internal field to that value, so that it can be returned by `get
|
|
570
|
+
bidiProxyUrl`. Once all this is in place, Appium will proxy BiDi commands from the client straight
|
|
571
|
+
to the upstream connection.
|
|
572
|
+
|
|
573
|
+
### Extend the existing protocol with new commands
|
|
574
|
+
|
|
575
|
+
You may find that the existing commands don't cut it for your driver. If you want to expose
|
|
576
|
+
behaviours that don't map to any of the existing commands, you can create new commands in one of
|
|
577
|
+
three ways:
|
|
578
|
+
|
|
579
|
+
1. Extending the classic WebDriver protocol and creating client-side plugins to access the extensions via the classic HTTP interface
|
|
580
|
+
2. Extending the WebDriver BiDi protocol with new modules and methods, accessed from a client via the BiDi interface
|
|
581
|
+
3. Overloading the Execute Script command by defining Execute
|
|
582
|
+
Methods
|
|
583
|
+
|
|
584
|
+
If you want to follow the first path, you can direct Appium to recognize new methods and add them
|
|
585
|
+
to its set of allowed HTTP routes and command names. You do this by assigning the `newMethodMap`
|
|
586
|
+
static variable in your driver class to an object of the same form as Appium's `routes.js` object.
|
|
587
|
+
For example, here is the `newMethodMap` for the `FakeDriver` example driver:
|
|
588
|
+
|
|
589
|
+
```js
|
|
590
|
+
static newMethodMap = {
|
|
591
|
+
'/session/:sessionId/fakedriver': {
|
|
592
|
+
GET: {command: 'getFakeThing'},
|
|
593
|
+
POST: {command: 'setFakeThing', payloadParams: {required: ['thing']}},
|
|
594
|
+
},
|
|
595
|
+
'/session/:sessionId/fakedriverargs': {
|
|
596
|
+
GET: {command: 'getFakeDriverArgs'},
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
In this example we're adding a few new routes and a total of 3 new commands. For more examples of
|
|
602
|
+
how to define commands in this way, it's best to have a look through `routes.js`. Now all you need
|
|
603
|
+
to do is implement the command handlers in the same way you'd implement any other Appium command.
|
|
604
|
+
|
|
605
|
+
The downside of this way of adding new commands is that people using the standard Appium clients
|
|
606
|
+
won't have nice client-side functions designed to target these endpoints. So you would need to
|
|
607
|
+
create and release client-side plugins for each language you want to support (directions or
|
|
608
|
+
examples can be found at the relevant client docs).
|
|
609
|
+
|
|
610
|
+
The second way of adding new commands is adding them as BiDi commands (accessed via the BiDi
|
|
611
|
+
websocket interface, rather than the classic HTTP interface). BiDi commands come in two parts:
|
|
612
|
+
a "module", which is basically a container or namespace, and a "command", which is the name of your
|
|
613
|
+
new command.
|
|
614
|
+
|
|
615
|
+
As with the first method, you teach Appium to recognize your new BiDi commands by adding a static
|
|
616
|
+
field to your driver class, called `newBidiCommands`. It has a format similar to `newMethodMap`.
|
|
617
|
+
Basically it encapsulates information about the BiDi module, BiDi command name, reference to your
|
|
618
|
+
driver instance method that will handle the command, and required and optional parameters. Here's
|
|
619
|
+
an example of a `newBidiCommands` as implemented on an imaginary driver:
|
|
620
|
+
|
|
621
|
+
```js
|
|
622
|
+
static newBidiCommands = {
|
|
623
|
+
'appium:video': {
|
|
624
|
+
startFramerateCapture: {
|
|
625
|
+
command: 'startFrameCap',
|
|
626
|
+
params: {
|
|
627
|
+
required: ['videoSource'],
|
|
628
|
+
optional: ['showOnScreen'],
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
stopFramerateCapture: {
|
|
632
|
+
command: 'stopFrameCap',
|
|
633
|
+
},
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
In this imaginary example, we have defined two new BiDi commands:
|
|
639
|
+
`appium:video.startFramerateCapture` and `appium:video.stopFramerateCapture`. Note first of all
|
|
640
|
+
that, because we are defining a custom BiDi command, we should include a 'vendor prefix' (in this
|
|
641
|
+
case, `appium:`, though you should pick something that represents your project). The first command
|
|
642
|
+
takes a required and an optional parameter, and the second does not. When combined with generic
|
|
643
|
+
BiDi support in your driver (see [the section on BiDi](#implement-webdriver-bidi-commands) above),
|
|
644
|
+
and given an implementation of the appropriate methods on your driver (e.g. `startFrameCap` and
|
|
645
|
+
`stopFrameCap` in this example), clients would be able to send these BiDi commands using whatever
|
|
646
|
+
mechanism normally exists for doing so in the client library.
|
|
647
|
+
|
|
648
|
+
An alternative to these other ways of doing things is to overload a command which all WebDriver clients
|
|
649
|
+
have access to already: Execute Script. Appium provides some a convenient tool for making this
|
|
650
|
+
easy. Let's say you are building a driver for stereo system called `soundz`, and you wanted to
|
|
651
|
+
create a command for playing a song by name. You could expose this to your users in such a way that
|
|
652
|
+
they call something like:
|
|
653
|
+
|
|
654
|
+
```js
|
|
655
|
+
// webdriverio example. Calling webdriverio's `executeScript` command is what trigger's Appium's
|
|
656
|
+
// Execute Script command handler
|
|
657
|
+
driver.executeScript('soundz: playSong', [{song: 'Stairway to Heaven', artist: 'Led Zeppelin'}]);
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
Then in your driver code you can define the static property `executeMethodMap` as a mapping of
|
|
661
|
+
script names to methods on your driver. It has the same basic form as `newMethodMap`, described
|
|
662
|
+
above. Once `executeMethodMap` is defined, you'll also need to implement the Execute Script command
|
|
663
|
+
handler, which according to Appium's routes mapping is called `execute`. The implementation can
|
|
664
|
+
call a single helper function, `this.executeMethod`, which takes care of looking at the script and
|
|
665
|
+
arguments the user sent in and routing it to the correct custom handler you've defined. Here's an
|
|
666
|
+
example:
|
|
667
|
+
|
|
668
|
+
```js
|
|
669
|
+
static executeMethodMap = {
|
|
670
|
+
'soundz: playSong', {
|
|
671
|
+
command: 'soundzPlaySong',
|
|
672
|
+
params: {required: ['song', 'artist'], optional: []},
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
async soundzPlaySong(song, artist) {
|
|
677
|
+
// play the song based on song and artist details
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
async execute(script, args) {
|
|
681
|
+
return await this.executeMethod(script, args);
|
|
682
|
+
}
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
A couple notes about this system:
|
|
686
|
+
|
|
687
|
+
1. The arguments array sent via the call to Execute Script must contain only zero or one element(s). The
|
|
688
|
+
first item in the list is considered to be the parameters object for your method. These parameters
|
|
689
|
+
will be parsed, validated, and then applied to your overload method in the order specified in
|
|
690
|
+
`executeMethodMap` (the order specified in the `required` parameters list, followed by the
|
|
691
|
+
`optional` parameters list). I.e., this framework assumes only a single actual argument sent in via
|
|
692
|
+
Execute Script (and this argument should be an object with keys/values representing the
|
|
693
|
+
parameters your execute method expects).
|
|
694
|
+
2. Appium does not automatically implement `execute` (the Execute Script handler) for you. You may
|
|
695
|
+
wish, for example, to only call the `executeMethod` helper function when you're not in proxy
|
|
696
|
+
mode!
|
|
697
|
+
3. The `executeMethod` helper will reject with an error if a script name doesn't match one of the
|
|
698
|
+
script names defined as a command in `executeMethodMap`, or if there are missing parameters.
|
|
699
|
+
|
|
700
|
+
One of the nice things about the Execute Method strategy is that methods implemented in this way
|
|
701
|
+
will be available via the classic or BiDi interfaces (since they will result in the same Appium
|
|
702
|
+
handlers being called).
|
|
703
|
+
|
|
704
|
+
### Build Appium Doctor checks
|
|
705
|
+
|
|
706
|
+
Your users can run `appium driver doctor <driverName>` to run installation and health checks. Visit
|
|
707
|
+
the [Building Doctor Checks](./build-doctor-checks.md) guide for more information on this
|
|
708
|
+
capability.
|
|
709
|
+
|
|
710
|
+
### Implement handling of Appium settings
|
|
711
|
+
|
|
712
|
+
Appium users can send parameters to your driver via CLI args as well as via capabilities. But these
|
|
713
|
+
cannot change during the course of a test, and sometimes users want to adjust parameters mid-test.
|
|
714
|
+
Appium has a [Settings](../guides/settings.md) API for this purpose.
|
|
715
|
+
|
|
716
|
+
To support settings in your own driver, first of all define `this.settings` to be an instance of
|
|
717
|
+
the appropriate class, in your constructor:
|
|
718
|
+
|
|
719
|
+
```js
|
|
720
|
+
// import {DeviceSettings} from 'appium/driver';
|
|
721
|
+
|
|
722
|
+
this.settings = new DeviceSettings();
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
Now, you can read user settings any time simply by calling `this.settings.getSettings()`. This will
|
|
726
|
+
return a JS object where the settings names are keys and have their corresponding values.
|
|
727
|
+
|
|
728
|
+
If you want to assign some default settings, or run some code on your end whenever settings are
|
|
729
|
+
updated, you can do both of these things as well.
|
|
730
|
+
|
|
731
|
+
```js
|
|
732
|
+
constructor() {
|
|
733
|
+
const defaults = {setting1: 'value1'};
|
|
734
|
+
this.settings = new DeviceSettings(defaults, this.onSettingsUpdate.bind(this));
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
async onSettingsUpdate(key, value) {
|
|
738
|
+
// do anything you want here with key and value
|
|
739
|
+
}
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
### Emit BiDi events
|
|
743
|
+
|
|
744
|
+
With the WebDriver BiDi protocol, clients can subscribe to arbitrary events which can be sent
|
|
745
|
+
asynchronously to the client over the BiDi socket connection. As an Appium driver author you don't
|
|
746
|
+
need to worry about event subscription. If you want to emit an event with a certain method name and
|
|
747
|
+
payload, it's as easy as using the built-in event emitter with the `bidiEvent` event.
|
|
748
|
+
|
|
749
|
+
As an
|
|
750
|
+
example, let's say our driver wants to periodically emit CPU load information. We could define an
|
|
751
|
+
event called `system.cpu`, and a payload that looks like `{load: 0.97}` to signify 97% CPU usage.
|
|
752
|
+
Whenever we want, our driver can simply call the following code (assuming we have the current load
|
|
753
|
+
in `this.currentCpuLoad`):
|
|
754
|
+
|
|
755
|
+
```js
|
|
756
|
+
this.eventEmitter.emit('bidiEvent', {
|
|
757
|
+
method: 'appium:system.cpu',
|
|
758
|
+
params: {load: this.currentCpuLoad},
|
|
759
|
+
})
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
Now, if the client has subscribed to the `system.cpu` event, it will be notified with the load
|
|
763
|
+
whenever the driver emits it.
|
|
764
|
+
|
|
765
|
+
### Make itself aware of resources other concurrent drivers are using
|
|
766
|
+
|
|
767
|
+
Let's say your driver uses up some system resources, like ports. There are a few ways to make sure
|
|
768
|
+
that multiple simultaneous sessions don't use the same resources:
|
|
769
|
+
|
|
770
|
+
1. Have your users specify resource IDs via capabilities (`appium:driverPort` etc)
|
|
771
|
+
2. Just always use free resources (find a new random port for each session)
|
|
772
|
+
3. Have each driver express what resources it is using, then examine currently-used resources from
|
|
773
|
+
other drivers when a new session begins.
|
|
774
|
+
|
|
775
|
+
To support this third strategy, you can implement `get driverData` in your driver to return what
|
|
776
|
+
sorts of resources your driver is currently using, for example:
|
|
777
|
+
|
|
778
|
+
```js
|
|
779
|
+
get driverData() {
|
|
780
|
+
return {specialPort: 1234, specialFile: /path/to/file}
|
|
781
|
+
}
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
Now, when a new session is started on your driver, the `driverData` response from any other
|
|
785
|
+
simultaneously running drivers (of the same type) will also be included, as the last parameter of
|
|
786
|
+
the `createSession` method:
|
|
787
|
+
|
|
788
|
+
```js
|
|
789
|
+
async createSession(jwpCaps, reqCaps, w3cCaps, driverData)
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
You can dig into this `driverData` array to see what resources other drivers are using to help
|
|
793
|
+
determine which ones you want to use for this particular session.
|
|
794
|
+
|
|
795
|
+
!!! warning
|
|
796
|
+
|
|
797
|
+
```
|
|
798
|
+
Be careful here, since `driverData` is only passed between sessions of a single running Appium
|
|
799
|
+
server. There's nothing to stop a user from running multiple Appium servers and requesting your
|
|
800
|
+
driver simultaneously on each of them. In this case, you won't be able to ensure independence
|
|
801
|
+
of resources via `driverData`, so you might consider using file-based locking mechanisms or
|
|
802
|
+
something similar.
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
!!! warning
|
|
806
|
+
|
|
807
|
+
```
|
|
808
|
+
It's also important to note you will only receive `driverData` for other instances of *your*
|
|
809
|
+
driver. So unrelated drivers also running may still be using some system resources. In general
|
|
810
|
+
Appium doesn't provide any features for ensuring unrelated drivers don't interfere with one
|
|
811
|
+
another, so it's up to the drivers to allow users to specify resource locations or addresses to
|
|
812
|
+
avoid clashes.
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
### Log events to the Appium event timeline
|
|
816
|
+
|
|
817
|
+
Appium has an [Event Timing API](../guides/event-timing.md) which allows users to get timestamps
|
|
818
|
+
for certain server-side events (like commands, startup milestones, etc...) and display them on
|
|
819
|
+
a timeline. The feature basically exists to allow introspection of timing for internal events to
|
|
820
|
+
help with debugging or running analysis on Appium driver internals. You can add your own events to
|
|
821
|
+
the event log:
|
|
822
|
+
|
|
823
|
+
```js
|
|
824
|
+
this.logEvent(name);
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
Simply provide a name for the event and it will be added at the current time, and made accessible
|
|
828
|
+
as part of the event log for users.
|
|
829
|
+
|
|
830
|
+
### Hide behaviour behind security flags
|
|
831
|
+
|
|
832
|
+
Appium has a feature-flag based [security model](../guides/security.md) that allows driver authors
|
|
833
|
+
to hide certain features behind security flags. What this means is that if you have a feature you
|
|
834
|
+
deem insecure and want to require server admins to opt in to it, you can require that they enable
|
|
835
|
+
the feature by adding it to the `--allow-insecure` list or turning off server security entirely.
|
|
836
|
+
|
|
837
|
+
To support the check within your own driver, you can call `this.isFeatureEnabled(featureName)` to
|
|
838
|
+
determine whether a feature of the given name has been enabled. Or, if you want to simply
|
|
839
|
+
short-circuit and throw an error if the feature isn't enabled, you can call
|
|
840
|
+
`this.assertFeatureEnabled(featureName)`.
|
|
841
|
+
|
|
842
|
+
### Use a temp dir for files
|
|
843
|
+
|
|
844
|
+
If you want to use a temporary directory for files your driver creates that are not important to
|
|
845
|
+
keep around between computer or server restarts, you can simply read from `this.opts.tmpDir`. This
|
|
846
|
+
reads the temporary directory location from `@appium/support`, potentially overridden by a CLI
|
|
847
|
+
flag. I.e., it's safer than writing to your own temporary directory because the location here plays
|
|
848
|
+
nicely with possible user configuration. `this.opts.tmpDir` is a string, the path to the dir.
|
|
849
|
+
|
|
850
|
+
### Deal with unexpected shutdowns or crashes
|
|
851
|
+
|
|
852
|
+
Your driver might run into a situation where it can't continue operating normally. For example, it
|
|
853
|
+
might detect that some external service has crashed and nothing will work anymore. In this case, it
|
|
854
|
+
can call `this.startUnexpectedShutdown(err)` with an error object including any details, and Appium
|
|
855
|
+
will attempt to gracefully handle any remaining requests before shutting down the session.
|
|
856
|
+
|
|
857
|
+
If you want to perform some of your own cleanup logic when you encounter this condition, you can
|
|
858
|
+
either do so immediately before calling `this.startUnexpectedShutdown`, or you can attach a handler
|
|
859
|
+
to the unexpected shutdown event and run your cleanup logic "out of band" so to speak:
|
|
860
|
+
|
|
861
|
+
```js
|
|
862
|
+
this.onUnexpectedShutdown(handler)
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
`handler` should be a function which receives an error object (representing the reason for the
|
|
866
|
+
unexpected shutdown).
|