Code Monkey home page Code Monkey logo

maestro-automation's Introduction

maestro-automation

This project demonstrates the use of Maestro to automate a mobile app.

πŸš€ Getting Started

🚧 Prerequisites

Disclaimer: The content, code, and testing of this project have been developed and evaluated primarily using Windows and Android testing perspectives. For other configurations, please refer to maestro.mobile.dev website for guidelines.

Before you can run this project, you must have the following software installed on your computer:

  • WSL2 (Window Subsystem for Linux)
  • Java Development Kit (JDK) version 11 or later
  • SDK and emulator setup (on this case, I used Android Studio)
  • Mobile application under test

🚨 Mobile application under test

πŸ› οΈ Installation

  1. Run the following command to install Maestro.
    curl -Ls "https://get.maestro.mobile.dev" | bash
    Or, you may follow the environment setup directly from the maestro.mobile.dev website depending on your system here.
  2. Clone this repository to your local machine.
    https://github.com/marizala/maestro-automation.git

πŸ‘¨πŸΌβ€πŸ”¬Tests

This project contains 2 sample test cases that demonstrate how to use Maestro to interact with mobile app in Android platform.

πŸ§ͺ Test Cases

  • get-started.yaml: Application onboarding process (accept Terms and Conditions, allow permission requests) and basic map actions.
  • trip-CRUD.yaml: Basic create, read, update and delete of a trip record.

πŸƒπŸ½ How to run the tests locally

  1. Run your emulator.

    emulator -avd <device_name>
    
  2. In Powershell, start the adb server.

    adb -a -P 5037 nodaemon server
    
  3. Open WSL2 terminal in the project root directory and run these commands.

    adb kill-server
    export ADB_SERVER_SOCKET=tcp:<WINDOWS_IPV4_ADDRESS>:5037
    adb devices
    
  4. Run your flow (test case) with this command.

    maestro --host <WINDOWS_IPV4_ADDRESS> --device <device_name> test -e APP_ID=<APP_ID> toyota-link/tests/trip-CRUD.yaml
    

βš™οΈ Useful commands (Android)

  • To install the mobile application adb -s <device_name> install <apk file>
  • To clear app data adb shell pm clear <app_id>

πŸ“Ή Demo

get-started.yaml

tc_get-started.mp4

trip-CRUD.yaml

tc_trip_CRUD.mp4

πŸƒπŸ½ How to run the tests on Maestro Cloud

  1. Open WSL2 terminal in the project root directory and login to the CLI by running this command.

    maestro login
    

    Sign in using your email address then the login link will be sent over to complete the process. If this is your first time logging in, you'll be prompted to create an account. Follow the printed instructions to complete the login process.

  2. Run your flow on Maestro Cloud with this command.

    maestro cloud --include-tags smoke -e APP_ID=<APP_ID> --app-file='<APP_FILE_PATH>' --flows='toyota-link/'
    
    

    maestro-cloud-terminal

    maestro-cloud

maestro-automation's People

Contributors

marizala avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.