Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f8ce9f7
feat: add maestro E2E test app
ajpallares Feb 27, 2026
5cda4d6
fix: add iOS native project files for MaestroTestApp
ajpallares Feb 27, 2026
218eefe
fix: add empty yarn.lock for standalone MaestroTestApp project
ajpallares Feb 27, 2026
18d9a41
fix: pin react-native-screens to ~4.4.0 for RN 0.76 compat
ajpallares Feb 27, 2026
ef166de
fix: update MaestroTestApp .gitignore to match repo conventions
ajpallares Feb 27, 2026
0102aa8
fix: convert MaestroTestApp iOS to Swift AppDelegate
ajpallares Feb 27, 2026
73da28c
feat: add StoreKit configuration for iOS maestro E2E tests
ajpallares Mar 25, 2026
2a5d507
fix: add StoreKit config to Xcode project file references
ajpallares Mar 25, 2026
22530ca
fix: restore correct scheme identifier path for StoreKit config
ajpallares Mar 25, 2026
a231be2
fix: update bundle identifier to com.revenuecat.automatedsdktests
ajpallares Mar 25, 2026
5547354
fix: use correct StoreKit configuration from purchases-ios maestro app
ajpallares Mar 25, 2026
7d5ac03
fix: use removeCustomerInfoUpdateListener instead of listener.remove()
ajpallares Mar 30, 2026
f5276e7
fix: commit resolved yarn.lock for MaestroTestApp
ajpallares Mar 30, 2026
8234eb8
feat: add Android project for MaestroTestApp
ajpallares Mar 30, 2026
9c43d51
chore: remove StoreKit configuration file (using test store instead)
ajpallares Mar 30, 2026
75986fa
Improve Maestro test app: local deps, error handling, types, README
ajpallares Mar 30, 2026
57b3bf3
Use workspace + module-resolver for local deps, surface errors in UI,…
ajpallares Mar 30, 2026
e9d206f
Add error handling to getCustomerInfo, use blockList, regenerate Podf…
ajpallares Mar 30, 2026
86a3b0b
Refresh Podfile.lock (hermes-engine 0.76.6 → 0.76.9)
ajpallares Mar 30, 2026
dd68b80
Add react-native.config.js for native module auto-linking
ajpallares Mar 30, 2026
666833f
Add native module includes to Android settings.gradle
ajpallares Mar 30, 2026
e078ea8
Upgrade MaestroTestApp to React Native 0.78 and align Android toolchain
ajpallares Mar 30, 2026
501ef9f
Pin react-native-screens to ~4.11.0 and refresh lockfiles
ajpallares Mar 30, 2026
d61badc
Update root yarn.lock for react-native-screens ~4.11.0 pin
ajpallares Mar 30, 2026
cf0ccbc
Add @react-native-community/cli to MaestroTestApp devDependencies
ajpallares Mar 30, 2026
1a554ee
fix: make MaestroTestApp CI-ready with embedded JS bundle
ajpallares Apr 6, 2026
c91d3d7
fix: add fatalError for missing jsbundle and document SDK resolution
ajpallares Apr 6, 2026
87e8ba3
fix: don't commit Podfile.lock for MaestroTestApp
ajpallares Apr 6, 2026
82fa025
fix: re-commit Podfile.lock for MaestroTestApp
ajpallares Apr 6, 2026
79ca5af
fix: remove stale MaestroTestApp/yarn.lock
ajpallares Apr 6, 2026
795e8a7
fix: pin react-native to 0.78.3 for Xcode 26.4 compatibility
ajpallares Apr 6, 2026
6fc2caa
fix: bump react-native to 0.78.3 for Xcode 26.4 compatibility
ajpallares Apr 6, 2026
2bd0cb0
revert: undo Podfile.lock re-commitment and react-native version bumps
ajpallares Apr 6, 2026
8867ce7
chore: add MaestroTestApp pod install to bootstrap script
ajpallares Apr 8, 2026
2f04c19
fix: regenerate yarn.lock from main with MaestroTestApp workspace
ajpallares Apr 8, 2026
b19bac4
Merge branch 'main' into e2e-tests-app
ajpallares Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions e2e-tests/MaestroTestApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# OSX
.DS_Store

# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
**/.xcode.env.local

# Android/IntelliJ
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore

# node.js
node_modules/
npm-debug.log
yarn-error.log

# Ruby / CocoaPods
**/Pods/
Podfile.lock
/vendor/bundle/

# Bundle artifact
*.jsbundle

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
39 changes: 39 additions & 0 deletions e2e-tests/MaestroTestApp/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, {useEffect} from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import Purchases from 'react-native-purchases';
import TestCasesScreen from './src/TestCasesScreen';
import PurchaseThroughPaywallScreen from './src/PurchaseThroughPaywallScreen';

export type RootStackParamList = {
TestCases: undefined;
PurchaseThroughPaywall: undefined;
};

const Stack = createNativeStackNavigator<RootStackParamList>();

const API_KEY = 'MAESTRO_TESTS_REVENUECAT_API_KEY';

export default function App() {
useEffect(() => {
Purchases.setLogLevel(Purchases.LOG_LEVEL.DEBUG);
Purchases.configure({apiKey: API_KEY});
}, []);

return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="TestCases"
component={TestCasesScreen}
options={{title: 'Test Cases'}}
/>
<Stack.Screen
name="PurchaseThroughPaywall"
component={PurchaseThroughPaywallScreen}
options={{title: 'Purchase through paywall'}}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
59 changes: 59 additions & 0 deletions e2e-tests/MaestroTestApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Maestro E2E Test App

A minimal React Native app used by Maestro end-to-end tests to verify RevenueCat SDK integration.

## Prerequisites

- Node.js & Yarn
- Xcode (iOS) / Android Studio (Android)
- [Maestro](https://maestro.mobile.dev/) CLI
- CocoaPods (`gem install cocoapods`)

## Setup

```bash
yarn install
cd ios && pod install && cd ..
```

## Running Locally

```bash
# iOS
yarn ios

# Android
yarn android
```

## API Key

The app initialises RevenueCat with the placeholder `MAESTRO_TESTS_REVENUECAT_API_KEY`.
In CI, the Fastlane lane replaces this placeholder with the real key from the
`RC_E2E_TEST_API_KEY_PRODUCTION_TEST_STORE` environment variable (provided by the
CircleCI `e2e-tests` context) before building.

To run locally, either:
- Replace the placeholder in `App.tsx` with a valid API key (do **not** commit it), or
- Export the env var and run the same `sed` command the Fastlane lane uses.

## RevenueCat Project

The test uses a RevenueCat project configured with:
- A **V2 Paywall** (the test asserts "Paywall V2" is visible)
- A `pro` entitlement (the test checks entitlement status after purchase)
- The **Test Store** environment for purchase confirmation

## Dependencies

This app is part of the `react-native-purchases` Yarn workspace. It uses the same
local dependency mechanism as `examples/purchaseTesterTypescript`:
- **Babel module-resolver** aliases `react-native-purchases` and
`react-native-purchases-ui` imports to the SDK source directories
- **Metro watchFolders** allows the bundler to access files outside the app's
project root
- **Metro exclusionList** prevents duplicate peer dependency resolution between
the app and the SDK's own `node_modules`

This ensures E2E tests always exercise the code on the current branch, not a
published npm version.
120 changes: 120 additions & 0 deletions e2e-tests/MaestroTestApp/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// Force JS bundling in debug builds (no Metro dev server on CI)
debuggableVariants = []

/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []

/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
Comment thread
tonidero marked this conversation as resolved.

/**
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'

android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

namespace "com.revenuecat.automatedsdktests"
defaultConfig {
applicationId "com.revenuecat.automatedsdktests"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}

dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
Binary file not shown.
10 changes: 10 additions & 0 deletions e2e-tests/MaestroTestApp/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.revenuecat.automatedsdktests

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "MaestroTestApp"

/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.revenuecat.automatedsdktests

import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
}
}
Loading