Skip to content

Conversation

@JayShortway
Copy link
Member

Description

Note: based on #2788.

Adds a Maestro test that makes a Google Play purchase and immediately revokes it with the RevenueCat API, to allow testing again.

This can be merged, but it's just a POC. Still to do:

  • aligning this with the existing iOS tests, and
  • running this on CI.

@JayShortway JayShortway self-assigned this Nov 24, 2025
Comment on lines +20 to +22
output.rcApiV1 = {
revokeGooglePlaySubscription: revokeGooglePlaySubscription
}
Copy link
Member Author

@JayShortway JayShortway Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows the Shared Functions approach from the Maestro docs, which makes calling these APIs convenient from Maestro flows. We can add more RC API v1 calls to this file as needed.


defaultConfig {
applicationId = "com.revenuecat.e2etests"
applicationId = "com.revenuecat.automatedsdktests"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What shall we do here? Some options:

  1. Change the application ID in the Production Integration Tests Android RC project.
  2. Remove the Production Integration Tests Android RC project in favor of the Automated SDK Testing RC project.
  3. Make the application ID configurable from the command line.

I think option 2 has my preference.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think we don't use com.revenuecat.e2etests anywhere right now? (it works since it used to use the test store). But yeah, we do need a real package name for tests that test the Google flow.

I'm fine with option 2, but we will need to change the android backend integration tests as well to use the new API key and see if there are any changes. Additionally, for changing the "Purchases integration tests" it will likely require changing a bunch of environment variables.

But in any case, I do think option 2 makes the most sense, even if it's a bit more work 👍

@JayShortway JayShortway marked this pull request as ready for review November 24, 2025 17:10
@JayShortway JayShortway requested a review from a team as a code owner November 24, 2025 17:10
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really love this. Amazing job!

Comment on lines +223 to +229
// Setting the label as testTag for the value Text is on purpose. It allows us to do thinks like this
// in Maestro:
// - copyTextFrom:
// id: "Original App User ID"
// to extract the value.
testTag = label
testTagsAsResourceId = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Copy link

@rickvdl rickvdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, happy to see it running soon 🚀

file: subscribe/subscribe.yml
- tapOn: Customer Info
- assertVisible: "pro: "
- assertVisible: "${'Active: true, Product: ' + PRODUCT_ID}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something would be nice to align with iOS

- assertVisible: "${'Active: true, Product: ' + PRODUCT_ID}"
- copyTextFrom:
id: "Original App User ID"
- evalScript: ${output.rcApiV1.revokeGooglePlaySubscription(maestro.copiedText, PRODUCT_ID)}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

}

function revokeGooglePlaySubscription(appUserId, productId) {
return http.post(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great that you've managed to get this to work with the limited scripting abilities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants