Back to Chromium

Test for PaymentRequest.show(optional promise) method

third_party/blink/web_tests/external/wpt/payment-request/show-method-optional-promise-resolves-manual.https.html

149.0.7827.22.1 KB
Original Source

PaymentRequest .show(optional detailsPromise) tests

These test cause detailsPromise to resolve successfully with some updated value. As such, that will cause something in the payment sheet to change. Each test describes what is expected to change - if anything.

Instructions: Click on each button in sequence from top to bottom without refreshing the page. The payment sheet will be shown. If required, confirm that the expected value appears in the payment sheet. Finally, manually abort/cancel the payment request by closing the payment sheet.

  1. If the payment sheet is shown, the test has failed.
  2. When the payment sheet is shown, the provided id must have no effect on the payment request.
  3. When the payment sheet is shown, the total must be CAD$50 with the label "✅ TEST HAS PASSED ✅".
  4. When the payment sheet is shown, there must be a one display item with a value of CAD$50 with the label "✅ TEST HAS PASSED ✅".
  5. When the payment sheet is shown, there must be two display items: One with a value of CAD$50, another with value AUD$40 that is pending.
  6. When the payment sheet is shown, there must be a one shipping option with a value of CAD$50.
  7. When the payment sheet is shown, there must be two shipping options: One with a value of CAD$50, another with value AUD$40 that is selected.
  8. When the payment sheet is shown, the total should be CAD$50.
  9. When the payment sheet is shown, the string "✅ TEST HAS PASSED ✅" should be shown somewhere in the user interface. Alternatively, the payment sheet must indicate to the end user that it's not possible to ship their order.
  10. When the payment sheet is shown, there should not be any errors shown.
  11. Resolving the show promise with empty details will preserve the details from the constructor. When the payment sheet is shown, the string "✅ TEST HAS PASSED ✅" should be shown.
  12. Done!

If you find a buggy test, please file a bug and tag one of the suggested reviewers.