#mattwoberts
1 messages ยท Page 1 of 1 (latest)
(It works if I test manually)
Unfortunately it's not something we really support. I've heard of people having more success writing end-to-end tests with Playwright: https://playwright.dev/
Cross-browser end-to-end testing for modern web apps
Otherwise, you should just stub/mock a response from Checkout to fit your testing stories
Can I add a test card through the API instead, that would be a reasonable workaround?
Well, what is it you're trying to test?
I want to get my customer to have a saved card against their subscription - I don't actually want to test anything on the checkout page
Once the customer has a card, I can test other things in the app... I thought that driving the flow through the checkout with cypress would be the simplest, but it doesn't work ๐ฆ
If I can't add a card wholly via the API, can I have/get a checkout URL without requiring the need to create a checkout session first - I wonder if something in that flow upsets cypress....
You can't, no.
You said a saved card on the Subscription previously
If you need a payment method on a Customer object, use a Setup Intent. Otherwise, if you need a default_payment_method on a Subscription object then just use that field when creating your test subscription and use a test card token (pm_card_visa, for example)
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Sorry, was AFK, just catching up!
Ah - yes I can use those test card tokens can't I...
I'll try that route then I think - bypassing the checkout page entirely
yes that would be your best option
Thanks for the help ๐
let me know if you need any more help