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

Commit a2c35abe authored by Romain Hunault's avatar Romain Hunault 🚴🏻
Browse files

chore(maestro): initialize modular maestro test configuration

parent c86658e1
Loading
Loading
Loading
Loading
+81 −9
Original line number Diff line number Diff line
## How to install Maestro
Please follow the instructions at: https://maestro.mobile.dev/getting-started/installing-maestro
## Maestro Test Architecture

## How to test
All Maestro flows are now organized under `maestro/test/`.

Run this command from the **maestro** directory of the project.
### Folder structure

- `test/utils/`
  - Reusable low-level helpers (example: accept TOS).
- `test/common/`
  - Shared app actions/assertions used across modes and features.
- `test/modes/`
  - Startup/login mode setup flows:
    - `anonymous/setup.yaml`
    - `google/setup.yaml`
    - `pwa-open-source/setup.yaml`
- `test/settings/`
  - User-settings profiles:
    - `default/apply.yaml`
    - `modified/apply.yaml`
- `test/features/`
  - Feature-specific reusable flows:
    - `install/execute.yaml`
    - `search/execute.yaml`
    - `update/execute.yaml`
- `test/scenarios/`
  - End-to-end scenario orchestration (`settings + mode + feature/common`).

## Scenario naming convention

Use this format for all scenario files:

`scenario-{feature}-{mode}-{settings}.yaml`

Meaning:

- `{feature}`: tested capability (`search`, `install`, `update`)
- `{mode}`: startup mode (`anonymous`, `google`, `pwa-open-source`)
- `{settings}`: user settings profile (`default`, `modified`)

Examples:

- `scenario-search-anonymous-default.yaml`
- `scenario-install-google-modified.yaml`
- `scenario-update-pwa-open-source-default.yaml`

This naming makes filtering and CI reporting easier because each file name directly exposes the tested matrix.

## Run tests

Run commands from the `maestro/` directory.

### Scenario examples

Debug:
```shell
maestro test -e APP_ID=foundation.e.apps.debug maestro-apps-install.yaml
maestro test -e APP_ID=foundation.e.apps test/scenarios/scenario-app-page-google-app-anonymous-default.yaml
maestro test -e APP_ID=foundation.e.apps test/scenarios/scenario-app-page-google-app-google-default.yaml
maestro test -e APP_ID=foundation.e.apps test/scenarios/scenario-app-page-google-app-pwa-open-source-default.yaml
```

Release:
### Mode suites (setup once, then all features)

Each suite currently applies mode setup first, then settings profile (no feature `execute` calls for now).

```shell
maestro test -e APP_ID=foundation.e.apps test/scenarios/suite-anonymous-default.yaml
maestro test -e APP_ID=foundation.e.apps test/scenarios/suite-google-default.yaml
maestro test -e APP_ID=foundation.e.apps test/scenarios/suite-pwa-open-source-default.yaml
```

### Install feature flow

```shell
maestro test -e APP_ID=foundation.e.apps maestro-apps-install.yaml
maestro test -e APP_ID=foundation.e.apps test/features/install/execute.yaml
```

### Full scenario batch + reports

```shell
maestro test -e APP_ID=foundation.e.apps \
  --format HTML \
  --output ../.tmp/maestro-home/reports/scenarios.html \
  test/scenarios

maestro test -e APP_ID=foundation.e.apps \
  --format JUNIT \
  --output ../.tmp/maestro-home/reports/scenarios-junit.xml \
  test/scenarios
```

maestro/apps-install-flow.yaml

deleted100644 → 0
+0 −20
Original line number 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

maestro/maestro-apps-install.yaml

deleted100644 → 0
+0 −61
Original line number 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}
+7 −0
Original line number Diff line number Diff line
appId: ${APP_ID}
env:
  APP_PACKAGE: "com.lemonde.androidapp"
---
- openLink: "market://details?id=${APP_PACKAGE}"
- assertVisible:
    id: "${APP_ID}:id/installButton"
+4 −0
Original line number Diff line number Diff line
appId: ${APP_ID}
---
# Feature flow placeholder for install scenarios.
- evalScript: ${output.feature = "install"}
Loading