Skip to content

Add maestro E2E test for purchase through paywall#837

Draft
ajpallares wants to merge 19 commits into
e2e-tests-appfrom
add-maestro-e2e-test
Draft

Add maestro E2E test for purchase through paywall#837
ajpallares wants to merge 19 commits into
e2e-tests-appfrom
add-maestro-e2e-test

Conversation

@ajpallares
Copy link
Copy Markdown
Member

@ajpallares ajpallares commented Feb 27, 2026

Summary

  • Adds Maestro YAML test files for the "purchase through paywall" E2E flow
  • Adds config.yaml for Maestro test execution
  • Test flow: clear state → launch app → navigate to purchase screen → verify no entitlements → present V2 paywall → select "Yearly" → tap "Continue" → confirm purchase → verify "pro" entitlement
  • Adds utils/confirm_purchase.yaml utility that handles test store purchase confirmation on both iOS and Android (using regex to match platform-specific alert text)

Depends on #836

@ajpallares ajpallares added the pr:feat A new feature label Feb 27, 2026
@ajpallares ajpallares added pr:other Changes to our CI configuration files and scripts and removed pr:feat A new feature labels Feb 27, 2026
@ajpallares ajpallares force-pushed the add-maestro-e2e-test branch 5 times, most recently from 10a37d7 to df2c385 Compare March 30, 2026 15:03
@ajpallares ajpallares force-pushed the add-maestro-e2e-test branch from df2c385 to dd86a57 Compare March 30, 2026 15:16
@ajpallares ajpallares changed the title feat: add maestro E2E test for purchase through paywall Add maestro E2E test for purchase through paywall Apr 6, 2026
ajpallares and others added 4 commits April 6, 2026 19:12
Adds takeScreenshot steps at purchase screen, paywall, and
entitlements unlocked stages for consistency with other SDKs.

Made-with: Cursor
These steps were only used for debugging CI failures and add
unnecessary clutter to the CI report.

Made-with: Cursor
…stApp

- Call SceneSetup.SetupScene() from BuildIOS/BuildAndroid to combine
  into a single Unity invocation
- Set Android minSdkVersion to 24 (required by PHC-UI 18.1.0)
- Strip unnecessary packages (Ads, Analytics, Purchasing, Timeline, etc.)
  from manifest.json (39 -> 11 packages)
- Commit packages-lock.json, ProjectSettings/, .gitignore, .meta files,
  and the generated Main scene

Made-with: Cursor
@RevenueCat-Danger-Bot
Copy link
Copy Markdown

RevenueCat-Danger-Bot commented Apr 27, 2026

1 Warning
⚠️ This PR increases the size of the repo by more than 100.00 KB (increased by 123.07 KB).

Generated by 🚫 Danger

…stApp

The RevenueCat SDK dependencies require Java 17 source compatibility.
Without custom Gradle templates, Unity defaults to Java 8 which causes
compileReleaseJavaWithJavac to fail.

Made-with: Cursor
The Unity-generated Xcode project needs PurchasesHybridCommon and
PurchasesHybridCommonUI pods installed. The xcode_build_maestro_test_app
Fastlane lane now generates a Podfile, runs pod install, and builds
using the xcworkspace instead of the xcodeproj.

Made-with: Cursor
The RevenueCat native plugin .m files are compiled inside the
UnityFramework target, not Unity-iPhone. The CocoaPods dependencies
need to be available to UnityFramework for the modules to be found.

Made-with: Cursor
Swift pods need framework-style integration to properly generate and
expose their -Swift.h umbrella headers. Using static linkage keeps
binary size down while enabling module imports in the UnityFramework
target.

Made-with: Cursor
Set PlayerSettings.iOS.sdkVersion = iOSSdkVersion.SimulatorSDK in
BuildIOS() so Unity generates an Xcode project with simulator-compatible
IL2CPP compilation. Simplify xcodebuild to use -destination instead of
manual -sdk/-arch overrides.

Made-with: Cursor
Unity reports 'build target unsupported' when SimulatorSDK is set.
Instead, build for the standard iOS device target in Unity and let
xcodebuild handle simulator targeting via -sdk iphonesimulator.
On macOS, the IL2CPP GameAssembly script phase will pick up the
correct simulator SDK from xcodebuild's environment.

Made-with: Cursor
Unity 6 defaults to Vulkan on Android, which isn't well supported on
x86_64 emulators. Force OpenGLES3 to ensure the app renders correctly
on CI emulators.

Made-with: Cursor
Unity UGUI renders on a single GLSurfaceView, so Maestro cannot
discover text elements in the Android accessibility tree. This adds
a transparent native overlay with real Android TextViews positioned
at the same screen coordinates as UGUI elements, enabling Maestro
to find and interact with them.

Made-with: Cursor
Wrap overlay initialization in try-catch to prevent app crashes
if the native overlay fails. Remove anonymous FrameLayout subclass
that could cause class loading issues.

Made-with: Cursor
The native overlay was causing the app to quit immediately after
gaining focus. Reverting to investigate a simpler approach.

Made-with: Cursor
Unity UGUI renders on a single GLSurfaceView so elements aren't
exposed to the Android accessibility tree. Switch to coordinate-based
taps for UGUI screens (derived from SceneSetup.cs anchors) while
keeping text-based assertions for the native paywall.

Made-with: Cursor
The arm64-only APK crashes with SIGILL when running through the
x86_64 emulator's ARM translation layer. Adding x86_64 as a target
architecture allows the app to run natively on CI emulators.

Made-with: Cursor
Add Debug.Log to MaestroTestApp.Start() to diagnose why the app
exits. Restore original Maestro flow with text-based assertions
to confirm the app stays alive (as it did in pipeline #4005).

Made-with: Cursor
The previous overlay attempt failed because of an unrelated SIGILL
crash from arm64-on-x86_64 emulation. With x86_64 native build
in place, the overlay should work.

Also fix NullReferenceException in Purchases.Configure() by adding
DefaultExecutionOrder(100) to MaestroTestApp so Purchases.Start()
runs first and initializes the native wrapper before we use it.

Made-with: Cursor
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.

2 participants