Powerful Maestro Flakiness: Source Code Analysis
Posted on Dec 25
• Originally published at devicelab.dev on Dec 25
Maestro markets itself as a test framework that "embraces the instability of mobile applications." But what does that actually mean in code? I dug into the source to find out.
"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 tries to counter it."
"No need to pepper your tests with sleep() calls. Maestro knows that it might take time to load the content and automatically waits for it (but no longer than required)."
Sounds great. Let's see what the code actually does.
When you write tapOn: "Login", Maestro doesn't look once and fail. It polls continuously. But for how long?
Want to wait 30 seconds for a slow API response? Too bad. Want to fail-fast in 3 seconds for performance testing? Also no.
This is a tight polling loop with no configurable delay between iterations. It just hammers the view hierarchy until it finds the element or times out.
Compare to Appium's FluentWait where you can set custom timeout, custom polling interval, and exceptions to ignore.
Maestro has a clever feature: if a tap doesn't change the UI, it retries. But how many times?
Source: Dev.to