Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Gather default test data values #41

Closed
7 tasks
marcoscaceres opened this issue Sep 15, 2017 · 11 comments
Closed
7 tasks

Gather default test data values #41

marcoscaceres opened this issue Sep 15, 2017 · 11 comments

Comments

@marcoscaceres
Copy link
Member

marcoscaceres commented Sep 15, 2017

Edge currently extends Basic Card with an environment member (details here)... it's currently used for testing in Microsoft Wallet, but other implementers would like to also support it for the same reason.

Example:

const methods = [
  {
    supportedMethods: "basic-card",
    data: {
      supportedNetworks: ["visa", "mastercard", "amex"],
      supportedTypes: ["credit"],
      //for test transactions uncomment the test flag below
      environment: "TEST",
    },
  },
];

To standardize it, we need to:

  • Get assurance from Microsoft that it won't change (or will change, if we ask for changes... like adding a few more addresses).
  • Reverse engineer the data we can actually get back from it. For each "debit", "credit", and "prepaid":
    • visa values + billing address.
    • mastercard values + billing address.
    • amex values + billing address.
  • Spec it up.
  • Write tests

cc @molly26dalton, @adrianba

@marcoscaceres
Copy link
Member Author

Updated the above with more information we need.

@marcoscaceres
Copy link
Member Author

So, this shows a bit of what I have in mind here:
https://github.com/w3c/web-platform-tests/pull/6817/files

See in particular defaultBillingAddress and visaCredit... we could just adapt those.

@marcoscaceres
Copy link
Member Author

I've been playing around with environment... and I think "the cake is a lie" 😢. It doesn't actually seem to do anything in Edge? It still just shows the (real) credit card I registered, and all my real details.

@patrickkettner halp? (see above for context - but tl;dr. Microsoft Edge has a non-standard "environment" member, which is kinda a cool idea... we want to us it).

@marcoscaceres
Copy link
Member Author

We decided to take a different approach. We will share autofill data and enable this through a browser flag instead.

https://chromium-review.googlesource.com/c/chromium/src/+/661061

@adrianhopebailie
Copy link
Contributor

@marcoscaceres It would be very useful if this didn't use a hard-coded set of values so we could do some i18n testing too with names in non-Western alphabets etc.

If we are going to standardize on this as the testing approach it would be great to be able to point at a set of test vectors in a text file (stored with the tests) that can be loaded into all browsers and tested.

I appreciate that loading in values may be a big security issue though so keen to discuss.

@marcoscaceres
Copy link
Member Author

@adrianhopebailie, that's the plan 😁... hence me asking @rsolomakhin for:
w3c/payment-request#608 (comment)

@marcoscaceres marcoscaceres changed the title Standardize environment member Gather default test data values Sep 20, 2017
@marcoscaceres
Copy link
Member Author

@adrianhopebailie, just noting that we can't tell Chrome how to implement the test data (it's probably less painful to just hard-code it into c++ to avoid a bunch of IO, as they have done.) - same with Firefox.

The "text file", however, can live on web platform tests and we will test against it (but probably won't be a text file either, probably JS Objects that are serialized to JSON as needed).

@adrianhopebailie
Copy link
Contributor

@marcoscaceres sure, my concern is internationalization and the ability to add new data as new payment methods emerge.

probably won't be a text file either, probably JS Objects that are serialized to JSON as needed

That sounds good

@ianbjacobs
Copy link
Contributor

@adrianhopebailie and @marcoscaceres, should this be on our FTF meeting agenda?

@marcoscaceres
Copy link
Member Author

Don't think so. It's only a concern to the browser vendors.

@marcoscaceres
Copy link
Member Author

Spec was deprecated. No longer applies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants