1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- describe("Our app", () => {
- beforeEach(() => {
- cy.intercept("GET", "http://localhost:3000/api/getTopicList/*", {
- fixture: "topics",
- }).as("getTopicList");
-
- cy.intercept("GET", "http://localhost:3000/api/getTopic/*", {
- fixture: "article",
- }).as("getTopic");
-
- cy.viewport("iphone-x");
- cy.visit("/");
- });
-
- it("shows the home page", () => {
- cy.visit("/");
- cy.contains("Bienvenidos");
- });
-
- it("shows a video in the home page", () => {
- cy.visit("/");
- cy.get("iframe").should("be.visible");
- });
-
- it("shows the about page", () => {
- cy.visit("/about");
- cy.contains("Renacer Social");
- });
-
- it("shows the individual service pages", () => {
- cy.visit("/about");
- cy.get(".item").first().click();
- cy.contains("Casita de Paz");
- });
-
- it("shows the advice pages", () => {
- cy.visit("/advice");
- // Wait until the request to the intercept is completed.
- cy.wait("@getTopicList");
- cy.get(".item").first().click();
- cy.wait("@getTopic");
- });
-
- it("allows exiting the individual service pages", () => {
- cy.visit("/about");
- cy.get(".item").first().click();
- cy.get(".back-button-has-icon-only").first().click();
- cy.contains("Servicios");
- });
- });
|