#zepatrik-checkout
1 messages · Page 1 of 1 (latest)
hi, I don't know what playwright is I'm afraid. If it's something like selenium, we simply don't support that sort of testing I'm afraid, sorry. Checkout is a hosted surface and can and will change implementation details like class names and structure without notice all the time.
Hmm ok, fair enough
So the only reliable way is to not use checkout but implement it ourselves?
not sure what you mean.
are you specifically using Checkout (CheckoutSession objects, redirecting to the Stripe-hosted page) today, or did you mean 'checkout' more generally and you're using Elements , or something else? Just so I understand your integration
Yes the checkout hosted page, sry
cool, then you'd keep using that really as it's the best way to accept payments. You just can't drive it with a web browser testing framework like that. For testing you can set up your site to stub the payment part(e.g. just redirect directly to the success_url immediately instead of using Checkout when the page is being tested).
I've been using playwright on the Checkout page. I use the following technique:
await page.fill(input[name=cardNumber], "4242424242424242");
yeah but that only works until we change the name of that <input> , which we might do
Well, fair enough
Exactly, we do the same right now
Seems like "cardNumber" would be pretty stable, but yeah, I get it, these things can change
Anyway, it's just a test, so if it breaks, then I would just update the input name
Haha yeah but it stalls our whole CI/CD and release pipeline about every month
But I'm also assuming that input names and texts are more stable than CSS class names
they would be yes, but still completely arbitrary
all I can say is our official advice is to not to do this, we're aware it's not ideal.
well, but we have to check it that works 😂
we tried mocking, but that didn't catch all bugs we had...