GithubHelp home page GithubHelp logo

kiki-le-singe / react-native-maestro Goto Github PK

View Code? Open in Web Editor NEW
49.0 3.0 1.0 17.28 MB

A small project to show how to make UI testing with React Native and Maestro

Home Page: https://medium.com/@aalbertini95_90842/mobile-ui-testing-with-react-native-and-maestro-af7fa34df2fd

JavaScript 100.00%
android e2e-testing e2e-tests expo-cli expo-reactnative ios maestro mobile react-native ui-testing

react-native-maestro's Introduction

Mobile UI testing with React Native and Maestro

Introduction

I started this project mainly for fun and to develop my mobile UI testing skills. After reading the Documentation for Maestro and Maestro with React Native, I found it seemed easy to implement, simple and effective. So... Let's go! :D I created a React Native app built with Expo to simply this part. The aim of this project is Maestro. Enjoy it! :)

This app has three screens:

  • A sign in interface with two fields, email and password. After clicking the sign in button, if the form is valid (a valid email and password) we'll see the next screen.
  • A simple screen with greetings and email user, a link to another screen and a sign out button.
  • A scrollview screen with some texts and images. It's also possible to go back to the previous screen.

React Native Maestro app

Installation

React Native Maestro

$ git clone https://github.com/kiki-le-singe/react-native-maestro.git <name>
$ cd <name>
$ npm install

Maestro

$ curl -Ls "https://get.maestro.mobile.dev" | bash
$ maestro -v

Only for iOS: Connecting to Your Device

$ brew tap facebook/fb
$ brew install facebook/fb/idb-companion

See the official documentation: Installing Maestro

Run

$ npm start
$ npm run ios or android

Maestro tests

The tests are in the maestro directory. You can run them locally in your iOS simulator or Android emulator. At the moment, Maestro does not support real iOS devices. See Installing Maestro and Connecting to Your Device

You can run the tests in CI with Maestro Cloud. See Running Flows on CI.

Running tests

# run single test
$ maestro test maestro/[fileName].yaml

$ maestro test maestro/simple-flow.yaml

Simple Maestro flow



$ maestro test maestro/signin/signin-errors-flow.yaml

Sign in errors Maestro flow



$ maestro test maestro/signin/signin-success-flow.yaml

Sign in success Maestro flow



$ maestro test maestro/home/home-flow.yaml

Home flow



$ maestro test maestro/details/details-flow.yaml

Details flow


Sometimes you could see this error: Failed to reach out XCUITest Server... Maybe your component is not reachable, so you probably check your code. Sometimes the CLI just seems a little capricious... So just wait a few secondes... And it perfectly works! :D

Resources

react-native-maestro's People

Contributors

kiki-le-singe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sakethtadimeti

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.