Wednesday 27 February 2019

Generate Google Play subscription test receipts off-device programmatically

I'm working on the backend for a mobile app that has a Google Play IAP-subscription which enables most of the app's functionality.

The backend behavior is much of what changes when the user is subscribed. To set up automated testing of the back end, I'd like to generate a test subscription/receipt off-device in the test framework and verify that the backend is handling subscription statuses (created, canceled, expired, etc.) correctly.

Test subscriptions are great for this since they lapse quickly, so it doesn't take long to run through the full gamut, and can even be canceled early to further expedite tests.

However, I can't find any way to generate a test subscription/receipt off-device in the test code. Is there any way to generate a test receipt programmatically short of spinning up a device emulator and simulating touch inputs on the app?

The other option I see to enable these tests would be to generate a test subscription on-device to permanently embed in the test framework and then cancel and uncancel as necessary, but I see even less evidence that this is possible.



from Generate Google Play subscription test receipts off-device programmatically

No comments:

Post a Comment