Skip to content

Instantly share code, notes, and snippets.

@vojtech-cerveny
Last active May 22, 2020 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vojtech-cerveny/eda63f2ee4455f0d954ac6c04a4d0fbb to your computer and use it in GitHub Desktop.
Save vojtech-cerveny/eda63f2ee4455f0d954ac6c04a4d0fbb to your computer and use it in GitHub Desktop.
cy-stripe.js
// cypress.json
{
"chromeWebSecurity": false
}
//test.spec.js
/// <reference types="cypress" />
context('Actions', () => {
describe(`Stripe`, () => {
it(`fill inputs`, () => {
cy.visit(`https://stripe.dev/elements-examples/`);
cy.get(".__PrivateStripeElement > iframe").then($iframe => {
const $body = $iframe.contents().eq(0).find("body");
cy.wrap($body)
.find("input[placeholder='Card number']")
.type("4242424242424242");
cy.wrap($body)
.find("input[placeholder='MM / YY']")
.type("1222");
cy.wrap($body)
.find("input[placeholder='CVC']")
.type("123");
});
});
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment