Skip to content

Instantly share code, notes, and snippets.

@mike-mccormick
mike-mccormick / stripe-sca-puppeteer.js
Last active July 13, 2021 07:44
Handle Stripe 3DS/SCA in Cypress, using Puppetter
/*
Automating Stripe card testing with cypress is pretty easy (especially with 'cypress-plugin-stripe-elements')
but SCA/3DS testing really isn't.
When using a SCA/3DS test card, to simulate the approve/denial Stripe fires what appears to be a modal, however
it's actually an iFrame, within an iFrame within an iFrame that shows in a lightbox.
The innermost iFrame is very difficult to generate with because of how it's rendered (even when you've managed
to find and scope into each one), however the source URL can be browsed to.