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"