Skip to content

Commit 9133fed

Browse files
committed
Revert "NU-2197 resolve problems with e2e tests"
This reverts commit 0070cd2
1 parent 29649b4 commit 9133fed

File tree

10 files changed

+36
-29
lines changed

10 files changed

+36
-29
lines changed

designer/client/cypress/e2e/activities.cy.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ describe("Activities", () => {
6969
cy.get("[data-testid=window]").find("input").eq(1).click().type("100");
7070
cy.contains(/^apply/i).click();
7171

72-
cy.get('[data-selector="SCENARIO_SAVE"]').siblings().eq(0).click();
73-
cy.contains("li", /Save with comment/i).click();
72+
cy.contains(/^save/i).click();
7473
cy.get("[data-testid=window]").find("textarea").click();
7574
cy.get("[data-testid=window]").find("textarea").type("test comment");
7675
cy.contains(/^ok/i).click();
@@ -89,7 +88,7 @@ describe("Activities", () => {
8988
cy.get("@nameInput").type("-rename");
9089
cy.contains(/^apply/i).click();
9190
cy.contains(/^save/i).click();
92-
cy.contains(/^save/i).should("be.disabled");
91+
cy.contains(/^ok/i).click();
9392
cy.get("[data-testid=window]").should("not.exist");
9493

9594
findActivity("comment 6");

designer/client/cypress/e2e/compare.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("Compare", () => {
2121
.click();
2222
cy.contains("Version to compare").get("#otherVersion input").select(1);
2323
cy.contains("Difference to pick").get("#differentVersion input").select(1);
24-
cy.contains(/^stop$/i).should("be.visible");
24+
cy.contains(/^cancel$/i).should("be.visible");
2525
cy.get("[data-testid=window]").matchImage();
2626
cy.get("button[name=zoom]").click();
2727
cy.get("[data-testid=window]").matchImage();

designer/client/cypress/e2e/compareVersions.cy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ describe("Compare versions", () => {
5050
cy.contains(/^apply/i)
5151
.should("be.enabled")
5252
.click();
53-
cy.contains(/^save/i).click();
54-
cy.contains(/^save/i).should("be.disabled");
53+
cy.contains(/^save\*$/i).click();
54+
cy.contains(/^ok$/i).click();
5555
cy.get("[data-testid=window]").should("not.exist");
5656

5757
// Change fragment param again and save changes
@@ -60,8 +60,8 @@ describe("Compare versions", () => {
6060
cy.contains(/^apply/i)
6161
.should("be.enabled")
6262
.click();
63-
cy.contains(/^save/i).click();
64-
cy.contains(/^save/i).should("be.disabled");
63+
cy.contains(/^save\*$/i).click();
64+
cy.contains(/^ok$/i).click();
6565

6666
// Open the compare dialog and select values to compare
6767
cy.contains(/^compare$/i).click();

designer/client/cypress/e2e/components.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ describe("Components list", () => {
201201
},
202202
force: true,
203203
});
204-
cy.contains(/^save/i).click();
205-
cy.contains(/^save/i).should("be.disabled");
204+
cy.contains(/^save\*$/i).click();
205+
cy.contains(/^ok$/i).click();
206206

207207
cy.viewport(1400, 600);
208208
cy.visit("/components/usages/builtin-filter");

designer/client/cypress/e2e/deployAdvancedSection.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ describe("Deploy advanced section", () => {
1515
});
1616

1717
it("should display and expand advanced deploy section", () => {
18-
cy.get('[data-selector="ACTION_DEPLOY"]').siblings().eq(0).click();
19-
cy.contains("li", /configure & start/i).click();
18+
cy.contains(/^deploy$/i).click();
2019
cy.get("[data-testid=window]").matchImage();
2120

2221
cy.contains("log").should("be.visible").click();

designer/client/cypress/e2e/description.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ describe("Description", () => {
4040
cy.contains("description header").should("be.visible");
4141
cy.get("[data-testid=window]").should("be.visible").find("header").find("[name=close]").click();
4242

43-
cy.contains(/^save/i).click();
44-
cy.contains(/^save/i).should("be.disabled");
43+
cy.contains(/^save\*$/i).click();
44+
cy.contains(/^ok$/i).click();
4545

4646
cy.reload();
4747

designer/client/cypress/e2e/fragment.cy.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ describe("Fragment", () => {
233233
// });
234234
});
235235

236-
it.only("should validate and save changes", function () {
236+
it("should validate and save changes", function () {
237237
cy.createTestFragment(seed, "fragmentWithInput").as("fragmentName");
238238
cy.visitNewProcess(seed, "testProcess").as("processName");
239239

@@ -333,11 +333,12 @@ describe("Fragment", () => {
333333
cy.contains(/^apply/i)
334334
.should("be.enabled")
335335
.click();
336-
cy.get('[data-selector="SCENARIO_SAVE"]').click();
337-
cy.get('[data-selector="SCENARIO_SAVE"]').should("be.disabled");
336+
cy.contains(/^save\*$/i).click();
337+
cy.contains(/^ok$/i).click();
338+
cy.get("@window").should("not.exist");
338339

339340
// Verify if Frontend received correct data after save
340-
cy.getNode("@fragmentName").trigger("click");
341+
cy.getNode("@fragmentName").trigger("dblclick");
341342
cy.get('[title="any_value_with_suggestions_preset"]').siblings().eq(0).find("#ace-editor").contains("#RGB()");
342343
cy.get("@window").get("[title='test5']").should("not.exist");
343344

@@ -354,7 +355,8 @@ describe("Fragment", () => {
354355
cy.get("@window")
355356
.contains(/^apply$/i)
356357
.click();
357-
cy.get('[data-selector="SCENARIO_SAVE"]').click();
358+
cy.contains(/^save\*$/i).click();
359+
cy.contains(/^ok$/i).click();
358360

359361
// Go back to the Scenario
360362
cy.go(-1);

designer/client/cypress/e2e/labels.cy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ describe("Scenario labels", () => {
5252
cy.get("[data-testid=scenario-label-1]").should("be.visible").contains("tag2");
5353

5454
cy.contains(/^save/i).should("be.enabled").click();
55+
cy.contains(/^ok$/i).should("be.enabled").click();
5556
cy.wait("@save").its("response.statusCode").should("eq", 200);
5657

5758
cy.viewport(1500, 800);

designer/client/cypress/e2e/process.cy.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ describe("Process", () => {
55
cy.deleteAllTestProcesses({ filter: seed, force: true });
66
});
77

8-
after(() => {
9-
cy.deleteAllTestProcesses({ filter: seed, force: true });
10-
});
8+
// after(() => {
9+
// cy.deleteAllTestProcesses({ filter: seed, force: true });
10+
// });
1111

1212
beforeEach(() => {
1313
cy.mockWindowDate();
@@ -30,10 +30,12 @@ describe("Process", () => {
3030
.click();
3131

3232
cy.contains(/^save/i).should("be.enabled").click();
33+
cy.contains(/^ok$/i).should("be.enabled").click();
3334
cy.wait("@save").its("response.statusCode").should("eq", 200);
3435
cy.get('[role="alert"]')
3536
.contains(/scenario name changed/i)
3637
.should("be.visible");
38+
cy.contains(/^ok$/i).should("not.exist");
3739
cy.location("href").should("contain", "-renamed");
3840
});
3941

@@ -51,11 +53,13 @@ describe("Process", () => {
5153
.click();
5254

5355
cy.contains(/^save/i).should("be.enabled").click();
56+
cy.contains(/^ok$/i).should("be.enabled").click();
5457
cy.wait("@save").its("response.statusCode").should("eq", 200);
5558
cy.get('[role="alert"]')
5659
.contains(/scenario name changed/i)
5760
.should("be.visible");
5861

62+
cy.contains(/^ok$/i).should("not.exist");
5963
cy.location("href").should("contain", "-renamed");
6064
cy.contains(/^properties/i)
6165
.should("be.enabled")
@@ -104,7 +108,9 @@ describe("Process", () => {
104108
cy.wait("@import").its("response.statusCode").should("eq", 200);
105109

106110
cy.contains(/^save/i).should("be.enabled").click();
111+
cy.contains(/^ok$/i).should("be.enabled").click();
107112
cy.wait("@save").its("response.statusCode").should("eq", 200);
113+
cy.contains(/^ok$/i).should("not.exist");
108114

109115
cy.contains(/^counts/i).scrollIntoView();
110116
cy.get("#nk-graph-main").matchImage();
@@ -146,16 +152,16 @@ describe("Process", () => {
146152
});
147153
cy.get("[data-testid=graphPage]").matchImage(screenshotOptions);
148154
//why save and test snapshot? mistake?
149-
cy.contains(/^save/i).click();
150-
cy.contains(/^save/i).should("be.disabled");
155+
cy.contains(/^save\*$/i).click();
156+
cy.get("[data-testid=window]").contains(/^ok$/i).click();
157+
cy.get("[data-testid=window]").should("not.exist");
151158
cy.get("#nk-graph-main").should("be.visible");
152159
cy.get("[data-testid=graphPage]").matchImage(screenshotOptions);
153160
});
154161

155162
it("should return 400 status code and show info about required comment", () => {
156163
cy.viewport("macbook-15");
157-
cy.get('[data-selector="ACTION_DEPLOY"]').siblings().eq(0).click();
158-
cy.contains("li", /configure & start/i).click();
164+
cy.contains(/^deploy$/i).click();
159165
cy.intercept("POST", "/api/processManagement/deploy/*").as("deploy");
160166
cy.contains(/^ok$/i).should("be.enabled").as("okButton");
161167
cy.get("@okButton").click();

designer/client/cypress/support/process.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ function addLabelsToNewProcess(name?: string, labels?: string[]) {
123123
});
124124

125125
cy.contains(/^save/i).should("be.enabled").click();
126+
cy.contains(/^ok$/i).should("be.enabled").click();
126127
cy.wait("@save").its("response.statusCode").should("eq", 200);
127128
return cy.wrap(processName);
128129
});
@@ -342,8 +343,7 @@ function layoutScenario(waitTime = 600) {
342343
}
343344

344345
function deployScenario(comment = "issues/123", withScreenshot?: boolean) {
345-
cy.get('[data-selector="ACTION_DEPLOY"]').siblings().eq(0).click();
346-
cy.contains("li", /configure & start/i).click();
346+
cy.contains(/^deploy$/i).click();
347347
cy.intercept("POST", "/api/processManagement/deploy/*").as("deploy");
348348
cy.intercept("GET", "/api/processes/*/activity/activities").as("activities");
349349
if (withScreenshot) {
@@ -360,7 +360,7 @@ function deployScenario(comment = "issues/123", withScreenshot?: boolean) {
360360
}
361361

362362
function cancelScenario(comment = "issues/123") {
363-
cy.contains("button", /^stop$/i).click();
363+
cy.contains("button", /^cancel$/i).click();
364364
cy.get("[data-testid=window] textarea").click().type(comment);
365365
cy.contains(/^ok$/i).should("be.enabled").click();
366366
}

0 commit comments

Comments
 (0)