Skip to content

Skip test cases list in maestro tests using launch arguments#897

Draft
ajpallares wants to merge 1 commit into
add-maestro-e2e-test-ci-jobfrom
pallares/maestro-launch-args
Draft

Skip test cases list in maestro tests using launch arguments#897
ajpallares wants to merge 1 commit into
add-maestro-e2e-test-ci-jobfrom
pallares/maestro-launch-args

Conversation

@ajpallares
Copy link
Copy Markdown
Member

@ajpallares ajpallares commented Apr 8, 2026

Summary

  • Pass e2e_test_flow as a Maestro launchApp argument so the app navigates directly to the target test case screen, bypassing the Test Cases list
  • On iOS, uses a native Objective-C++ plugin (LaunchArgs.mm) to read from UserDefaults via DllImport
  • On Android, uses AndroidJavaObject to read from the activity's intent extras
  • Makes maestro tests faster by skipping the list navigation step
  • The Test Cases list is preserved for manual/local usage

Related PRs

Follows the same pattern as the iOS SDK's maestro app (purchases-ios/Examples/rc-maestro).

@ajpallares ajpallares added the pr:other Changes to our CI configuration files and scripts label Apr 8, 2026
ajpallares added a commit to RevenueCat/react-native-purchases that referenced this pull request Apr 13, 2026
## Summary
- Pass `e2e_test_flow` as a Maestro `launchApp` argument so the app
navigates directly to the target test case screen, bypassing the Test
Cases list
- Reads the argument via `initialProps` on iOS (UserDefaults) and
Android (intent extras)
- Makes maestro tests faster by skipping the list navigation step
- The Test Cases list is preserved for manual/local usage

## Related PRs
- RevenueCat/purchases-kmp#796
- RevenueCat/purchases-flutter#1714
- RevenueCat/purchases-capacitor#757
- RevenueCat/cordova-plugin-purchases#919
- RevenueCat/purchases-unity#897

Follows the same pattern as the iOS SDK's maestro app
(`purchases-ios/Examples/rc-maestro`).

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
ajpallares added a commit to RevenueCat/purchases-flutter that referenced this pull request Apr 15, 2026
## Summary
- Pass `e2e_test_flow` as a Maestro `launchApp` argument so the app
navigates directly to the target test case screen, bypassing the Test
Cases list
- Uses a `MethodChannel` to bridge the launch argument from native (iOS
UserDefaults / Android intent extras) to Dart
- Makes maestro tests faster by skipping the list navigation step
- The Test Cases list is preserved for manual/local usage

## Related PRs
- RevenueCat/react-native-purchases#1722
- RevenueCat/purchases-kmp#796
- RevenueCat/purchases-capacitor#757
- RevenueCat/cordova-plugin-purchases#919
- RevenueCat/purchases-unity#897

Follows the same pattern as the iOS SDK's maestro app
(`purchases-ios/Examples/rc-maestro`).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Limited to the e2e Maestro test app and test YAML; main risk is
platform channel/launch-arg wiring causing the app to not route
correctly and slowing or breaking test runs.
> 
> **Overview**
> Maestro e2e tests can now pass an `e2e_test_flow` launch argument to
open a specific test case screen directly, skipping the Test Cases list
navigation.
> 
> This adds a native↔Flutter `MethodChannel`
(`com.revenuecat.maestro/launch_args`) on Android (intent extra) and iOS
(UserDefaults) and updates the Flutter app to resolve the requested
`flowKey` from `testCases` and use it as the initial home screen
(fallback remains `TestCasesScreen` for manual runs).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4d6fc7f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
ajpallares added a commit to RevenueCat/cordova-plugin-purchases that referenced this pull request Apr 20, 2026
## Summary

Passes `e2e_test_flow` as a Maestro `launchApp` argument so the app
navigates directly to the target test case screen, bypassing the Test
Cases list.

### Changes:
- Adds a local `cordova-plugin-launch-args` Cordova plugin with iOS
(reads UserDefaults) and Android (reads intent extras) implementations
to bridge the argument to the JS layer
- Updates `app.js` to use `LaunchArgs.getTestFlow()` with the
`TEST_CASES` registry for routing (same pattern as Flutter's `testCases`
list and KMP's `testFlowScreenMap`)
- When no `e2e_test_flow` is set, falls back to showing the Test Cases
list screen
- Makes maestro tests faster by skipping the list navigation step

## Related PRs
- RevenueCat/react-native-purchases#1722
- RevenueCat/purchases-kmp#796
- RevenueCat/purchases-flutter#1714
- RevenueCat/purchases-capacitor#757
- RevenueCat/purchases-unity#897

Follows the same pattern as the iOS SDK's maestro app
(`purchases-ios/Examples/rc-maestro`).

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@ajpallares ajpallares force-pushed the pallares/maestro-launch-args branch 6 times, most recently from 3fcb173 to 76ac7a0 Compare April 27, 2026 11:01
Pass e2e_test_flow as a launchApp argument so the app navigates
directly to the target test case screen, making tests faster.
The Test Cases list is preserved for manual/local usage.

Made-with: Cursor
@ajpallares ajpallares force-pushed the pallares/maestro-launch-args branch from 76ac7a0 to df5c54c Compare April 27, 2026 11:23
ajpallares added a commit to RevenueCat/purchases-capacitor that referenced this pull request Apr 27, 2026
## Summary
- Pass `e2e_test_flow` as a Maestro `launchApp` argument so the app
navigates directly to the target test case screen, bypassing the Test
Cases list
- Adds a local `LaunchArgsPlugin` Capacitor plugin on both iOS (reads
UserDefaults) and Android (reads intent extras) to bridge the argument
to the web layer
- Makes maestro tests faster by skipping the list navigation step
- The Test Cases list is preserved for manual/local usage

## Related PRs
- RevenueCat/react-native-purchases#1722
- RevenueCat/purchases-kmp#796
- RevenueCat/purchases-flutter#1714
- RevenueCat/cordova-plugin-purchases#919
- RevenueCat/purchases-unity#897

Follows the same pattern as the iOS SDK's maestro app
(`purchases-ios/Examples/rc-maestro`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:other Changes to our CI configuration files and scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant