Cypress test runner crashing on clicking make payment using Stripe payment gateway
See original GitHub issueCurrent behavior
After entering the testing card details like card number, cvc and expire date in Stripe Gateway… on clicking make button, cypress test runner is crashing without giving any error or warning message. Manually Stripe payment is working fine with same card details.
Desired behavior
Test runner should not be crash and in case of some major error - error should be shown there.
Test code to reproduce
cy.get('iframe').its('0.contentDocument.body').should('not.be.empty')
.then(cy.wrap).find('input[name="number"]').type(this.data.PaymentDetails.CardNumber)
cy.get('iframe').its('0.contentDocument.body').should('not.be.empty')
.then(cy.wrap).find('input[name="expiry"]').type(this.data.PaymentDetails.ExpMonthYear)
cy.get('iframe').its('0.contentDocument.body').should('not.be.empty')
.then(cy.wrap).find('input[name="cvc"]').type(this.data.PaymentDetails.Csv)
cy.wait(5000)
cy.get(".confirm-btn >button[id='c-submit-me']").click() // Clicking on this, test runner is crashing.
Cypress Version
10.7.0
Node version
16.14.2
Operating System
Windows 10 Enterprise - OS build - 19044.1889
Debug Logs
Crashed... no logs generated.
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:27 (12 by maintainers)
Top Results From Across the Web
Testing Stripe Integration with Cypress | by Bartek Golota
Custom payment flow integration requires end-to-end testing to make sure everything works as expected and we get a smooth user experience.
Read more >Handling stripe payments checkout with cypress - Questions
Cypress runner vanishes when redirects to Stripe for payments checkout. Has anyone faced this issue? Any idea how to handle it.
Read more >How to test your Stripe Checkout with Cypress
In this article we will look into how we can test a website that uses Stripe Checkout bringing more testing to your eCommerce!...
Read more >Error Messages | Cypress Documentation
This message means that Cypress encountered an error when compiling and/or bundling your test file. Cypress automatically compiles and bundles your test code...
Read more >Free for Developers
Developers and Open Source authors now have a massive amount of services offering free tiers, but it can be hard to find them...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@amar0120, it appears Stripe is attempting to change the top url which is causing Cypress to go back to the spec list. I initially thought setting experimentalModifyObstructiveThirdPartyCode would resolve the issue but it did not. We will need to investigate that further.
However, in the meantime, I was able to get the test to successfully run using the following intercepts:
@MehdiSv, thanks for clearing that up for me 😄. I’m not sure why the intercepts wouldn’t run when you are in headless mode. If you are able to create a sample repo I’d be happy to look at it though.