In this blog, we will explore how to automate Odoo Mobile App Automation Using Maestro and simplify the testing process.
Odoo is a powerful open-source business management software that helps companies streamline various processes, including sales, invoicing, inventory, and customer management.
While Odoo offers a web-based interface and a mobile app, automating workflows within the mobile app can enhance efficiency and reduce manual efforts.
This is where Maestro, a UI testing and automation framework for mobile applications, comes in handy.
What is Maestro:-
Maestro is a lightweight mobile UI testing and automation framework designed for Android and iOS applications.
It is widely used for automating user interactions with mobile apps, such as tapping buttons, entering text, and navigating screens.
It allows developers and testers to write easy-to-read human-readable test scripts. Maestro utilizes YAML-based test scripts to streamline mobile app automation.
Key Features of Maestro:-
- Simple YAML-Based Scripting – Write test cases in an easy-to-read format
- Fast Execution – Faster than traditional UI testing tools like Appium
- CI/CD Integration – Works with GitHub Actions, Jenkins, etc., for automated testing
- Cross-Platform Support – Works on both Android and iOS
- Built-in Assertions & UI Navigation – Handles common UI interactions like taps, swipes, and text input easily.
Setting Up Maestro for Odoo Mobile App:-
Setting up Maestro for an Odoo Mobile App involves configuring Maestro test automation to automate UI testing for your Odoo mobile application.
Here’s a step-by-step guide to get started:
1:-Install Maestro CLI:-
Use this command to install Maestro on macOS, Linux, or Windows:
1 |
curl -fsSL "https://get.maestro.mobile.dev" | bash |
For macOS, Homebrew offers a simpler alternative to the installation script:
1 2 |
brew tap mobile-dev-inc/tap brew install maestro |
2:-Verify Installation:-
Check if Maestro is installed correctly by running:
1 |
maestro --version |
3. Connect Your Mobile Device or Emulator:-
Ensure that your device/emulator is connected:
- For Android, enable USB Debugging and check with:
1 |
adb devices |
- For iOS, use:
1 |
xcrun simctl list devices |
4:-Install Odoo Mobile App:-
Download the Odoo Mobile App and install it on the test device:
Android:
Maestro supports APK files, but AAB files are not supported.
1 |
adb install <path-to-apk> |
iOS:
Maestro is compatible with iOS Simulator builds (.app), but it does not support App Store distribution (.ipa) builds.
If you want to install them .app
manually, locate it in Xcode:
Product → Show Build Folder in Finder → Products/Debug-iphonesimulator
You can install it on the simulator by dragging and dropping the file or using Xcode command line tools:
1 |
xcrun simctl install booted <path-to-app> |
5. Create a Maestro Test Flow (.yaml
File):-
Inside your project, create a maestro
folder and add a test file, e.g., login_test.yaml
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
appId: com.webkul.mobikul.odoo --- - launchApp: clearState: true //WalkThrough - extendedWaitUntil: visible: "Skip" timeout: 100000 - tapOn: "Skip" // Login - tapOn: "SIGN IN WITH EMAIL" - tapOn: "Email Address*" - eraseText - inputText: "odoowebkul12@webkul.com" - tapOn: "Password*" - eraseText - inputText: "mobikuldemo" - tapOn: "SIGN IN" |
6. Run the Test:-
Execute the test flow using:
1 |
maestro test maestro/login_test.yaml |
7. Debug and Improve Tests:-
Maestro Studio is fully integrated with Maestro CLI.
Simply update your CLI to the latest version and use the command below to open Maestro Studio in your browser, allowing you to interactively create test flows.
1 |
maestro studio |
If tests fail, refine selectors and update test logic.