Skip to content

Commit

Permalink
test: Cypress clear cookies (#2119)
Browse files Browse the repository at this point in the history
Co-authored-by: Susritha Sabbini <[email protected]>
  • Loading branch information
susrithasabbini and Susritha Sabbini authored Jan 23, 2025
1 parent 9c0a3ba commit 9978b2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
8 changes: 3 additions & 5 deletions cypress/e2e/connector/connector.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe("connector", () => {
.should("be.visible");
});
it("Use the SDK to process a payment", () => {
cy.clearCookies("login_token");
cy.get("[data-testid=connectors]").click();
cy.get("[data-testid=paymentprocessors]").click();
cy.contains("Payment Processors").should("be.visible");
Expand All @@ -119,12 +120,9 @@ describe("connector", () => {
.find("[data-testid=expiryInput]")
.should("exist")
.type("0127");
getIframeBody()
.find("[data-testid=cvvInput]")
.should("exist")
.type("492", { force: true });
getIframeBody().find("[data-testid=cvvInput]").should("exist").type("492");
cy.get("[data-button-for=payEUR77]").should("exist").click();
cy.get("[data-testid=paymentSuccess]").should("exist");
cy.contains("Payment Successful").should("exist");
});
it("Verify Time Range Filters after Payment in Payment Operations Page", () => {
cy.get("[data-testid=operations]").click();
Expand Down
16 changes: 8 additions & 8 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,34 +127,34 @@ Cypress.Commands.add("create_connector_UI", () => {
});

Cypress.Commands.add("process_payment_sdk_UI", () => {
cy.clearCookies("login_token");
cy.get("[data-testid=connectors]").click();
cy.get("[data-testid=paymentprocessors]").click();
cy.contains("Payment Processors").should("be.visible");
cy.get('[data-testid="home"]').click();

cy.get("[data-button-for=tryItOut]").scrollIntoView().click();
cy.get("[data-testid=home]").click();
cy.get("[data-button-for=tryItOut]").click();
cy.get('[data-breadcrumb="Explore Demo Checkout Experience"]').should(
"exist",
);
cy.get("[data-testid=amount]").find("input").clear().type("77");
cy.get("[data-button-for=showPreview]").click();
let webSdkSelector = "#orca-elements-payment-element-payment-element iframe";
getIframeBody(webSdkSelector)
cy.wait(2000);
getIframeBody()
.find("[data-testid=cardNoInput]", { timeout: 20000 })
.should("exist")
.type("4242424242424242");
getIframeBody(webSdkSelector)
getIframeBody()
.find("[data-testid=expiryInput]")
.should("exist")
.type("0127");
getIframeBody(webSdkSelector)
getIframeBody()
.find("[data-testid=cvvInput]")
.should("exist")
.scrollIntoView()
.type("492");

cy.get("[data-button-for=payUSD77]").click();
cy.get("[data-testid=paymentSuccess]").should("exist");
cy.contains("Payment Successful").should("exist");
// cy.get("[data-button-for=goToPayment]").click();
// cy.url().should("include", "dashboard/payments");
});
Expand Down
2 changes: 1 addition & 1 deletion public/hyperswitch/wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"sideEffects": [
"./snippets/*"
]
}
}

0 comments on commit 9978b2c

Please sign in to comment.