You can test a complete purchase flow by using a sandbox account with Apple and Google
When testing In-App Purchases in a Sandbox environment, the duration cycles of the subscriptions are shortened to be able to evaluate behaviour for Auto-renew cycles.
After 5 renewals your Subscription is automatically cancelled.
All confirmation emails are sent by the App store to the email address used for testing.
See below for the time correspondence :
testing in app purchases subscription cycles
You must use a sandbox account and TestFlight to test a purchase in sandbox mode
You must add your Google account to the licence testers list to make a purchase in sandbox mode