Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to mention running tests in parallel (--shard-all and --shard-split) #90

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions advanced/specify-a-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ If you have multiple devices open, you can specify which device to run Maestro o
Note that when you specify a device, Maestro will not start the device.
{% endhint %}

### Obtaining the Device Identifier
### Obtaining the device Identifier

{% tabs %}
{% tab title="Android" %}
To list your running Android devices, run the following command in your terminal:
To list available Android devices, run the following command in your terminal:

```bash
adb devices
Expand All @@ -20,7 +20,7 @@ From the output, locate the device identifier for the device you want to use wit
{% endtab %}

{% tab title="iOS" %}
To list your running iOS simulators, run the following command in your terminal:
To list available iOS simulators, run the following command in your terminal:

```bash
xcrun simctl list devices booted
Expand All @@ -30,7 +30,7 @@ From the output, locate the device identifier for the device you want to use wit
{% endtab %}
{% endtabs %}

### Passing the Device Identifier to Maestro
### Passing the device identifier to Maestro

When running any Maestro command that requires a device (e.g. `test` or `studio`), you must first pass the device identifier with the `--device` parameter before running the command.

Expand All @@ -40,12 +40,29 @@ For example, to run Maestro Studio on an Android device with identifier `emulato
maestro --device emulator-5554 studio
```

Similarly, to run Maestro Test on an iOS simulator with identifier `5B6D77EF-2AE9-47D0-9A62-70A1ABBC5FA2` use the following command:
Similarly, to run `flow.yaml` on an iOS simulator with identifier
`5B6D77EF-2AE9-47D0-9A62-70A1ABBC5FA2` use the following command:

```
maestro --device 5B6D77EF-2AE9-47D0-9A62-70A1ABBC5FA2 test flow.yaml
```

{% hint style="warning" %}
Even with multiple devices open, Maestro is unable to run tests in parallel.
{% endhint %}
### Running in parallel

Maestro can run tests in parallell with two strategies.

#### --shard-all

To run tests in parallel, you can use the `--shard-all` parameter. This
parameter will run the same tests in parallel on available devices.

```
maestro test --shard-all 3 .maestro
```

To run with `--shard-all 3`, you need to have are 3 available devices. If there
are less, Maestro will print an error and request you to run more devices.

#### --shard-split