B2G/QA/WebAPI Test Plan/WebPayment
< B2G | QA | WebAPI Test Plan
WebPayment
Summary
Lead | Jason Smith (irc: jsmith) |
API Description | Allows for monetary payments for a virtual good |
API Developer | Fernando Jimenez Moreno |
API Project Page | WebPayment |
API Tracking Bugs | Bug 767818 |
API Status | Landed |
Overview
This document will cover testing the web payment API that tests the API itself and the trustworthy UI used on device. Other portions of payment testing such as identity integration, marketplace integration, etc shall be covered in different docs. Therefore, the testing is broken into two areas here:
- API and JWT testing to ensure the JS API handles general valid and invalid input cases with the right success/error callbacks
- End-to-End functional testing with mozPay and trustworthy UI isolating marketplace bits out - Ensure trustworthy UI use cases work as expected
Signoff Criteria
- All basecamp blockers are closed
- All smoke tests and basic functional tests are ran without finding any basecamp blockers
Test Case Management
- Test cases shall be tracked in MozTrap tagged with "gaia" and "payments"
Infrastructure
- A mock payment provider shall be used for testing the payment API and trustworthy UI - Mock Payment Provider
- A payments test case repository shall be used for tracking test cases - Payment Tests
Automation
Tracking bug: bug 777023
- Zac Campell is looking into this - primarily aiming to target front-end automation in Marionette in python
Test Cases
- Test that I can make an in-app purchase against the mock payment provider on first page of the trusted UI
- Test that I can make an in-app purchase against the mock payment provider on second page of the trusted UI
- Test that I can choose and select between two different payments if multiple JWTs are requested
- Test that I receive a phone call while I'm in the trusted UI, that I can complete the phone call and return to the trusted UI context
- Test that I can be notified with a connection failure if there's no connection while I'm in the trusted UI
- Test that I can leave the trusted UI context back to the homescreen
- Test that I can close an active trusted UI context to generate an onerror callback
- Test that I can return back to an existing trusted UI context by entering an app in that context currently
- Test that I can see which apps in task manager are in a trusted UI context vs. not
- Test that I can cancel an in-app purchase through the trusted UI context on first page of the trusted UI
- Test that I can cancel an in-app purchase through the trusted UI context on second page of the trusted UI
- Test that I can run multiple trusted UI contexts across different apps for different payments
- Test that I can exit to the task switcher while I'm in the trusted UI context
- Test that I can exit to the lockscreen while I'm in the trusted UI context
- Test that I can return to a trusted UI context from the lockscreen
- Test that I can return to a trusted UI context through the task switcher
- Test that I cannot request a trusted UI context within a background page running
- Test that I get an error and no trusted UI context when I request an invalid payment provider (typ wrong)
- Test that I get an error and no trusted UI context when I request an invalid payment provider (typ not specified)
- Test that I get an error and no trusted UI context when I request an invalid JWT (request not specified)
- Test that I get an error and no trusted UI context when I request an invalid JWT (name not specified)
- Test that I get an error and no trusted UI context when I request an invalid JWT (price not specified)
- Test that I get an error and no trusted UI context when I request an invalid JWT (price not valid)
- Test that I get an error and no trusted UI context when I request an invalid JWT (invalid currency)
- Test that I get an error and no trusted UI context when I request an invalid JWT (non-numerical price)
- Test that I get an error and no trusted UI context when I request an invalid JWT (description not specified)
- Test that I get an error and no trusted UI context when I request an invalid JWT (not valid JSON)
- Test that I get an error when I request two JWTs with the same payment provider
- Test that I can make an in-app payment with no iss specified
- Test that I can make an in-app payment with no iat specified
- Test that I can make an in-app payment with no exp specified
- Test that I can make an in-app payment with a single price with no default price specified
- Test that I can make an in-app payment with UTF-8 characters in the name and description of the request
- Test that I can make an in-app payment with at least two prices specified in a valid locale
- Test that I cannot make an in-app payment with a price specified in an unsupported locale
- Test that I can make an in-app payment without productdata, postbackURL, and chargebackURL specified
- Test that I can make an in-app payment with productdata specified
- Test that I can make an in-app payment with a postbackURL and chargebackURL that points to a 404
- Test that I can make an in-app payment with a valid postbackURL and chargebackURL
- Test that I can make an in-app payment with 10 prices specified with different currencies
- Test that I get an error and no trusted UI context when I request an invalid JWT (two currencies that are the same)
- Test that I can use the keyboard within the trusted UI context to type text in