Renacer Social, the app

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. describe("Our app", () => {
  2. beforeEach(() => {
  3. cy.intercept("GET", "http://localhost:3000/api/getTopicList/*", {
  4. fixture: "topics",
  5. }).as("getTopicList");
  6. cy.intercept("GET", "http://localhost:3000/api/getTopic/*", {
  7. fixture: "article",
  8. }).as("getTopic");
  9. cy.viewport("iphone-x");
  10. cy.visit("/");
  11. });
  12. it("shows the home page", () => {
  13. cy.visit("/");
  14. cy.contains("Bienvenidos");
  15. });
  16. it("shows a video in the home page", () => {
  17. cy.visit("/");
  18. cy.get("iframe").should("be.visible");
  19. });
  20. it("shows the about page", () => {
  21. cy.visit("/about");
  22. cy.contains("Renacer Social");
  23. });
  24. it("shows the individual service pages", () => {
  25. cy.visit("/about");
  26. cy.get(".item").first().click();
  27. cy.contains("Casita de Paz");
  28. });
  29. it("shows the advice pages", () => {
  30. cy.visit("/advice");
  31. // Wait until the request to the intercept is completed.
  32. cy.wait("@getTopicList");
  33. cy.get(".item").first().click();
  34. cy.wait("@getTopic");
  35. });
  36. it("allows exiting the individual service pages", () => {
  37. cy.visit("/about");
  38. cy.get(".item").first().click();
  39. cy.get(".back-button-has-icon-only").first().click();
  40. cy.contains("Servicios");
  41. });
  42. });