react-native-is-maestro
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

react-native-is-maestro

This React Native library provides a way to detect synchronously if the app is currently running in an E2E test environment with Maestro. It can be useful for disabling certain functionality or UI elements that may interfere with the test. To use the library, simply import it and call the isMaestro() function.

Installation

npm install react-native-is-maestro
yarn add react-native-is-maestro

Auto-linking

cd ios && pod install

Expo

Works out of the box without any addition config

Usage

import React from 'react'
import { StyleSheet, View, Text } from 'react-native'
import { isMaestro } from 'react-native-is-maestro'

export const App = () => (
    <View style={styles.container}>
        <Text>
            isMaestro detected: {isMaestro() ? 'yes' : 'no'}
        </Text>
    </View>
)

const styles = StyleSheet.create({
    container: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center'
    }
})

Supported versions

This library is fully compatible with TypeScript and can be used on both iOS and Android platforms. It also supports both old (Paper) and new architecture (Fabric) of React Native.

Lib version RN version Maestro CLI
1.0 >= 0.71 >= 1.19
2.0 0.71, 0.72 >= 1.22.1

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i react-native-is-maestro

Weekly Downloads

2,355

Version

2.1.0

License

MIT

Unpacked Size

51.9 kB

Total Files

32

Last publish

Collaborators

  • jpudysz