Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 55 additions & 0 deletions e2e-tests/MaestroTestApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Maestro E2E Test App

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

## Prerequisites

- Node.js & npm
- Xcode (iOS) / Android Studio (Android)
- [Maestro](https://maestro.mobile.dev/) CLI
- Gradle (for Android builds)

## Setup

```bash
npm install
npx cordova prepare
```

## Running Locally

```bash
# iOS
npx cordova run ios --emulator

# Android
npx cordova run android --emulator
```

## 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 `www/js/app.js` 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

`cordova-plugin-purchases` is referenced as a local `file:` dependency so the E2E
tests always exercise the code on the current branch, not a published npm version.

## Note on Cordova

Cordova does not have a native RevenueCat UI plugin, so the paywall is implemented as
a custom HTML overlay that manually calls `Purchases.purchasePackage()`.
9 changes: 9 additions & 0 deletions e2e-tests/MaestroTestApp/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.revenuecat.automatedsdktests" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MaestroTestApp</name>
<description>Maestro E2E test app for cordova-plugin-purchases</description>
<platform name="ios">
<preference name="deployment-target" value="16.0" />
</platform>
<plugin name="cordova-plugin-purchases" spec="*" />
</widget>
Loading