Skip to content

Commit 4ae68ff

Browse files
author
Sergei Iartsev
committed
docs(maestro): modified flags, added filtering and envs
1 parent f38fdc0 commit 4ae68ff

1 file changed

Lines changed: 50 additions & 5 deletions

File tree

docs/cloud/intro/maestro.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,26 @@ import TabItem from '@theme/TabItem';
66
### Supported platforms
77
Marathon Cloud supports Maestro for iOS and Android.
88

9+
**Important Notes on Test execution**:
10+
- all file paths within your Maestro flows must use Linux-style syntax (e.g., path/to/file.yaml)
11+
- each Maestro flow is treated as a separate test by Marathon Cloud
12+
- sequential flow logic is not supported, as it conflicts with Marathon's design to complete all tests in under 15 minutes.
13+
14+
915
To execute your tests, use the command below:
1016
<Tabs groupId="operating-systems">
1117
<TabItem value="iOS" label="iOS">
1218

1319
```shell
1420
export MARATHON_CLOUD_API_KEY=generated_api_key
15-
marathon-cloud run maestro ios -a your_application.app -t ./path/to/tests --maestro-env=MAESTRO_APP_ID=your.app.id folder_or_file_to_execute
21+
marathon-cloud run maestro ios --application your_application.app --test-application ./path/to/tests folder_or_file_to_execute
1622
```
1723
</TabItem>
1824
<TabItem value="Android" label="Android">
1925

2026
```shell
2127
export MARATHON_CLOUD_API_KEY=generated_api_key
22-
marathon-cloud run maestro android -a your_app.apk -t ./path/to/tests --maestro-env=MAESTRO_APP_ID=your.app.id folder_or_file_to_execute
28+
marathon-cloud run maestro android --application your_app.apk --test-application ./path/to/tests folder_or_file_to_execute
2329

2430
```
2531
</TabItem>
@@ -30,9 +36,48 @@ Here's a breakdown of the variables and flags used in the example:
3036
- ./path/to/tests - the root directory containing all your Maestro test files
3137
- folder_or_file_to_execute - a space-separated list of specific folders and files you want to run within the test directory. **Note:** Marathon Cloud does not execute tests from subfolders when a folder is specified.
3238
For iOS:
33-
- -a your_application.app - path to the [iOS application](/intro/ios#application-and-test-application)
39+
- --application your_application.app - path to the [iOS application](/intro/ios#application-and-test-application)
3440
For Android:
35-
- -a your_app.apk - path to the [Android application](/intro/android#application-and-test-application)
36-
- --maestro-env=MAESTRO_APP_ID=your.app.id - This optional flag allows you to pass environment variables to your Maestro tests. It is required if your test flow uses a variable like appId: ${MAESTRO_APP_ID}. Replace your.app.id with the actual bundle ID for your application.
41+
- --application your_app.apk - path to the [Android application](/intro/android#application-and-test-application)
42+
43+
### Maestro environment variables
44+
If your Maestro tests rely on environment variables, you'll need to pass them to Marathon Cloud.
45+
A common use case is referencing the application ID in a test flow, as shown in this example:
46+
```shell
47+
# flow.yaml
3748

49+
appId: ${APP_ID}
50+
---
51+
- launchApp
52+
- tapOn: "Text on the screen"
53+
```
54+
To provide the value for **APP_ID**, use the **--maestro-env** flag. For instance, to set **APP_ID** to **your.app.id**, you would execute the following command:
55+
```shell
56+
export MARATHON_CLOUD_API_KEY=generated_api_key
57+
marathon-cloud run maestro android --application your_app.apk --test-application ./path/to/tests --maestro-env=APP_ID=your.app.id folder_or_file_to_execute
3858

59+
```
60+
61+
### Maestro filtering
62+
For more granular control over which tests run, you can use Maestro's tag-based filtering in addition to the recommended practice of organizing tests into folders.
63+
This filtering feature lets you define which tests to include (allowlist) and which to exclude (blocklist) using specific tags.
64+
65+
create a YAML file (e.g., filter.yaml) that specifies your filtering configuration. The example below shows how to define tags to allow or block:
66+
```shell
67+
filteringConfiguration:
68+
allowlist:
69+
- type: "annotation"
70+
values:
71+
- "tag1"
72+
- "tag2"
73+
blocklist:
74+
- type: "annotation"
75+
values:
76+
- "tag3"
77+
- "tag4"
78+
```
79+
Next, pass this filter file to your Marathon Cloud command using the **--filter-file** flag. Here is how your full command would look:
80+
```shell
81+
export MARATHON_CLOUD_API_KEY=generated_api_key
82+
marathon-cloud run maestro android --application your_app.apk --test-application ./path/to/tests --filter-file filter.yaml folder_or_file_to_execute
83+
```

0 commit comments

Comments
 (0)