chore: block logs in maestro tests - #636
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make Maestro E2E screenshot assertions reliable by preventing React Native LogBox warning overlays from appearing during test runs, while keeping normal dev behavior unchanged.
Changes:
- Add a bundled
e2e-config.jsonflag file (defaultdisableLogBox: false) to control E2E-only behavior. - Update the RN example app entrypoint to read that flag and call
LogBox.ignoreAllLogs()when enabled. - Update the Maestro
run-tests.shscript to flip the flag on before the run and restore it on exit.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/react-native-example/index.js | Reads e2e-config.json and disables LogBox when disableLogBox is enabled. |
| apps/react-native-example/e2e-config.json | Introduces a bundled configuration flag (default off) for E2E behavior. |
| .maestro/scripts/run-tests.sh | Toggles the flag for the E2E run and restores it during cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why?
Suppresses the RN example app's LogBox during Maestro E2E runs so dev warning overlays/toasts never corrupt the exact-match (100% threshold) screenshot assertions.
Driven entirely from
run-tests.shvia a bundled flag file (e2e-config.json) — no native module, nopod install, no Metro config, and no per-flow YAML changes:run-tests.shflips the flag totruebefore build/setup and restores it tofalseon exit (folded into the existing device-shutdown trap).index.jsreads the flag and callsLogBox.ignoreAllLogs()when it's set.- launchAppat the start of each flow reloads the bundle.Normal
yarn ios/dev builds keep LogBox on (flag defaults tofalse).Testing
yarn test:e2e:smoke:ios(or:android) and confirm screenshots no longer capture the LogBox warning overlay.yarn react-native-example iosstill shows LogBox warnings.e2e-config.jsonis restored tofalse(clean git tree).PR Checklist