<- Blog

Introducing: Maestro — Painless Mobile UI Automation

The easiest way to automate UI testing for your mobile app

Leland Takamine August 31, 2022

The existing mobile UI automation tooling available today is not living up to its promise. Teams are implementing UI tests in hopes of iterating faster without breaking things — but instead, test flakiness, infrastructure issues, brittle tests, and framework complexity end up slowing developers down.

At mobile.dev, we believe in a world where UI testing empowers teams to move faster, not slower. That’s why today, we’re excited to announce our open-source project Maestro, the easiest way to automate UI testing for you mobile app 🎉:

GitHub - mobile-dev-inc/Maestro: Painless E2E Automation for Mobile and Web Painless E2E Automation for Mobile and Web. Contribute to mobile-dev-inc/Maestro development by creating an account on GitHub. github.com

See it in action!

The best way to understand how Maestro works is to see it in action. Check out the recording below to see a Maestro Flow being developed end-to-end.

If you’ve written UI tests with other frameworks in the past, you can see why we’re so excited about Maestro. It reduces the time to build a functioning UI test by >10x, and more importantly makes updating them just as easy.

Why Maestro?

Maestro is built on learnings from its predecessors (Appium, Espresso, UIAutomator, and XCTest), but we ditched the complexity, kept the good stuff, and added some fundamental improvements.

Here are some of the reasons why we believe Maestro is the future of mobile UI testing:

  • Built-in tolerance to flakiness. UI elements will not always be where you expect them, screen tap will not always go through, etc. Maestro embraces the instability of mobile applications and devices, and counters it under the hood.
  • Built-in tolerance to delays. No need to pepper your tests with sleep() calls. Maestro knows that it might take time to load the content (i.e. over the network) and automatically waits for it (but no longer than required).
  • Blazingly fast iteration. Tests are interpreted, so no need to compile anything. Maestro is able to continuously monitor your test files and rerun them as they change.
  • Declarative yet powerful syntax. Define your tests in a simple yaml file.
  • Simple setup. Maestro is a single binary that works anywhere.
  • Cross-platform. Maestro runs on iOS and Android and supports ReactNative, Flutter, WebViews, and pure Native applications.

Flows

A Flow is a series of steps that tells Maestro how to navigate through your application. Flows are similar to Espresso / XCTest / UIAutomator / Appium UI tests, but are much simpler to write, understand, and maintain.

Here’s an example of a flow that launches the Twitter app, follows the @mobile__dev account, and then asserts that the account has been followed successfully:

The declarative syntax allows you to quickly add a new UI test coverage for a feature, and easily make updates as your feature evolves. The high-level Maestro commands allow anyone to immediately dive in and update a Flow, even if they aren’t the original author. This is a huge win, and necessary for any scalable UI testing strategy.

The Maestro CLI makes running your Flow dead simple as well. Just install the CLI (brew tap mobile-dev-inc/tap && brew install maestro ) and run:

maestro test flow.yaml

There’s a ton of features not covered in this article, so be sure to check out the documentation to see what else you can do with Flows: maestro.mobile.dev

Running Flows on CI

Check out the Maestro Cloud announcement to learn more about running your Flows automatically in CI:

Introducing: Maestro Cloud

Get Started

We’re excited to hear what you think about Maestro. Head over to the GitHub repo to get started!

GitHub - mobile-dev-inc/Maestro: Painless E2E Automation for Mobile and Web Painless E2E Automation for Mobile and Web. Contribute to mobile-dev-inc/Maestro development by creating an account on GitHub. github.com

If there’s a feature you want to see added to Maestro or if you run into any issues, open an issue.

And lastly, make sure to join us on Slack. Join the workspace then head over to the #maestro channel!

Follow us on Twitter for more updates! @mobile__dev

We're entering a new era of software development. Advancements in AI and tooling have unlocked unprecedented speed, shifting the bottleneck from development velocity to quality control. This is why we built — a modern testing platform that ensures your team can move quickly while maintaining a high standard of quality.

Learn more ->