diff --git a/maestro/README.md b/maestro/README.md new file mode 100644 index 0000000000000000000000000000000000000000..184df9f13d6bd1e8c51d5f928d091c5c1c74a96e --- /dev/null +++ b/maestro/README.md @@ -0,0 +1,16 @@ +## How to install Maestro +Please follow the instructions at: https://maestro.mobile.dev/getting-started/installing-maestro + +## How to test + +Run this command from the **maestro** directory of the project. + +Debug: +```shell +maestro test -e APP_ID=foundation.e.apps.debug maestro-apps-install.yaml +``` + +Release: +```shell +maestro test -e APP_ID=foundation.e.apps maestro-apps-install.yaml +``` \ No newline at end of file diff --git a/maestro/apps-install-flow.yaml b/maestro/apps-install-flow.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d9ddba5d5b7d3b91caf996859950e0a317653fb0 --- /dev/null +++ b/maestro/apps-install-flow.yaml @@ -0,0 +1,20 @@ +appId: ${APP_ID} +env: + NUMBER_OF_MAX_SCROLL: 5 +--- +- evalScript: ${output.app_index = 0, output.number_of_scroll = 0} +- repeat: + while: + true: ${output.app_index < NUMBER_OF_INSTALL && output.number_of_scroll < NUMBER_OF_MAX_SCROLL} + commands: + - tapOn: + text: INSTALL + id: "${APP_ID}:id/installButton" + optional: true + - evalScript: ${output.app_install++; output.app_index++;} + - runFlow: + when: + notVisible: INSTALL + commands: + - evalScript: ${output.number_of_scroll++} + - scroll diff --git a/maestro/maestro-apps-install.yaml b/maestro/maestro-apps-install.yaml new file mode 100644 index 0000000000000000000000000000000000000000..32e7fa8f0d511c6def026014391c8392ee9f16cb --- /dev/null +++ b/maestro/maestro-apps-install.yaml @@ -0,0 +1,61 @@ +appId: ${APP_ID} +env: + SEARCH_STRING: "notes" + SEARCH_SUGGESTION_STRING: "notes app" + NUMBER_OF_MAX_CATEGORY: 8 + APP_INSTALL_CATEGORY_PAGE: 80 + APP_INSTALL_PER_CATEGORY: 10 + APP_INSTALL_SEARCH_PAGE: 20 +--- + +- launchApp: + clearState: false +- runFlow: + when: + visible: + id: "${APP_ID}:id/agreeBT" + commands: + - tapOn: + id: "${APP_ID}:id/agreeBT" +- tapOn: + id: ${APP_ID}:id/anonymousBT + optional: true +- runFlow: + when: + visible: + id: "${APP_ID}:id/errorMessagePanel" + commands: + - tapOn: + id: "${APP_ID}:id/ignoreSessionButton" + +# Go to category page +- tapOn: + id: "${APP_ID}:id/navigation_bar_item_icon_view" + index: 1 +- evalScript: ${output.app_install = 0; output.category_index = 0} +- repeat: + while: + true: ${output.app_install < APP_INSTALL_CATEGORY_PAGE && output.category_index < NUMBER_OF_MAX_CATEGORY} + commands: + - tapOn: + id: "${APP_ID}:id/category_title" + index: ${output.category_index} + - runFlow: + file: apps-install-flow.yaml + env: + NUMBER_OF_INSTALL: ${APP_INSTALL_PER_CATEGORY} + - evalScript: ${output.category_index++} + - back + +# Go to search page +- tapOn: + text: Search +- inputText: ${SEARCH_STRING} +- tapOn: + text: ${SEARCH_SUGGESTION_STRING} +- evalScript: ${output.app_install = 0;} +- runFlow: + file: apps-install-flow.yaml + env: + NUMBER_OF_INSTALL: ${APP_INSTALL_SEARCH_PAGE} +