From 3a0c95df5702a5db49ff594c139be21d0ed5b40a Mon Sep 17 00:00:00 2001 From: Antonio Pallares Date: Mon, 6 Apr 2026 12:19:53 +0200 Subject: [PATCH] feat: add maestro E2E test for purchase flow Maestro YAML test files for the Cordova e2e test app: - purchase_through_paywall.yaml: Full purchase flow test - purchase_flow.yaml: Reusable helper flow for purchase scenarios - confirm_purchase.yaml: Test store purchase confirmation dialog - config.yaml: Maestro configuration Co-Authored-By: Claude Opus 4.6 Made-with: Cursor --- e2e-tests/maestro/config.yaml | 7 ++++ .../e2e_tests/purchase_through_paywall.yaml | 37 +++++++++++++++++++ e2e-tests/maestro/purchase_flow.yaml | 14 +++++++ e2e-tests/maestro/utils/confirm_purchase.yaml | 11 ++++++ 4 files changed, 69 insertions(+) create mode 100644 e2e-tests/maestro/config.yaml create mode 100644 e2e-tests/maestro/e2e_tests/purchase_through_paywall.yaml create mode 100644 e2e-tests/maestro/purchase_flow.yaml create mode 100644 e2e-tests/maestro/utils/confirm_purchase.yaml diff --git a/e2e-tests/maestro/config.yaml b/e2e-tests/maestro/config.yaml new file mode 100644 index 00000000..9f9b72d0 --- /dev/null +++ b/e2e-tests/maestro/config.yaml @@ -0,0 +1,7 @@ +# config.yaml + +executionOrder: + continueOnFailure: false + +flows: + - e2e_tests/* diff --git a/e2e-tests/maestro/e2e_tests/purchase_through_paywall.yaml b/e2e-tests/maestro/e2e_tests/purchase_through_paywall.yaml new file mode 100644 index 00000000..3fbcedc3 --- /dev/null +++ b/e2e-tests/maestro/e2e_tests/purchase_through_paywall.yaml @@ -0,0 +1,37 @@ +# This flow tests purchasing a product directly. +# Cordova does not have paywall presentation APIs, so instead of +# presenting a native paywall we fetch offerings and purchase the +# first available package directly. + +appId: com.revenuecat.automatedsdktests +name: Purchase product + +--- +- clearState +- pressKey: home +- launchApp +- takeScreenshot: purchase_product - Initial state after launch +- extendedWaitUntil: + visible: "Test Cases" + timeout: 30000 +- takeScreenshot: purchase_product - After Test Cases visible +- assertVisible: "Test Cases" +- tapOn: + text: "Purchase product" +- extendedWaitUntil: + visible: "Entitlements: none" + timeout: 15000 +- assertVisible: "Entitlements: none" +- extendedWaitUntil: + visible: "^Purchase$" + timeout: 30000 +- takeScreenshot: purchase_product - Purchase screen ready +- tapOn: + text: "^Purchase$" +- runFlow: + file: ../utils/confirm_purchase.yaml +- extendedWaitUntil: + visible: "Entitlements: pro" + timeout: 15000 +- takeScreenshot: purchase_product - Entitlements unlocked +- assertVisible: "Entitlements: pro" diff --git a/e2e-tests/maestro/purchase_flow.yaml b/e2e-tests/maestro/purchase_flow.yaml new file mode 100644 index 00000000..df13dfc5 --- /dev/null +++ b/e2e-tests/maestro/purchase_flow.yaml @@ -0,0 +1,14 @@ +appId: com.revenuecat.automatedsdktests +--- +- launchApp +- extendedWaitUntil: + visible: "Test Cases" + timeout: 15000 +- assertVisible: "Purchase product" +- tapOn: "Purchase product" +- extendedWaitUntil: + visible: "Entitlements: none" + timeout: 15000 +- extendedWaitUntil: + visible: "^Purchase$" + timeout: 30000 diff --git a/e2e-tests/maestro/utils/confirm_purchase.yaml b/e2e-tests/maestro/utils/confirm_purchase.yaml new file mode 100644 index 00000000..108410e2 --- /dev/null +++ b/e2e-tests/maestro/utils/confirm_purchase.yaml @@ -0,0 +1,11 @@ +# This flow handles the Test Store purchase confirmation. + +appId: com.revenuecat.automatedsdktests +name: Confirm purchase - Test Store Purchase Alert + +--- +- extendedWaitUntil: + visible: "Test.*Purchase" + timeout: 15000 +- tapOn: + text: "(?i)test valid purchase"