Skip to content

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

Closed
ajpallares wants to merge 2 commits into
add-maestro-e2e-test-ci-jobfrom
pallares/maestro-launch-args
Closed

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

Conversation

@ajpallares

@ajpallares ajpallares commented Apr 8, 2026

Copy link
Copy Markdown
Member

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 Android, reads from intent extras; on iOS, reads from UserDefaults and passes through SwiftUI → KMP Compose
  • 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).

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 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

Copy link
Copy Markdown
Member Author

Superseded — rebased onto 3.0.0-dev as the base branch. Changes ported to a new PR in the 3.0.0-dev stack.

@ajpallares ajpallares closed this Apr 27, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant