Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9322b2a2 authored by Hasib Prince's avatar Hasib Prince
Browse files

Merge branch '1157-maestro_script' into 'main'

test: added app install test with maestro

See merge request !500
parents 4a7c4fab 534d871f
Loading
Loading
Loading
Loading
Loading

maestro/README.md

0 → 100644
+16 −0
Original line number Original line Diff line number Diff line
## 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
+20 −0
Original line number Original line Diff line number Diff line
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
+61 −0
Original line number Original line Diff line number Diff line
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}