#zepatrik-checkout

1 messages · Page 1 of 1 (latest)

runic horizon
#

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.

ocean carbon
#

Hmm ok, fair enough

#

So the only reliable way is to not use checkout but implement it ourselves?

runic horizon
#

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

ocean carbon
#

Yes the checkout hosted page, sry

runic horizon
#

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).

oblique lotus
#

I've been using playwright on the Checkout page. I use the following technique:

await page.fill(input[name=cardNumber], "4242424242424242");

runic horizon
#

yeah but that only works until we change the name of that <input> , which we might do

oblique lotus
#

Well, fair enough

ocean carbon
#

Exactly, we do the same right now

oblique lotus
#

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

ocean carbon
#

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

runic horizon
#

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.

ocean carbon
#

well, but we have to check it that works 😂
we tried mocking, but that didn't catch all bugs we had...