-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathrefetch.spec.ts
More file actions
32 lines (28 loc) · 875 Bytes
/
refetch.spec.ts
File metadata and controls
32 lines (28 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { streamsRegex, tagsRegex, vodsRegex } from "../../consts/urlRegexes";
describe("Home > Refetch", () => {
it("should refetch streams after 2Min", () => {
cy.intercept(streamsRegex, {
statusCode: 200,
fixture: "streams",
}).as("streams");
cy.intercept(tagsRegex, {
statusCode: 200,
fixture: "tags",
}).as("tags");
cy.intercept(vodsRegex, {
statusCode: 200,
fixture: "vods",
}).as("vods");
cy.clock()
cy.visit(Cypress.env("hostUrl"));
cy.wait(["@streams", "@tags", "@vods"]);
cy.getByDataTest("card-online").should("have.length", 13);
cy.intercept(streamsRegex, {
statusCode: 200,
fixture: "streams_refetch",
}).as("streams");
cy.tick(120 * 1000)
cy.wait(["@streams", "@tags", "@vods"]);
cy.getByDataTest("card-online").should("have.length", 2);
});
});