-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider specifying a testing IDL for a mock payment UI #799
Comments
Marcos pointed me to this: https://marcoscaceres.github.io/payment-method-web-platform-test/ |
Hi @aestes, Did you get the answer to your original question? Are you able to share Webkit tests in the Payment Request test suite? Ian |
I support this. |
I started looking at how we might implement such a test API in Chrome. The main thing I'd like is a way for tests to inject a payment instrument (e.g. credit card or payment app). We currently have some test hooks that can directly manipulate the database in the browser process [1]. To make this available to WPT, we'd need to expose corresponding JavaScript bindings. This raises two issues:
What do other vendors think about these? As a data point, the Chrome Web Bluetooth folks ran into similar issues [2] and decided to put the test API behind a compile flag, so it's only available for [1] https://cs.chromium.org/chromium/src/chrome/browser/ui/views/payments/payment_request_browsertest_base.h?l=181 |
Related discussion w3c/payment-method-basic-card#41 |
@danyao can you describe the minimal required API to make this work? Would it suffice to just instruct the browser to provide mock UI-free payment methods? Would there have to be a callback to the test code when the payment instrument has been used, or could tests just try to make a payment and then look at the result? I think there are similarities with web-platform-tests/wpt#12046, and possibly something simple like https://w3c.github.io/permissions/#automation could suffice. This would also allow web developers to test their code, although I don't know if that's a real ask or if they'd just mock out the entire API instead. |
WebKit has converted some of the manual payment-request tests into automated tests by creating a mock payment UI in our testing harness that can be scripted from the test. Here's what the IDL looks like right now:
This is specific to Apple Pay right now, and is missing some stuff, so obviously this wouldn't be used as-is.
But maybe we could specify something like this so that (a) the WebKit-specific tests could be upstreamed to WPT, and (b) other browsers could run them.
The text was updated successfully, but these errors were encountered: