Maestro & Expo: Crafting the Future of Efficient e2e Testing

Rate this content
Bookmark

If you’ve never heard of Maestro, I will show you why I think it's the best e2e testing tool.

And if you have, I will share some tips for an effective integration into your workflow.

This is an educational talk on Maestro where I’ll cover when, what & how to test. I often see people re-building for each run. So I’ll also dig into some Expo specificities (such as eas update & build:list) that will enable you to optimize time and cost and achieve a state-of-the-art CI/CD with Maestro.

This talk has been presented at React Advanced 2024, check out the latest edition of this React Conference.

FAQ

End-to-end testing examines an app in its entirety, similar to a test drive of a high-performance sports car, to catch bugs that unit or interaction tests might miss.

The tools mentioned are Appium, Detox, and Maestro. Appium is powerful but complex, Detox is simpler but less powerful, and Maestro offers a balance with ease of use and community support.

Maestro is simple to install, has a supportive community, and provides tools like Maestro Studio for building tests and Maestro Cloud for running tests on cloud servers.

Maestro Cloud allows you to run tests on their servers, managing simulators and builds for you, and provides auto-retry and video recordings of failed tests.

Expo is a set of tools that helps iterate quicker by using custom development builds and EAS (Expo Application Services), allowing for efficient building and sharing of apps without rebuilding on each CI/CD pipeline.

Tests in Maestro can be tagged to run based on specific triggers, such as every pull request, weekly, or before deploying an update, allowing for a tailored testing strategy.

End-to-end tests are complex to set up and can be unreliable. They require building the app, starting simulators, ensuring the right environment, and can be slow and expensive to run regularly.

EAS allows the creation and sharing of builds without rebuilding the app for each pipeline, making the process faster, cheaper, and simpler.

After the 100 free tests per month, the cost is 10 cents per test. There is also an option to self-host to reduce costs.

Maestro does not support iOS devices yet, only simulators, and there is no device farm support. Tests are written in YAML, which is not type-safe or standard, and there's a limit of 100 free tests per month.

Mathieu Fedrigo
Mathieu Fedrigo
20 min
28 Oct, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
End-to-end testing is important for catching hard-to-find bugs, but it can be complex and time-consuming. The speaker shares their journey at YOLO apps and how they addressed these issues using Maestro, a newer testing tool. Maestro allows interaction with all aspects of the app and offers a web interface for building tests. It also provides features like auto retry and test videos for troubleshooting. The speaker also discusses automating CI/CD using Expo and EAS, which simplified the app build and distribution process. They demonstrate how EAS and MySQL Cloud can be used for reporting and investigation. The power of end-to-end testing is showcased, with a fast CI/CD time and free tests and EAS updates. Maestro has some limitations, but it offers easy test writing and 100 free tests per month, with additional tests available at a cost.

1. Introduction to End-to-End Testing

Short description:

End-to-end testing is like a test drive for your app, examining it in its entirety and catching hard-to-find bugs. However, setting up and using end-to-end tests can be complex, unreliable, and time-consuming. My talk today will share my journey at YOLO apps and how I addressed these issues to achieve the perfect end-to-end setup.

Hey, I hope you're doing well. I'm Mathieu and it's nice to be here today. I'm going to talk about end-to-end testing. So think of your app as a high-performance sports car. You wouldn't just test the engine or the brakes or the steering in isolation. You would want to take it out for a spin, see how it performs on tracks in real-world conditions. Well, that's the essence of end-to-end testing. It's like your test drive. It examines your app in its entirety, catching those hard-to-find bugs, especially in native code, that unit or interaction tests might miss.

Maybe you've heard about the testing pyramid or testing trophy. They always mention end-to-end testing but the reality is that I've worked with different clients at YOLO apps and I rarely saw a good end-to-end testing setup. And most of the time there are no end-to-end tests at all. And I believe that's because there are a lot of pain points.

So, first of all, the end-to-end tests for me are still complex to set up and use. I took more than a week to set it up with some tools. The tests can be unreliable and it's going to be annoying to set it up on CI-CD properly because you have to build the app, start the simulators, have the right environment. And last but not least, it's almost always slow and expensive to run them regularly. So, my talk today is about my journey at YOLO apps and how I tried to fix all of those issues to have the perfect end-to-end setup.

2. Exploring Appium, Detox, and Maestro

Short description:

I tried Appium, a powerful black-box end-to-end testing tool. However, it has complex documentation, a steep learning curve, and no CI-CD support. Then, I explored Detox, a simpler but less powerful React Native testing tool. Neither of these tools addressed the pain points I mentioned earlier. Finally, I discovered Maestro, a newer tool with a cool community and helpful documentation. I'm going to demonstrate how Maestro works using a simple app and Maestro Studio, a web interface for building tests.

First of all, I tried Appium. It's a black-box end-to-end testing tool. There's no need to bundle or to install anything inside your app. You just give it the app, the APK. And I think it's the most established tool and also the most powerful one. Appium can replicate almost anything a real user can do.

But for me there are also a lot of drawbacks. It's really complex to understand the documentation, to set it up properly. I spent a lot of time to have my first test running. There's a huge learning curve and there's also no CI-CD support. So, you're going to have to handle the simulators, the build, and so on.

Then I tried Detox, which is a React Native end-to-end testing tool. I personally believe that they are pretty similar. I mean Detox is a bit simpler and easier to use overall but on the other hand it's less powerful. And after using those two tools, I realized it's still not something I would see my team and I use every day. They don't address the pain point I mentioned earlier. So, I had to continue digging and finally I discovered Maestro. Maestro is a newer tool. It works on React Native and every other mobile platforms. I think there's a really cool community around it. They have a Slack where they answer questions very quickly, for example. But the documentation is very cool and instead of talking about it, I'm going to show you how it works.

So, I've got here a simple app. I have an info button that opens the modal and I can swipe this modal back down and this is the test I'm going to try to do with Maestro. These kinds of tests is really hard to do without an end-to-end testing tool. With a regular integration testing tool like React Native Testing Library, you usually have to log the navigation. But you will see how I do it. The first thing we're going to do is use Maestro Studio. It's a tool that comes bundled in with Maestro and it's basically a web interface where your simulator is embedded and I can hover over my simulator and some zones and some text will be highlighted. This tool is here to help me construct, to help me build my tests.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Network Requests with Cypress
TestJS Summit 2021TestJS Summit 2021
33 min
Network Requests with Cypress
Top Content
Cecilia Martinez, a technical account manager at Cypress, discusses network requests in Cypress and demonstrates commands like cydot request and SCI.INTERCEPT. She also explains dynamic matching and aliasing, network stubbing, and the pros and cons of using real server responses versus stubbing. The talk covers logging request responses, testing front-end and backend API, handling list length and DOM traversal, lazy loading, and provides resources for beginners to learn Cypress.
Testing Pyramid Makes Little Sense, What We Can Use Instead
TestJS Summit 2021TestJS Summit 2021
38 min
Testing Pyramid Makes Little Sense, What We Can Use Instead
Top Content
Featured Video
Gleb Bahmutov
Roman Sandler
2 authors
The testing pyramid - the canonical shape of tests that defined what types of tests we need to write to make sure the app works - is ... obsolete. In this presentation, Roman Sandler and Gleb Bahmutov argue what the testing shape works better for today's web applications.
Full-Circle Testing With Cypress
TestJS Summit 2022TestJS Summit 2022
27 min
Full-Circle Testing With Cypress
Top Content
Cypress is a powerful tool for end-to-end testing and API testing. It provides instant feedback on test errors and allows tests to be run inside the browser. Cypress enables testing at both the application and network layers, making it easier to reach different edge cases. With features like AppActions and component testing, Cypress allows for comprehensive testing of individual components and the entire application. Join the workshops to learn more about full circle testing with Cypress.
Test Effective Development
TestJS Summit 2021TestJS Summit 2021
31 min
Test Effective Development
Top Content
This Talk introduces Test Effective Development, a new approach to testing that aims to make companies more cost-effective. The speaker shares their personal journey of improving code quality and reducing bugs through smarter testing strategies. They discuss the importance of finding a balance between testing confidence and efficiency and introduce the concepts of isolated and integrated testing. The speaker also suggests different testing strategies based on the size of the application and emphasizes the need to choose cost-effective testing approaches based on the specific project requirements.
Playwright Test Runner
TestJS Summit 2021TestJS Summit 2021
25 min
Playwright Test Runner
Top Content
The Playwright Test Runner is a cross-browser web testing framework that allows you to write tests using just a few lines of code. It supports features like parallel test execution, device emulation, and different reporters for customized output. Code-Gen is a new feature that generates code to interact with web pages. Playwright Tracing provides a powerful tool for debugging and analyzing test actions, with the ability to explore trace files using TraceViewer. Overall, Playwright Test offers installation, test authoring, debugging, and post-mortem debugging capabilities.
Everyone Can Easily Write Tests
TestJS Summit 2023TestJS Summit 2023
21 min
Everyone Can Easily Write Tests
Playwright is a reliable end-to-end testing tool for modern web apps that provides one API, full isolation, fast execution, and supports multiple languages. It offers features like auto-weighting, retrying assertions, seamless testing of iframes and shadow DOM, test isolation, parallelism, and scalability. Playwright provides tools like VS Code extension, UiMode, and Trace Viewer for writing, debugging, and running tests. Effective tests prioritize user-facing attributes, use playwright locators and assertions, and avoid testing third-party dependencies. Playwright simplifies testing by generating tests, providing code generation and UI mode, and allows for easy running and debugging of tests. It helps in fixing failed tests and analyzing DOM changes, fixing locator mismatches, and scaling tests. Playwright is open source, free, and continuously growing.

Workshops on related topic

Designing Effective Tests With React Testing Library
React Summit 2023React Summit 2023
151 min
Designing Effective Tests With React Testing Library
Top Content
Featured Workshop
Josh Justice
Josh Justice
React Testing Library is a great framework for React component tests because there are a lot of questions it answers for you, so you don’t need to worry about those questions. But that doesn’t mean testing is easy. There are still a lot of questions you have to figure out for yourself: How many component tests should you write vs end-to-end tests or lower-level unit tests? How can you test a certain line of code that is tricky to test? And what in the world are you supposed to do about that persistent act() warning?
In this three-hour workshop we’ll introduce React Testing Library along with a mental model for how to think about designing your component tests. This mental model will help you see how to test each bit of logic, whether or not to mock dependencies, and will help improve the design of your components. You’ll walk away with the tools, techniques, and principles you need to implement low-cost, high-value component tests.
Table of contents- The different kinds of React application tests, and where component tests fit in- A mental model for thinking about the inputs and outputs of the components you test- Options for selecting DOM elements to verify and interact with them- The value of mocks and why they shouldn’t be avoided- The challenges with asynchrony in RTL tests and how to handle them
Prerequisites- Familiarity with building applications with React- Basic experience writing automated tests with Jest or another unit testing framework- You do not need any experience with React Testing Library- Machine setup: Node LTS, Yarn
How to Start With Cypress
TestJS Summit 2022TestJS Summit 2022
146 min
How to Start With Cypress
Featured WorkshopFree
Filip Hric
Filip Hric
The web has evolved. Finally, testing has also. Cypress is a modern testing tool that answers the testing needs of modern web applications. It has been gaining a lot of traction in the last couple of years, gaining worldwide popularity. If you have been waiting to learn Cypress, wait no more! Filip Hric will guide you through the first steps on how to start using Cypress and set up a project on your own. The good news is, learning Cypress is incredibly easy. You'll write your first test in no time, and then you'll discover how to write a full end-to-end test for a modern web application. You'll learn the core concepts like retry-ability. Discover how to work and interact with your application and learn how to combine API and UI tests. Throughout this whole workshop, we will write code and do practical exercises. You will leave with a hands-on experience that you can translate to your own project.
Introducing FlashList: Let's build a performant React Native list all together
React Advanced 2022React Advanced 2022
81 min
Introducing FlashList: Let's build a performant React Native list all together
Top Content
WorkshopFree
David Cortés Fulla
Marek Fořt
Talha Naqvi
3 authors
In this workshop you’ll learn why we created FlashList at Shopify and how you can use it in your code today. We will show you how to take a list that is not performant in FlatList and make it performant using FlashList with minimum effort. We will use tools like Flipper, our own benchmarking code, and teach you how the FlashList API can cover more complex use cases and still keep a top-notch performance.You will know:- Quick presentation about what FlashList, why we built, etc.- Migrating from FlatList to FlashList- Teaching how to write a performant list- Utilizing the tools provided by FlashList library (mainly the useBenchmark hook)- Using the Flipper plugins (flame graph, our lists profiler, UI & JS FPS profiler, etc.)- Optimizing performance of FlashList by using more advanced props like `getType`- 5-6 sample tasks where we’ll uncover and fix issues together- Q&A with Shopify team
Detox 101: How to write stable end-to-end tests for your React Native application
React Summit 2022React Summit 2022
117 min
Detox 101: How to write stable end-to-end tests for your React Native application
Top Content
WorkshopFree
Yevheniia Hlovatska
Yevheniia Hlovatska
Compared to unit testing, end-to-end testing aims to interact with your application just like a real user. And as we all know it can be pretty challenging. Especially when we talk about Mobile applications.
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
API Testing with Postman Workshop
TestJS Summit 2023TestJS Summit 2023
48 min
API Testing with Postman Workshop
Top Content
WorkshopFree
Pooja Mistry
Pooja Mistry
In the ever-evolving landscape of software development, ensuring the reliability and functionality of APIs has become paramount. "API Testing with Postman" is a comprehensive workshop designed to equip participants with the knowledge and skills needed to excel in API testing using Postman, a powerful tool widely adopted by professionals in the field. This workshop delves into the fundamentals of API testing, progresses to advanced testing techniques, and explores automation, performance testing, and multi-protocol support, providing attendees with a holistic understanding of API testing with Postman.
1. Welcome to Postman- Explaining the Postman User Interface (UI)2. Workspace and Collections Collaboration- Understanding Workspaces and their role in collaboration- Exploring the concept of Collections for organizing and executing API requests3. Introduction to API Testing- Covering the basics of API testing and its significance4. Variable Management- Managing environment, global, and collection variables- Utilizing scripting snippets for dynamic data5. Building Testing Workflows- Creating effective testing workflows for comprehensive testing- Utilizing the Collection Runner for test execution- Introduction to Postbot for automated testing6. Advanced Testing- Contract Testing for ensuring API contracts- Using Mock Servers for effective testing- Maximizing productivity with Collection/Workspace templates- Integration Testing and Regression Testing strategies7. Automation with Postman- Leveraging the Postman CLI for automation- Scheduled Runs for regular testing- Integrating Postman into CI/CD pipelines8. Performance Testing- Demonstrating performance testing capabilities (showing the desktop client)- Synchronizing tests with VS Code for streamlined development9. Exploring Advanced Features - Working with Multiple Protocols: GraphQL, gRPC, and more
Join us for this workshop to unlock the full potential of Postman for API testing, streamline your testing processes, and enhance the quality and reliability of your software. Whether you're a beginner or an experienced tester, this workshop will equip you with the skills needed to excel in API testing with Postman.
How to Build an Interactive “Wheel of Fortune” Animation with React Native
React Summit Remote Edition 2021React Summit Remote Edition 2021
60 min
How to Build an Interactive “Wheel of Fortune” Animation with React Native
Top Content
Workshop
Oli Bates
Oli Bates
- Intro - Cleo & our mission- What we want to build, how it fits into our product & purpose, run through designs- Getting started with environment set up & “hello world”- Intro to React Native Animation- Step 1: Spinning the wheel on a button press- Step 2: Dragging the wheel to give it velocity- Step 3: Adding friction to the wheel to slow it down- Step 4 (stretch): Adding haptics for an immersive feel