-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expand file tree
/
Copy pathGitAutocommit_spec.ts
More file actions
67 lines (62 loc) · 1.88 KB
/
Copy pathGitAutocommit_spec.ts
File metadata and controls
67 lines (62 loc) · 1.88 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import ReconnectLocators from "../../../../locators/ReconnectLocators";
import {
agHelper,
gitSync,
homePage,
} from "../../../../support/Objects/ObjectsCore";
let wsName: string;
let repoName: string = "TED-autocommit-test-1";
describe(
"Git Autocommit",
{
tags: [
"@tag.Git",
"@tag.GitAutocommit",
"@tag.Sanity",
"@tag.TedMigration",
"@tag.AccessControl",
"@tag.Workflows",
"@tag.Module",
"@tag.Theme",
"@tag.JS",
"@tag.Container",
"@tag.ImportExport",
],
},
function () {
it("Check if autocommit progress bar is visible and network requests are properly called", function () {
agHelper.GenerateUUID();
cy.get("@guid").then((uid) => {
wsName = "GitAC-" + uid;
homePage.CreateNewWorkspace(wsName, true);
cy.intercept({
method: "POST",
url: "/api/v1/git/applications/*/auto-commit",
}).as("gitAutocommitTriggerApi");
cy.intercept(
{
method: "GET",
url: "/api/v1/git/applications/*/auto-commit/progress",
},
(req) => {
req.on("response", (res) => {
res.setDelay(500);
});
},
).as("gitAutocommitProgressApi");
gitSync.ImportAppFromGit(wsName, repoName);
agHelper.GetNClick(ReconnectLocators.SkipToAppBtn);
cy.wait("@gitAutocommitTriggerApi").then((interception) => {
expect(interception?.response?.statusCode).to.equal(200);
expect(
interception?.response?.body?.data?.autoCommitResponse,
).to.equal("PUBLISHED");
agHelper.WaitUntilEleAppear(gitSync.locators.autocommitLoader);
});
cy.wait("@gitAutocommitProgressApi").then((interceptions) => {
expect(interceptions?.response?.statusCode).to.equal(200);
});
});
});
},
);