Skip to content

Commit

Permalink
fix tests with recaptcha dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
stentrop committed Jul 19, 2023
1 parent 93dd857 commit d2e390d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion testing/cypress/integration/homepage/newsletter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ context("Newsletter", () =>
it("should register newsletter with first and last name", () =>
{
cy.visit("/newsletter-with-name");
cy.getByTestingAttr("cookie-bar-accept-all").click();

cy.get(".widget-newsletter").should("exist");
cy.intercept("POST", "/rest/io/customer/newsletter").as("nlRegister");

Expand All @@ -24,6 +26,8 @@ context("Newsletter", () =>
it("should register newsletter", () =>
{
cy.visit("/newsletter");
cy.getByTestingAttr("cookie-bar-accept-all").click();

cy.get(".widget-newsletter").should("exist");
cy.intercept("POST", "/rest/io/customer/newsletter").as("nlRegister");

Expand All @@ -44,6 +48,8 @@ context("Newsletter", () =>
it("should validate first and last name input", () =>
{
cy.visit("/newsletter-with-name");
cy.getByTestingAttr("cookie-bar-accept-all").click();

cy.get(".widget-newsletter").should("exist");
cy.getByTestingAttr("nl-first-name").type("Visit", { delay: 40 });
cy.getByTestingAttr("nl-last-name").type("https://spamsite.de", { delay: 40 });
Expand All @@ -57,6 +63,8 @@ context("Newsletter", () =>
it("should validate mail input", () =>
{
cy.visit("/newsletter-with-name");
cy.getByTestingAttr("cookie-bar-accept-all").click();

cy.get(".widget-newsletter").should("exist");
cy.getByTestingAttr("nl-first-name").type("Max", { delay: 40 });
cy.getByTestingAttr("nl-last-name").type("Mustermann", { delay: 40 });
Expand All @@ -69,6 +77,8 @@ context("Newsletter", () =>
it("should validate policy", () =>
{
cy.visit("/newsletter");
cy.getByTestingAttr("cookie-bar-accept-all").click();

cy.get(".widget-newsletter").should("exist");
cy.getByTestingAttr("nl-mail").type("max.mustermann@plentymarkets.com", { delay: 40 });
cy.getByTestingAttr("nl-send").click();
Expand All @@ -91,8 +101,10 @@ context("Newsletter", () =>
it("should unsubscribe", () =>
{
cy.visit("/newsletter-unsubscribe");
cy.getByTestingAttr("cookie-bar-accept-all").click();

cy.intercept("DELETE", " /rest/io/customer/newsletter/**").as("unsubscribe");

cy.get(".widget-newsletter-unsubscribe").should("exist");
cy.getByTestingAttr("unsub-nl-mail").type("max.mustermann@plentymarkets.com", { delay: 40 });
cy.getByTestingAttr("unsub-nl-send").click();
Expand Down

0 comments on commit d2e390d

Please sign in to comment.