Renacer Social, the app

sergio.cy.ts 1.2KB

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