diff --git a/cypress/e2e/specs/home.cy.js b/cypress/e2e/specs/home.cy.js index b507615..18fd629 100644 --- a/cypress/e2e/specs/home.cy.js +++ b/cypress/e2e/specs/home.cy.js @@ -1,6 +1,7 @@ import { onHomepage } from "../../support/page_objects/homepage.js"; import selectors from "../../fixtures/index.json"; import urls from "../../fixtures/urls.json"; +import constants from "../../fixtures/constants.json"; context("Cat Web", () => { describe("Homepage: ", { tags: "smoke" }, () => { @@ -13,5 +14,12 @@ context("Cat Web", () => { .should("have.attr", "src") .should("include", urls.logoImg); }); + + it("Popup should exists, be visible and have specific text", () => { + cy.get(selectors.homePopupClass).should( + "have.text", + constants.popupMessage + ); + }); }); }); diff --git a/cypress/fixtures/constants.json b/cypress/fixtures/constants.json new file mode 100644 index 0000000..088c3ab --- /dev/null +++ b/cypress/fixtures/constants.json @@ -0,0 +1,3 @@ +{ + "popupMessage": "Too many ads? Join our community of cat lovers now to reduce ads by 90%! Click here to join for free!" +} \ No newline at end of file