During app testing, you can configure tester accounts on AppGallery Connect and allow these tester accounts to run tests in a sandbox environment. Sandbox testing applies to:
Account sign-in functions.
In-app product payment functions for non-consumables, consumables, and auto-renewable subscriptions. During joint debugging, the functions can be tested in an end-to-end manner without going through the actual payment process.
Game features.
Before app testing, you will need to create a tester account. For details on how to create a tester account, please refer to Managing Tester Accounts.
You can sign in using a configured tester account, and install the app to be tested. When a request is initiated to purchase a common product (that is, a non-subscription purchase), Huawei IAP detects that the user is a test user, skips the payment step, and displays a message indicating that the payment is successful.Please take note of the following during testing:
The purchase process in the sandbox testing scenario is the same as that in the official environment.
The receipt information generated in HUAWEI IAP contains the purchaseType field which has a value 0, indicating that the purchase is a sandbox testing record.
In the sandbox testing scenario, you create a common purchase order, which actually indicates that you create an order of the payment that has been completed. In this case, the purchase is successful even if you cancel the payment.
In the sandbox testing scenario, to facilitate testing, you can purchase a non-consumable product, consume it, and then purchase another.
When the checkout page is opened in the sandbox testing scenario, a dialog box with a sandbox icon is displayed. A sandbox icon is displayed on both the checkout page and the successful purchase page.
The purchase process of subscriptions is similar to those of other in-app products. The only difference is that subscriptions have more details to consider, such as the subscription renewal result (successful or failed) and renewal period. To help you quickly test the subscription scenario, the subscription renewal in the sandbox testing scenario is faster than that in normal cases. The concept of a "time machine" is introduced. The concept of a "time machine" is only for renewal periods of subscriptions. For example, if the subscription period is one week and the subscription is renewed three minutes later, the validity period of the subscription is extended by one week.
| Actual Period | Test Period |
|---|---|
| 1 week | 3 minutes |
| 1 month | 5 minutes |
| 2 months | 10 minutes |
| 3 months | 15 minutes |
| 6 months | 30 minutes |
| 1 year | 1 hour |
Please take note of the following during testing:
In the sandbox testing scenario, signing or card binding is still required when a subscription is initiated without charging.
Real fee deduction is not required during auto-renewal processing. Instead, HUAWEI IAP directly returns a fee deduction success.
There are up to six auto-renewals during sandbox testing.
When the checkout page is opened in the sandbox testing scenario, a dialog box with a sandbox icon is displayed. A sandbox icon is displayed on both the checkout page and the successful purchase page.
Suggestion: Separate the subscription renewal testing in a sandbox from that in an official environment to reduce mutual interference.
Before a game is released, you can use a tester account to sign in to the game and test the game achievements, leaderboards and saved games. Avoid releasing achievements or leaderboards when the corresponding game is still undergoing tests. This is because achievement or leaderboard data changes along with game operations performed by the tester account, and it cannot be reset once they have been released.
Note that HUAWEI Assistant can display achievements and leaderboards only after your game is released and only on devices running EMUI 9.0 or later and installing HUAWEI Assistant 10.3 or later.