New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.5.0 Regression: Issue with testing of stripe card component #8992
Comments
Right now there doesn't seem to be enough information to reproduce the problem on our end. We'll have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please comment in this issue with a reproducible example and we will consider reopening the issue. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide. |
@jennifer-shehane describe('My First Test', function () {
it('test', function () {
cy.visit('https://stripe.dev/elements-examples/');
cy.get('.__PrivateStripeElement > iframe')
.eq(0)
.then(($iframe) => {
const body = $iframe.contents().find('.InputContainer');
cy.wrap(body).find(`input[name="cardnumber"]`).type('4242424242424242');
cy.wrap(body).find(`input[name="exp-date"]`).type('12/20');
cy.wrap(body).find(`input[name="cvc"]`).type('424');
});
});
}); |
Thanks for providing the example! I can reproduce with the code below in Cypress 5.5.0. This was introduced in this PR: #8827. I git bisected to this commit where it started failing: 19fdf43 it('test', () => {
cy.visit('https://stripe.dev/elements-examples/')
}) 5.4.0Nothing in the console 5.5.0Console has a lot of errors WorkaroundYou can ignore this error by adding this to your test file or support file, but I think the functionality of the app is messed up, so I don't think this will fix the overall issue. I would suggest downgrading to 5.4.0 to workaround. Cypress.on('uncaught:exception', () => {
return false
}) |
@jennifer-shehane thanks a lot. I've already downgraded. |
This is a significant issue that impacts all apps that use stripe. You only need to include stripe to trigger failures within cypress, you do need to interact with stripe on your page or test for cypress to fail. Some tests will work, others will fail with cypress errors depending on what stripe is doing in the background. I wasn't able to track this issue to cypress/stripe issue until I ran the failing tests in Firefox, where the error messages were more detailed. The embedded Electron browser fails with a generic cypress error. Everyone with <script src="https://js.stripe.com/v3/"></script> in their project is impacted. |
@boardofchris @fernandomartinez82 We suggest downgrading to 5.4.0 until this is resolved. We are looking into a fix. |
@jennifer-shehane It's an option, but I have other problems with lower versions that are solved in version 5.5. I will create 2 different projects with 2 different versions of Cypress, until the error is resolved |
There's a PR open to fix this, so hopefully this makes it into the next release. #9018 |
The code for this is done in cypress-io/cypress#9018, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
After upgrading to version 5.5.0 there is an issue with testing of stripe card component
Current behavior
in cypress:open mode credit card field is not displayed
Versions
Works correctly in version 5.4.0

The text was updated successfully, but these errors were encountered: