Renacer Social, the app

eliam.cy.ts 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // I will E2E test the article page.
  2. // User visits home -> User clicks on "laws or advice" -> Article page contains the title
  3. describe("Our app", () => {
  4. beforeEach(() => {
  5. cy.intercept(
  6. { pathname: "/api/getTopicList" },
  7. {
  8. fixture: "topics",
  9. }
  10. ).as("getTopicList");
  11. cy.intercept(
  12. { pathname: "/api/getTopic" },
  13. {
  14. fixture: "article",
  15. }
  16. ).as("getTopic");
  17. cy.viewport("iphone-x");
  18. cy.visit("/");
  19. });
  20. it("shows the home page", () => {
  21. cy.visit("/");
  22. cy.contains("Bienvenidos");
  23. });
  24. it("clicks and loads the advice tab", () => {
  25. cy.get("#tab-button-advice").first().click();
  26. cy.wait("@getTopicList");
  27. })
  28. it("clicks and loads advice info", () => {
  29. cy.get("#tab-button-advice").first().click();
  30. cy.wait("@getTopicList");
  31. cy.get(".item").first().click();
  32. cy.wait("@getTopic");
  33. cy.contains("Adopción");
  34. cy.contains("Enmendado en el 1939");
  35. })
  36. it("clicks and loads law info", () => {
  37. cy.get("#tab-button-laws").first().click();
  38. cy.wait("@getTopicList");
  39. cy.get(".item").first().click();
  40. cy.wait("@getTopic");
  41. cy.contains("Adopción");
  42. cy.contains("Enmendado en el 1939");
  43. })
  44. })