question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After version 5.5 Stripe Checkout tests break out of the iframe

See original GitHub issue

Current behavior

When testing a Stripe Checkout workflow the stripe.redirectToCheckout or the redirected page breaks out of the iframe and instead of completing the test just hangs.

Desired behavior

I’d expect the application to not break out of the iframe and the test runner to continue working even after being redirected to the Stripe Checkout page. (Like it did with version 5.5.0 and below)

Test code to reproduce

Here’s a link to a repo with a simple React app to reproduce the issue. https://github.com/kide-science/cypress-test-tiny

Unfortunately I was not able to reproduce the issue with vanilla JS. Stripe seems to do the redirect with:

window.top.location.href = redirectUrl

Setting the top.location.href seems to work without breaking out of the iframe, which leads me to believe that there are additional checks before the redirect or on the Stripe hosted Checkout page after the redirect that cause the test to break out of the iframe.

Versions

Cypress version: 6.0.1 Last known working Cypress version: 5.5.0 Browser: Chrome 87 MacOS Mojave

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:32 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
tngflxcommented, Jun 29, 2021

oh my fcking god. Now you’re telling me not built yet? fuck… I almost launch production with it…

8reactions
wilsonpagecommented, Apr 20, 2021

Before closing it would be good to have a suggested workaround from someone at Cypress. Not being able to test checkout flows is pretty problematic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom payment flow | Stripe Documentation
Learn how to embed a custom Stripe payment form in your website or application. The client- and server-side code builds a checkout form...
Read more >
Handling stripe payments checkout with cypress - Questions
Cypress runner vanishes when redirects to Stripe for payments checkout. ... After version 5.5 Stripe Checkout tests break out of the iframe ......
Read more >
Stripe Checkout not working after update from 7.x-3.0-alpha1
I've just tried to update the module to the latest 7.x-3.0-alpha3 but when trying to continue from the review page to the payment...
Read more >
How to write integration tests for Stripe checkout on Rails?
It appears that whichever javascript testing gem I use, rspec/capybara cannot find the Stripe checkout iframe. When I check with Selenium I see...
Read more >
Error: Cannot resolve iframe with unknown index “0”
Hi, On my checkout page, since I've activated stripe, I'have this error spamming in ... MySQL Version: 5.5.5-10.4.21-MariaDB-1:10.4.21+maria~stretch-log Max ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found