Skip to content

Commit

Permalink
fix interception and select force
Browse files Browse the repository at this point in the history
  • Loading branch information
mfilip committed May 8, 2024
1 parent 5f79987 commit f331d7e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cypress/integration/003_checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ describe("Checkout", () => {
cy.visit("/?product=test");
cy.get("button[name='add-to-cart']").click({ force: true });
cy.get("a").contains("View cart").click({ force: true });
cy.get("a").contains("Proceed to checkout", { matchCase: false }).click({ force: true });
cy.intercept(
"https://api.ideal-postcodes.co.uk/v1/keys/**"
).as("call");
cy.get("a").contains("Proceed to checkout", { matchCase: false }).click({ force: true });
cy.wait("@call").wait(500);
});

Expand Down Expand Up @@ -83,12 +83,13 @@ describe("Checkout", () => {
isBlocks ? cy.get(selectors.country).type("United Kingdom").type("{enter}") : cy.get(selectors.country).select("GB", { force: true });
cy.wait(1000);
}
cy.intercept("https://api.ideal-postcodes.co.uk/v1/postcodes/**").as("postcode")
cy.get("#idpc_input")
.clear({ force: true })
.type(address.postcode, { force: true });
cy.get("#idpc_button").click({ force: true });
cy.wait(1000);
cy.get("#idpc_dropdown").select("0");
cy.wait("@postcode").wait(1000);
cy.get("#idpc_dropdown").select("0", { force: true });
cy.get(selectors.post_town).should(
"have.value",
"Jersey"
Expand Down

0 comments on commit f331d7e

Please sign in to comment.