# I Let My Agent Migrate My Maestro Suite to Argent Overnight

Błażej Kustra · Oct 31, 2026

[CookinBuddy](https://cookinbuddy.com), my recipe app, had a Maestro suite I had stopped trusting. It was slow, and it flaked on me more times than I can count. I want to run it before every release, so it has to be fast and reliable. Moving to Argent felt natural too, since I already use it every day.

I work on [Argent](https://argent.swmansion.com/) at Software Mansion, so one evening I tried the obvious thing and gave the whole migration to my agent. This is the prompt I sent my agent before I went to sleep:

<style>@keyframes cc-cursor-blink{50%{opacity:0}}</style>
<div style="background:#24292e;border-radius:12px;padding:18px 0 14px;margin:1.5em 0;font-family:'SF Mono',Menlo,Consolas,monospace;font-size:14px;line-height:1.5;color:#e1e4e8">
  <div style="display:flex;gap:16px;align-items:center;padding:0 18px">
    <svg viewBox="0 0 17 10" width="51" height="30" fill="#d77757" shape-rendering="crispEdges" aria-hidden="true"><rect x="2" y="0" width="1" height="1"/><rect x="3" y="0" width="1" height="1"/><rect x="4" y="0" width="1" height="1"/><rect x="5" y="0" width="1" height="1"/><rect x="6" y="0" width="1" height="1"/><rect x="7" y="0" width="1" height="1"/><rect x="8" y="0" width="1" height="1"/><rect x="9" y="0" width="1" height="1"/><rect x="10" y="0" width="1" height="1"/><rect x="11" y="0" width="1" height="1"/><rect x="12" y="0" width="1" height="1"/><rect x="13" y="0" width="1" height="1"/><rect x="14" y="0" width="1" height="1"/><rect x="2" y="1" width="1" height="1"/><rect x="3" y="1" width="1" height="1"/><rect x="4" y="1" width="1" height="1"/><rect x="5" y="1" width="1" height="1"/><rect x="6" y="1" width="1" height="1"/><rect x="7" y="1" width="1" height="1"/><rect x="8" y="1" width="1" height="1"/><rect x="9" y="1" width="1" height="1"/><rect x="10" y="1" width="1" height="1"/><rect x="11" y="1" width="1" height="1"/><rect x="12" y="1" width="1" height="1"/><rect x="13" y="1" width="1" height="1"/><rect x="14" y="1" width="1" height="1"/><rect x="2" y="2" width="1" height="1"/><rect x="3" y="2" width="1" height="1"/><rect x="5" y="2" width="1" height="1"/><rect x="6" y="2" width="1" height="1"/><rect x="7" y="2" width="1" height="1"/><rect x="8" y="2" width="1" height="1"/><rect x="9" y="2" width="1" height="1"/><rect x="10" y="2" width="1" height="1"/><rect x="11" y="2" width="1" height="1"/><rect x="13" y="2" width="1" height="1"/><rect x="14" y="2" width="1" height="1"/><rect x="2" y="3" width="1" height="1"/><rect x="3" y="3" width="1" height="1"/><rect x="5" y="3" width="1" height="1"/><rect x="6" y="3" width="1" height="1"/><rect x="7" y="3" width="1" height="1"/><rect x="8" y="3" width="1" height="1"/><rect x="9" y="3" width="1" height="1"/><rect x="10" y="3" width="1" height="1"/><rect x="11" y="3" width="1" height="1"/><rect x="13" y="3" width="1" height="1"/><rect x="14" y="3" width="1" height="1"/><rect x="0" y="4" width="1" height="1"/><rect x="1" y="4" width="1" height="1"/><rect x="2" y="4" width="1" height="1"/><rect x="3" y="4" width="1" height="1"/><rect x="4" y="4" width="1" height="1"/><rect x="5" y="4" width="1" height="1"/><rect x="6" y="4" width="1" height="1"/><rect x="7" y="4" width="1" height="1"/><rect x="8" y="4" width="1" height="1"/><rect x="9" y="4" width="1" height="1"/><rect x="10" y="4" width="1" height="1"/><rect x="11" y="4" width="1" height="1"/><rect x="12" y="4" width="1" height="1"/><rect x="13" y="4" width="1" height="1"/><rect x="14" y="4" width="1" height="1"/><rect x="15" y="4" width="1" height="1"/><rect x="16" y="4" width="1" height="1"/><rect x="0" y="5" width="1" height="1"/><rect x="1" y="5" width="1" height="1"/><rect x="2" y="5" width="1" height="1"/><rect x="3" y="5" width="1" height="1"/><rect x="4" y="5" width="1" height="1"/><rect x="5" y="5" width="1" height="1"/><rect x="6" y="5" width="1" height="1"/><rect x="7" y="5" width="1" height="1"/><rect x="8" y="5" width="1" height="1"/><rect x="9" y="5" width="1" height="1"/><rect x="10" y="5" width="1" height="1"/><rect x="11" y="5" width="1" height="1"/><rect x="12" y="5" width="1" height="1"/><rect x="13" y="5" width="1" height="1"/><rect x="14" y="5" width="1" height="1"/><rect x="15" y="5" width="1" height="1"/><rect x="16" y="5" width="1" height="1"/><rect x="2" y="6" width="1" height="1"/><rect x="3" y="6" width="1" height="1"/><rect x="4" y="6" width="1" height="1"/><rect x="5" y="6" width="1" height="1"/><rect x="6" y="6" width="1" height="1"/><rect x="7" y="6" width="1" height="1"/><rect x="8" y="6" width="1" height="1"/><rect x="9" y="6" width="1" height="1"/><rect x="10" y="6" width="1" height="1"/><rect x="11" y="6" width="1" height="1"/><rect x="12" y="6" width="1" height="1"/><rect x="13" y="6" width="1" height="1"/><rect x="14" y="6" width="1" height="1"/><rect x="2" y="7" width="1" height="1"/><rect x="3" y="7" width="1" height="1"/><rect x="4" y="7" width="1" height="1"/><rect x="5" y="7" width="1" height="1"/><rect x="6" y="7" width="1" height="1"/><rect x="7" y="7" width="1" height="1"/><rect x="8" y="7" width="1" height="1"/><rect x="9" y="7" width="1" height="1"/><rect x="10" y="7" width="1" height="1"/><rect x="11" y="7" width="1" height="1"/><rect x="12" y="7" width="1" height="1"/><rect x="13" y="7" width="1" height="1"/><rect x="14" y="7" width="1" height="1"/><rect x="2" y="8" width="1" height="1"/><rect x="4" y="8" width="1" height="1"/><rect x="12" y="8" width="1" height="1"/><rect x="14" y="8" width="1" height="1"/><rect x="2" y="9" width="1" height="1"/><rect x="4" y="9" width="1" height="1"/><rect x="12" y="9" width="1" height="1"/><rect x="14" y="9" width="1" height="1"/></svg>
    <div style="user-select:none"><strong>Claude Code</strong> <span style="color:#8a8a8a">v2.1</span><br><span style="color:#8a8a8a">Opus 5.5<br>~/cookinbuddy</span></div>
  </div>
  <div style="border-top:1px solid #6b6b6b;border-bottom:1px solid #6b6b6b;margin-top:28px;padding:8px 18px;display:flex;gap:10px">
    <span style="user-select:none">❯</span>
    <span>migrate all Maestro E2E tests to Argent E2E and open one PR with them<br><br>verify that all of them work during the night (don't ask me anything, I'll be sleeping)<span style="display:inline-block;width:0.6em;height:1.2em;margin-left:2px;vertical-align:text-bottom;background:#e8e8e8;user-select:none;animation:cc-cursor-blink 1s step-end infinite"></span></span>
  </div>
  <div style="color:#8a8a8a;font-size:12px;padding:8px 18px 0;user-select:none">? for shortcuts</div>
</div>

In the morning I had one pull request. The agent worked for 3h58m on its own: 1h24m to port every area, then 2h34m running the tests and fixing failures. Along the way it hit two real bugs in my app, and both fixes were merged that morning.

Below is one of the migrated tests: it relaunches the app, opens the sort menu, picks a sort and clears it. If you are new to Argent E2E, the [E2E tutorial](/blog/argent-e2e-tutorial/) covers recording a test and running it in CI.

<video src="/blog/migrate-maestro-tests-to-argent/argent-e2e-run-sort-test-2x.mp4" poster="/blog/migrate-maestro-tests-to-argent/argent-e2e-run-sort-test-poster.jpg" controls playsinline preload="metadata" aria-label="An iPhone simulator running the CookinBuddy recipes screen next to a terminal running argent e2e run on the sort-recipes test, which passes 20 steps in about 12 seconds, played at 2x"></video>

## How fast is it?

On the same simulator, app build and network, the Argent suite runs 1.95x faster than Maestro:

| | Maestro | Argent |
| --- | --- | --- |
| Median tap | 1.59s | 0.40s |
| Runner start | about 7s per area | 0.09s per test |
| 53 shared tests, total | 30.4 min | 15.5 min |
| Same, with runner startup | 32.5 min | 15.7 min |
| Tests at least 2x faster on Argent | | 23 of 53 |

Most of the gap comes from the tap itself. A full run of this suite taps about 500 times, so saving a second on each one adds up fast.

Every area got faster, from 1.5x on import to 2.5x on cooking mode:

| Area | Tests | Maestro | Argent | Speedup |
| --- | --- | --- | --- | --- |
| Auth | 6 | 213s | 124s | 1.7x |
| Shopping lists | 14 | 528s | 292s | 1.8x |
| Recipes | 10 | 301s | 151s | 2.0x |
| Cooking mode | 6 | 478s | 190s | 2.5x |
| Sharing | 3 | 76s | 39s | 1.9x |
| Discover | 3 | 52s | 27s | 1.9x |
| Settings | 6 | 85s | 55s | 1.6x |
| Import | 4 | 67s | 44s | 1.5x |
| Subscription | 1 | 23s | 10s | 2.2x |

The overnight suite was slower than this at first. The agent played it safe and added fixed sleeps around native menus and an idle wait after almost every interaction. A second pass removed the ones the tests didn't need, and the whole suite then passed twice in a row. Most of those waits did nothing. A tap already gives a missing element about a second to show up, and where something takes longer, like a sheet or a network result, the tests use an `await` with its own timeout.

This clip runs the same sort test in both suites:

<video src="/blog/migrate-maestro-tests-to-argent/maestro-vs-argent-sort-test-2x.mp4" poster="/blog/migrate-maestro-tests-to-argent/maestro-vs-argent-sort-test-poster.jpg" controls playsinline preload="metadata" aria-label="Side by side, Maestro 2.7.0 and Argent 0.30.1 run the same sort-recipes test on CookinBuddy; timed from each tool's first step, Argent passes in 11.7 seconds and Maestro in 29.6 seconds, played at 2x"></video>

### Albert Gao got a similar gap on his app

Albert Gao compared the two tools on his own app and [shared his results on X](https://x.com/albertgao/status/2117390561544208603): "I did a quick benchmark, Argent is 2x faster at least, with 3x faster in many cases." These are his numbers:

![Albert Gao's benchmark on his own app. The measured part of the journey took a median 33.5s on Maestro and 16.5s on Argent. Scrolling down to the agent took 19.4 to 19.8s on Maestro and 7.2 to 7.4s on Argent. Median tap was 1.30s on Maestro and 0.4 to 0.6s on Argent. Time before the first step runs was 5.5 to 11.0s on Maestro and 1.9 to 6.0s on Argent](./albert-gao-benchmark.png)

## Argent taps the real button

Argent's runner currently reads the view hierarchy from inside the app. My cooking mode tutorial is a transparent React Native `Modal`, and nothing inside it reached Maestro's accessibility tree, so the old flow watched the screen behind it disappear and then tapped a screen position:

```yaml
- tapOn:
    id: 'cooking-help'
- extendedWaitUntil:
    notVisible:
      id: 'cooking-step-indicator'
    timeout: 15000
- tapOn:
    point: '50%,95%'
- extendedWaitUntil:
    visible:
      id: 'cooking-step-indicator'
    timeout: 15000
```

The Argent test names the dismiss button and checks it:

```yaml
- tap: { id: cooking-help }
- await: { visible: { id: cooking-tutorial-dismiss }, timeout: 15000 }
- await: { idle: true }
- tap: { id: cooking-tutorial-dismiss }
- await: { hidden: { id: cooking-tutorial-dismiss }, timeout: 15000 }
- assert: { visible: { id: cooking-step-indicator } }
```

Recipe cards got the same treatment: the old helper tapped `27%,78%`, and the new tests tap `recipe-card-E2E Cook Fixture`. The subscription paywall went the other way. Maestro tapped its buttons by text through the accessibility tree. Those buttons are missing from the view hierarchy that Argent's `tap` reads, so the new tests wait for them in the accessibility tree and then tap by screen position.

## The two bugs it found

The rewrite caught two real production bugs:

- Leaving cooking mode could freeze the recipe screen. The app tried to show a review sheet while another sheet was still up, and the invisible host of that sheet blocked every touch.
- Once an account had 25 deleted shopping lists, the real lists stopped showing up. The groceries screen read only the first page of the feed, and the deleted lists filled it.

The migration agent first blamed `UITextEffectsWindow`, which turned out to be a red herring. In the morning a fix agent ran the failing test on the same simulator and checked what was really under the finger with `native-user-interactable-view-at-point`, `debugger-inspect-element` and the simulator log. It had a fix in 17 minutes, the same loop as in the [agent loop case study](/blog/closing-the-agent-loop-autonomous-react-native-bug-reproduction-with-argent/).

## How I measured

Both suites ran in alternating runs on one iPhone 17 Pro simulator (iOS 26.5) with Maestro 2.7.0 and the same app build, Metro and account. The committed Maestro suite failed at its first step on the current app, so an agent repaired it first with the smallest patch it could (1h26m). Totals sum the per-test medians of passing runs, only for tests that passed in both suites. Maestro's startup includes a roughly 50-second cache reset from its runner script. The Argent numbers come from three timed runs of the tuned suite with Argent 0.30.1; each run passed 60 of 61 tests. The Maestro numbers are from the repaired suite, which still has its own animation and settle waits. Comparing against each test's fastest Maestro pass instead of the median still gives 1.91x.

## Trade-offs

Argent had one real problem in my runs. In long runs it sometimes stopped seeing native menus and alerts partway through, so tests that tap them failed while the app was fine. Restarting Argent's services for the simulator fixed it every time, so the timed runs do that once at the start. I also found one trigger: a cooking test starts a timer, the timer's Live Activity wakes the simulator's Calendar and widget processes, and while those run Argent slows down in the tests that follow. The timed runs close those processes first. We're still looking for the root cause.

## Should you migrate?

Migrate if agents write most of your code and you want them to own the tests too, since the same tool records, runs and debugs. Keep Maestro if your suite is green, your team knows it, and nobody expects agents to maintain it. [Argent Cloud](/blog/argent-cloud-overview-let-your-agents-run-ios-simulators-in-the-cloud/) runs Maestro suites too, so you can keep both.

Next, I'd improve the app itself. Typing is the slowest step, at a median 2.5s, and every `when:` guard that doesn't match costs about a second, which adds up to more than a minute per run. Shorter fixture names and fewer guards would make the suite even faster. Small changes like that, which make the app easier for your E2E tool to drive, matter as much as the tool itself. Look at what is slow, then fix it or make it easier for your tests to get through.

## Run it on your own suite

Install Argent, keep the machine awake, and give your agent the prompt below:

```bash
npx @swmansion/argent@latest init
caffeinate -dims
```

The Argent skills already cover the test format and how to run tests, so the prompt only adds your setup and the rules that mattered most. I wrote it down after my migration, from what went wrong there: the agent once renamed a real list on my account, for example, so tests now only touch data they created. Fill in the setup lines, or hand your agent the [prompt file](/blog/migrate-maestro-tests-to-argent/migration-prompt.md).

```text
Migrate this repo's Maestro tests to Argent E2E tests and open one pull request. Work on your own and don't stop to ask me anything: decide, note the decision in the PR, and keep going.

My setup:
- Maestro folder: .maestro
- App id: com.example.app
- Simulator you may use: <udid or name>. Leave every other device alone.
- Test account, as secret names: <E2E_EMAIL, E2E_PASSWORD>
- Data you must never touch: <real accounts or records, or "none">

Rules:
1. Work in a new git worktree and branch. Leave my checkout alone.
2. Load the argent-create-e2e and argent-qa-e2e skills first. Read the Maestro README, helpers and every flow before you port anything.
3. The app on the current branch is the truth. Where an old flow is stale, follow the app and note the difference.
4. Tests only change data they created themselves, named with an "E2E " prefix. Check the name before every delete.
5. Type secrets as {{secret:NAME}}. Never put real values in the YAML or the PR.
6. Tap by id or text. Where Maestro tapped a screen position, find a real id or add a testID. Keep coordinates only as a last resort and list them in the PR.
7. Wait for the element you need next. Don't add fixed sleeps or an idle wait after every step.
8. A test is done when it passes twice in a row with unchanged YAML. If it fails because of the app, keep it failing, save the evidence and report the bug. Never weaken a test to get green.
9. After about 5 attempts on a stubborn test, document it and move on.

In the PR: pass counts per area, failing tests and why, app bugs you found, and every behavior you changed from the Maestro flows.
```

Read the pull request body before the diff, since it lists failures, app bugs and every coordinate the agent kept.

## Key takeaways

- Run your old suite first, so you know how far the app has drifted.
- Give the agent a test account you can afford to lose.
- Once the suite is green, replace fixed sleeps with an await on the next element.
- Compare tools only on tests that pass in both suites.

The [E2E docs](https://docs.swmansion.com/argent/docs/features/e2e/) and [YAML reference](https://docs.swmansion.com/argent/docs/reference/e2e-yaml/) cover the format.

## FAQ

### Can an AI agent migrate Maestro tests on its own?

Yes. On CookinBuddy one agent ported the whole suite in 3h58m with no input from me. Give it a disposable account and written safety rules.

### Do Maestro flows convert one-to-one to Argent?

Most steps do, but text selectors need care. In Maestro, text always matches as a full-string regex. In Argent, plain `text` matches a case-insensitive substring and `matches` takes a regex, so `tapOn: 'Delete'` becomes `tap: { text: { matches: '^Delete$' } }`.
