Maestro test: A great mobile UI testing framework

mobile test automation

What is Maestro Test Automation?

There are several test automation tools in the market, both commercial and open source, and Maestro seems to be a new one who wants to play in the big leagues, as they state in their website, they learned from other tools like Appium, Espresso, UIAutomator and XCTest, providing a fast, easy to use, test automation framework.

In Maestro UI testing, you define your automation test cases using simple yaml files, combining them with javascript code than can be executed to perform certain actions, such as tap, drag and drop, scroll, get text, etc.

Maestro Test example

Maestro uses yaml files to declare the steps and actions in a certain flow, for example, a search on Wikipedia looks like this:

appId: org.wikipedia
tags:
  - advanced
---
- runFlow: subflows/onboarding-android.yaml
- tapOn:
    id: "org.wikipedia:id/search_container"
- runScript: scripts/getSearchQuery.js
- inputText: ${output.result}
- assertVisible: ${output.result}

android-flow.yaml

appId: org.wikipedia
---
- launchApp
- tapOn:
    id: "org.wikipedia:id/fragment_onboarding_forward_button"
- tapOn:
    id: "org.wikipedia:id/fragment_onboarding_forward_button"
- tapOn:
    id: "org.wikipedia:id/fragment_onboarding_forward_button"
- tapOn:
    id: "org.wikipedia:id/fragment_onboarding_done_button"

subflows/onboarding-android.yaml

output.result = 'qwerty';

scripts/getSearchQuery.yaml

In the example, we see how Maestro Test works:

  • We use the appId to open the application on the mobile device
  • Then we run a sub flow that uses an ID to locate the forward button and taps on it 3 times
  • Press done.
  • Runs the searchQuery script and validates the results.

Maestro test automation VS Appium

If I have to recommend a tool between Appium and Maestro, my answer will depend mostly on who is going to write the tests, how big is the project and how fast do we need to have them automated.

Difficulty level

To begin, Maestro is very simple and easy to use, we can have some test scripts quickly and start covering our application flows from early development stages. This comes with a caveat, and is that Maestro is more complex to maintain and to escalate than other test automation frameworks like Appium or Espresso, at least on the current status.

Another important difference is that Maestro requires less technical skills than other frameworks that needs advanced programming knowledge to use, so if our team is not technical enough to code complex scripts, Maestro is a great choice to use as it is somewhere between the basic record and play and the complexity of Appium.

No Code capabilities

Last month, they announced that no code capabilities have been added to Maestro Studio, allowing users to write test automation test cases without writing a single line of code, just by using the application and letting Maestro create the flows and code for you.

The tool has the capacity of executing test cases locally and in the cloud, and you can edit the created scripts if you want to have something more complex. It also has a very good locator inspector which is easy to use and understand.

Mobile devices compatibility

In terms of flexibility to run on different environments, it’s worth to mention that Maestro only works on simulators, and can not be executed on real devices, something that we can easily achieve with Appium. This is a risk if we don’t manually test in real devices and only rely on Maestro to test our application.

Anyways, I bet that running on real devices is part of their next step, at least on Android, as I understand how complex adding support to iOS real devices can be.

Community support

Maestro, as a new tool, so it has a smaller community than Appium, which as a Selenium Webdriver sibling has a huge community that is always willing to help if you are stuck.

Licensing

In terms of licensing, Maestro and Appium are both completely open source.

Maestro Cloud

Maestro is created and supported by Mobile Dev, a company founded by Leland Takamine and Jake Krupski, they both created it with the idea of setting the standard for mobile development, focusing in quality.

They created Maestro Cloud, a mobile device cloud that allows us to execute test automation test cases in the cloud, and to integrate them with Jenkins, Gitlab, Travis, and other CI/CD tools.

They have a very competitive price compared to other tools in the market such as saucelabs and browserstack, and the tool seems mature enough to give it a try.

Final thoughts: Is Maestro a good test automation tool?

It definitely is, with Maestro you can achieve almost the same that you can achieve with other test automation frameworks, it’s easy to understand, can be executed on the cloud, it’s compatible with different technologies, Android and iOS. I see a great future for this tool if they follow the path of no code, self locator healing and add compatibility to real devices.

Leave a Comment

Scroll to Top