瀏覽代碼

Añadi mi test

eduardo.figueroa7 1 年之前
父節點
當前提交
253bc0a6ed
共有 1 個檔案被更改,包括 30 行新增2 行删除
  1. 30
    2
      cypress/e2e/eduardo.cy.ts

+ 30
- 2
cypress/e2e/eduardo.cy.ts 查看文件

@@ -1,2 +1,30 @@
1
-// I will E2E test the article page.
2
-// User visits home -> User clicks on "laws or advice" -> List renders with 200
1
+describe("Our app", () => {
2
+  beforeEach(() => {
3
+    cy.intercept(
4
+      { pathname: "/api/getTopicList" },
5
+      {
6
+        fixture: "topics",
7
+      }
8
+    ).as("getTopicList");
9
+
10
+    cy.intercept(
11
+      { pathname: "/api/getTopic" },
12
+      {
13
+        fixture: "article",
14
+      }
15
+    ).as("getTopic");
16
+
17
+    cy.viewport("iphone-x");
18
+    cy.visit("/");
19
+  });
20
+
21
+  it("shows the home page", () => {
22
+    cy.visit("/");
23
+    cy.contains("Bienvenidos");
24
+  });
25
+
26
+  it("shows a video in the home page", () => {
27
+    cy.visit("/");
28
+    cy.get("iframe").should("be.visible");
29
+  });
30
+});