Skip to content

Instantly share code, notes, and snippets.

@kianaditya
Created August 30, 2019 11:13
Show Gist options
  • Save kianaditya/20da85e02a8a824cfcfd5538afe13a14 to your computer and use it in GitHub Desktop.
Save kianaditya/20da85e02a8a824cfcfd5538afe13a14 to your computer and use it in GitHub Desktop.
Test stripe implementation using cypress
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