-
Notifications
You must be signed in to change notification settings - Fork 95
Adds Maestro test making a purchase on a v2 Paywall #2866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: maestro-google-login
Are you sure you want to change the base?
Conversation
| output.rcApiV1 = { | ||
| revokeGooglePlaySubscription: revokeGooglePlaySubscription | ||
| } |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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:
- Change the application ID in the Production Integration Tests Android RC project.
- Remove the Production Integration Tests Android RC project in favor of the Automated SDK Testing RC project.
- Make the application ID configurable from the command line.
I think option 2 has my preference.
There was a problem hiding this comment.
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 👍
tonidero
left a comment
There was a problem hiding this 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!
| // 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
rickvdl
left a comment
There was a problem hiding this 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}" |
There was a problem hiding this comment.
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)} |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
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: