Created
August 30, 2019 11:13
-
-
Save kianaditya/20da85e02a8a824cfcfd5538afe13a14 to your computer and use it in GitHub Desktop.
Test stripe implementation using cypress
This file contains hidden or 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
cy.get('iframe[name^="__privateStripeFrame5"]').then($iframe => { | |
const $body = $iframe.contents().find("body"); | |
cy.wrap($body) | |
.find('input[name="cardnumber"]') | |
.type("4242424242424242", { delay: 10 }); | |
}); | |
cy.get('iframe[name^="__privateStripeFrame6"]').then($iframe => { | |
const $body = $iframe.contents().find("body"); | |
cy.wrap($body) | |
.find('input[name="exp-date"]') | |
.type("1222"); | |
}); | |
cy.get('iframe[name^="__privateStripeFrame7"]').then($iframe => { | |
const $body = $iframe.contents().find("body"); | |
cy.wrap($body) | |
.find('input[name="cvc"]') | |
.type("223"); | |
}); | |
cy.get("#my_checkout").click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment