Last active
May 22, 2020 09:21
-
-
Save vojtech-cerveny/eda63f2ee4455f0d954ac6c04a4d0fbb to your computer and use it in GitHub Desktop.
cy-stripe.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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