1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- // 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");
- })
- })
|