// I will E2E test the article page. // User visits home -> User clicks on "laws or advice" -> Article page contains the title describe("Our app", () => { beforeEach(() => { cy.intercept( { pathname: "/api/getTopicList" }, { fixture: "topics", } ).as("getTopicList"); cy.intercept( { pathname: "/api/getTopic" }, { fixture: "article", } ).as("getTopic"); cy.viewport("iphone-x"); cy.visit("/"); }); it("shows the home page", () => { cy.visit("/"); cy.contains("Bienvenidos"); }); it("clicks and loads the advice tab", () => { cy.get("#tab-button-advice").first().click(); cy.wait("@getTopicList"); }) it("clicks and loads advice info", () => { cy.get("#tab-button-advice").first().click(); cy.wait("@getTopicList"); cy.get(".item").first().click(); cy.wait("@getTopic"); cy.contains("AdopciĆ³n"); cy.contains("Enmendado en el 1939"); }) it("clicks and loads law info", () => { cy.get("#tab-button-laws").first().click(); cy.wait("@getTopicList"); cy.get(".item").first().click(); cy.wait("@getTopic"); cy.contains("AdopciĆ³n"); cy.contains("Enmendado en el 1939"); }) })