{"id":27984264,"url":"https://github.com/alexanderhodes/react-native-cli-maestro-example","last_synced_at":"2025-05-08T05:01:48.756Z","repository":{"id":161072981,"uuid":"580772984","full_name":"alexanderhodes/react-native-cli-maestro-example","owner":"alexanderhodes","description":"Example repository for testing React Native CLI app with Maestro","archived":false,"fork":false,"pushed_at":"2024-06-21T15:37:37.000Z","size":3815,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-22T08:11:57.689Z","etag":null,"topics":["maestro","mobile","react-native","testing"],"latest_commit_sha":null,"homepage":"https://dev.to/b42/test-your-react-native-app-with-maestro-5bfj","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexanderhodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-21T12:12:49.000Z","updated_at":"2024-06-21T15:37:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"231e0a31-b2ee-4cb4-8ecd-4604a9c9c222","html_url":"https://github.com/alexanderhodes/react-native-cli-maestro-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderhodes%2Freact-native-cli-maestro-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderhodes%2Freact-native-cli-maestro-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderhodes%2Freact-native-cli-maestro-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderhodes%2Freact-native-cli-maestro-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexanderhodes","download_url":"https://codeload.github.com/alexanderhodes/react-native-cli-maestro-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002856,"owners_count":21838640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["maestro","mobile","react-native","testing"],"created_at":"2025-05-08T05:01:16.158Z","updated_at":"2025-05-08T05:01:48.686Z","avatar_url":"https://github.com/alexanderhodes.png","language":"Java","funding_links":[],"categories":["Example Projects"],"sub_categories":[],"readme":"# Example for using maestro with React Native (CLI)\n\nIn this repository we want to show how to use Maestro with React Native apps built with Expo. You can read the full article on our [blog at dev.to](https://dev.to/b42/test-your-react-native-app-with-maestro-5bfj). If you want check out maestro with a React Native Expo app, you can have a look at [this repository](https://github.com/alexanderhodes/react-native-expo-maestro-example), because there are some differences when launching the app with Expo.\n\nThe application is a simple sign in interface where username and password can be entered. After clicking the sign in button a success message will be displayed below the button.\n\n\u003cdiv style=\"display:flex;flex-direction:row\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/alexanderhodes/react-native-cli-maestro-example/main/res/example-screenshot.png\" alt=\"Screenshot Sign In\" height=\"400\" width=\"auto\" style=\"marginRight: 16px\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/alexanderhodes/react-native-cli-maestro-example/main/res/example-success-screenshot.png\" alt=\"Screenshot Sign In Success\" height=\"400\" width=\"auto\"\u003e\n\u003c/div\u003e\n\n## Running the app\n\nPreparing the app and installing the dependencies.\n\n```bash\n# Install dependencies\n$ npm install\n# Install ios pods\n$ npm run ios:pods\n# Start app\n$ npm start\n# Start ios app\n$ npm run ios\n# Start android app\n$ npm run android\n```\n\n## Maestro tests\n\nThe tests located in `.maestro` directory are developed for running locally in your iOS simulator or Android emulator.\n\nYou can run the tests as well in the cloud. For running the tests in the cloud.\n\nFor creating new workflows you can check out the [Maestro docs](https://maestro.mobile.dev) and [Maestro studio](https://maestro.mobile.dev/getting-started/maestro-studio).\n\n![Maestro studio](https://raw.githubusercontent.com/alexanderhodes/react-native-cli-maestro-example/main/res/maestro-studio-2.png)\n\n### Install maestro\n\nBefore running the tests, you need to setup Maestro on your machine. On MacOS and Linux you can follow these steps. \n\n```bash\n# install and upgrade maestro\n$ curl -Ls \"https://get.maestro.mobile.dev\" | bash\n```\n\nRunning flows on iOS Simulator requires installation of [Facebook IDB](https://fbidb.io).\n\n```bash\n$ brew tap facebook/fb\n$ brew install facebook/fb/idb-companion\n```\n\nOn windows you need to do further steps. A complete instruction can be found in the [Maestro docs](https://maestro.mobile.dev/getting-started/installing-maestro).\n\nYou can check if maestro is installed by checking the version. It should print the version number, e.g. 1.17.\n\n```bash\n$ maestro -v\n```\n\n### Running workflows\n\nThe workflows can be started with the Maestro CLI. Below you can find some commands for starting a single or multiple tests.\n\n```bash\n# run single test\n$ maestro test .maestro/sign-in-flow.yaml\n# run single test with external parameters\n$ maestro test -e USERNAME=\"Test User\" -e PASSWORD=Test123456 .maestro/sign-in-flow-external-parameters.yaml\n# running every test in directory\n$ maestro test -e USERNAME=\"Test User\" -e PASSWORD=Test123456 .maestro\n```\n\nFurthermore, it's possible to create test reports like this:\n\n```xml\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003ctestsuites\u003e\n  \u003ctestsuite name=\"Test Suite\" device=\"iPhone 14 Plus - iOS 16.1 - E7F8022E-939F-4165-B887-F342740BFCE6\" tests=\"5\" failures=\"0\"\u003e\n    \u003ctestcase id=\"sign-in-flow\" name=\"sign-in-flow\"/\u003e\n    \u003ctestcase id=\"sign-in-flow-with-subflow\" name=\"sign-in-flow-with-subflow\"/\u003e\n    \u003ctestcase id=\"sign-in-flow-constants\" name=\"sign-in-flow-constants\"/\u003e\n    \u003ctestcase id=\"sign-in-flow-testid\" name=\"sign-in-flow-testid\"/\u003e\n    \u003ctestcase id=\"sign-in-flow-external-parameters\" name=\"sign-in-flow-external-parameters\"/\u003e\n  \u003c/testsuite\u003e\n\u003c/testsuites\u003e\n```\n\nYou can run these tests with this command:\n\n```bash\n$ maestro test --format junit --output results.xml -e USERNAME=\"Test User\" -e PASSWORD=\"Test123456\" .maestro\n```\n\n### Creating video records\n\nIn addition to running tests, you can record them for getting a screen record.\n\n```bash\n# start video recording\n$ maestro record .maestro/sign-in-flow-testid.yaml\n```\n\n![Maestro record](https://raw.githubusercontent.com/alexanderhodes/react-native-cli-maestro-example/main/res/maestro-record.png)\n\n## Tips and tricks\n\nIn our article we described some tips and tricks, like usage of `testID`, parameters and constants, recording workflows and nested flows. \n\n## Further resources\n\n- [Maestro Documentation](https://maestro.mobile.dev)\n- [Maestro GitHub Repository](https://github.com/mobile-dev-inc/maestro)\n- [Maestro Cloud Documentation](https://cloud.mobile.dev)\n- [Example Repository for React Native Expo App](https://github.com/alexanderhodes/react-native-expo-maestro-example)\n- [Article about testing React Native apps with Maestro](https://dev.to/b42/test-your-react-native-app-with-maestro-5bfj)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderhodes%2Freact-native-cli-maestro-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexanderhodes%2Freact-native-cli-maestro-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderhodes%2Freact-native-cli-maestro-example/lists"}