Skip to content

Commit 6d42157

Browse files
DHFPROD-7996: Stabilize e2e failures on Nightly Pt.1
1 parent d1abe66 commit 6d42157

File tree

6 files changed

+56
-28
lines changed

6 files changed

+56
-28
lines changed

marklogic-data-hub-central/ui/e2e/cypress/integration/curation/curate/mappingWithInterceptorsAndCustomHook.spec.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("Create and verify load steps, map step and flows with interceptors & c
4141
cy.resetTestUser();
4242
cy.waitForAsyncRequest();
4343
});
44-
it("Create load step", () => {
44+
it("Create and Edit load step", () => {
4545
toolbar.getLoadToolbarIcon().click();
4646
cy.waitUntil(() => loadPage.stepName("ingestion-step").should("be.visible"));
4747
loadPage.addNewButton("card").click();
@@ -56,8 +56,7 @@ describe("Create and verify load steps, map step and flows with interceptors & c
5656
loadPage.confirmationOptions("Save").click({force: true});
5757
cy.waitForAsyncRequest();
5858
cy.findByText(loadStep).should("be.visible");
59-
});
60-
it("Edit load step", {defaultCommandTimeout: 120000}, () => {
59+
6160
// Open step settings and switch to Advanced tab
6261
loadPage.editStepInCardView(loadStep).click({force: true});
6362
loadPage.switchEditAdvanced().click();

marklogic-data-hub-central/ui/e2e/cypress/integration/curation/load/defaultIngestionListView.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ describe("Validate CRUD functionality from list view", () => {
9696
cy.waitUntil(() => loadPage.saveSettings(stepName)).click({force: true});
9797
cy.waitForAsyncRequest();
9898
loadPage.stepName(stepName).should("be.visible");
99-
});
100-
it("Open settings, change setting, switch tabs, save", () => {
10199
loadPage.stepName(stepName).click();
102100
loadPage.stepDescriptionInput().clear().type("UPDATE2");
103101
loadPage.switchEditAdvanced().click();

marklogic-data-hub-central/ui/e2e/cypress/integration/login/customRole.spec.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ describe("customRole", () => {
4040
let entityTypeId = "Customer";
4141
cy.waitUntil(() => toolbar.getCurateToolbarIcon()).click();
4242
cy.waitForAsyncRequest();
43-
cy.waitUntil(() => confirmationModal.getNavigationWarnText()).should("be.visible");
44-
confirmationModal.getYesButton(ConfirmationType.NavigationWarn);
43+
cy.get("body")
44+
.then(($body) => {
45+
if ($body.find("[aria-label=\"confirm-navigationWarn-yes\"]").length) {
46+
confirmationModal.getYesButton(ConfirmationType.NavigationWarn);
47+
}
48+
});
4549
curatePage.toggleEntityTypeId(entityTypeId);
4650
curatePage.verifyTabs(entityTypeId, "be.visible", "be.visible");
4751

marklogic-data-hub-central/ui/e2e/cypress/integration/modeling/graphValidations.spec.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,21 @@ describe("Graph Validations", () => {
176176
let personCoordinates: any = nodePositions["Person"];
177177
graphVis.getGraphVisCanvas().rightclick(personCoordinates.x, personCoordinates.y);
178178
graphVis.getCenterOnEntityTypeOption("Person").trigger("mouseover").click();
179+
});
180+
181+
let centeredPersonX, centeredPersonY;
182+
graphVis.getPositionsOfNodes("Person").then((nodePositions: any) => {
183+
centeredPersonX = nodePositions["Person"].x;
184+
centeredPersonY = nodePositions["Person"].y;
179185

180-
//Clicking on center of the canvas, should click on Person entity node.
181-
graphVis.getGraphVisCanvas().click();
186+
//Person entity coordinates should be within the center of canvas
187+
expect(centeredPersonX).to.be.greaterThan(700);
188+
expect(centeredPersonX).to.be.lessThan(800);
189+
expect(centeredPersonY).to.be.greaterThan(300);
190+
expect(centeredPersonY).to.be.lessThan(400);
191+
192+
//Click on newly centered Person entity node.
193+
graphVis.getGraphVisCanvas().click(centeredPersonX, centeredPersonY);
182194

183195
//Verify the side panel content for selected entity
184196
graphViewSidePanel.getSelectedEntityHeading("Person").should("be.visible");
@@ -197,7 +209,11 @@ describe("Graph Validations", () => {
197209
modelPage.selectView("project-diagram");
198210

199211
//Clicking on center of the canvas again to verify we click again on Person entity node.
200-
graphVis.getGraphVisCanvas().click();
212+
graphVis.getPositionsOfNodes("Person").then((nodePositions: any) => {
213+
centeredPersonX = nodePositions["Person"].x;
214+
centeredPersonY = nodePositions["Person"].y;
215+
graphVis.getGraphVisCanvas().click(centeredPersonX, centeredPersonY);
216+
});
201217

202218
//Verify the side panel content for selected entity
203219
graphViewSidePanel.getSelectedEntityHeading("Person").should("be.visible");

marklogic-data-hub-central/ui/e2e/cypress/integration/modeling/writerScenario2.spec.tsx

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,14 @@ describe("Entity Modeling: Writer Role", () => {
328328
// Node shows full name on hover
329329
cy.findByText("ThisIsVeryLongNameHavingMoreThan20Characters").should("exist");
330330
});
331+
graphViewSidePanel.getDeleteIcon("ThisIsVeryLongNameHavingMoreThan20Characters").click();
332+
confirmationModal.getYesButton(ConfirmationType.DeleteEntity);
333+
confirmationModal.getDeleteEntityText().should("not.exist");
334+
cy.waitForAsyncRequest();
335+
graphViewSidePanel.getSelectedEntityHeading("ThisIsVeryLongNameHavingMoreThan20Characters").should("not.exist");
336+
cy.publishEntityModel();
331337
});
332-
it("Create another entity Patients and add a property", {defaultCommandTimeout: 120000}, () => {
338+
it("Create another entity Patients and add a properties", {defaultCommandTimeout: 120000}, () => {
333339
modelPage.selectView("table");
334340
modelPage.getAddEntityButton().should("exist").click();
335341
entityTypeModal.newEntityName("Patients");
@@ -355,8 +361,8 @@ describe("Entity Modeling: Writer Role", () => {
355361
propertyModal.getForeignKey("id").click();
356362
propertyModal.getSubmitButton().click();
357363
propertyTable.getProperty("personType").should("exist");
358-
});
359-
it("Add second property to Patients Entity and delete it", () => {
364+
365+
//Add second property to Patients Entity and delete it
360366
propertyTable.getAddPropertyButton("Patients").click();
361367
propertyModal.newPropertyName("patientId");
362368
propertyModal.openPropertyDropdown();
@@ -368,8 +374,8 @@ describe("Entity Modeling: Writer Role", () => {
368374
confirmationModal.getDeletePropertyWarnText().should("exist");
369375
confirmationModal.getYesButton(ConfirmationType.DeletePropertyWarn);
370376
propertyTable.getProperty("patientId").should("not.exist");
371-
});
372-
it("Add third property to Patients Entity, publish the changes", {defaultCommandTimeout: 120000}, () => {
377+
378+
//Add third property to Patients Entity, publish the changes
373379
propertyTable.getAddPropertyButton("Patients").click();
374380
propertyModal.newPropertyName("health");
375381
propertyModal.openPropertyDropdown();
@@ -451,7 +457,7 @@ describe("Entity Modeling: Writer Role", () => {
451457

452458
graphView.getAddButton().click();
453459
graphView.addNewRelationship().click();
454-
graphView.verifyEditInfoMessage().should("be.visible");
460+
graphView.verifyEditInfoMessage().should("exist");
455461

456462
//verify create relationship via clicking a node in edit mode
457463
graphVis.getPositionsOfNodes().then((nodePositions: any) => {
@@ -507,8 +513,9 @@ describe("Entity Modeling: Writer Role", () => {
507513
cy.wait(2000);
508514
cy.waitForAsyncRequest();
509515
graphView.getAddButton().click();
510-
graphView.addNewRelationship().click();
511-
graphView.verifyEditInfoMessage().should("be.visible");
516+
cy.waitUntil(() => graphView.addNewRelationship().should("be.visible"));
517+
graphView.addNewRelationship().click({force: true});
518+
cy.waitUntil(() => graphView.verifyEditInfoMessage().should("exist"));
512519

513520
graphVis.getPositionsOfNodes().then((nodePositions: any) => {
514521
let PersonCoordinates: any = nodePositions["Person"];
@@ -530,13 +537,18 @@ describe("Entity Modeling: Writer Role", () => {
530537
relationshipModal.editForeignKey("firstname");
531538
relationshipModal.toggleCardinality();
532539
relationshipModal.addRelationshipSubmit();
540+
533541
cy.waitForAsyncRequest();
534-
relationshipModal.getModalHeader().should("not.exist");
542+
cy.wait(2000);
543+
graphView.getAddButton().click();
544+
cy.waitUntil(() => graphView.addNewRelationship().should("be.visible"));
545+
graphView.addNewRelationship().click({force: true});
546+
cy.waitUntil(() => graphView.verifyEditInfoMessage().should("exist"));
535547

536548
//add second relationship
537549
graphView.getAddButton().click();
538550
graphView.addNewRelationship().click();
539-
graphView.verifyEditInfoMessage().should("be.visible");
551+
graphView.verifyEditInfoMessage().should("exist");
540552

541553
graphVis.getPositionsOfNodes().then((nodePositions: any) => {
542554
let PersonCoordinates: any = nodePositions["Person"];
@@ -582,13 +594,6 @@ describe("Entity Modeling: Writer Role", () => {
582594
propertyTable.verifyForeignKeyIcon("referredBy").should("exist");
583595

584596
entityTypeTable.viewEntityInGraphView("Person");
585-
cy.waitForAsyncRequest();
586-
//re-enter graph edit mode, verify can exit with {esc}
587-
graphView.getAddButton().click();
588-
graphView.addNewRelationship().click();
589-
graphView.verifyEditInfoMessage().should("be.visible");
590-
graphVis.getGraphVisCanvas().type("{esc}");
591-
graphView.verifyEditInfoMessage().should("not.exist");
592597
});
593598

594599
it("Delete relationships from graph view", {defaultCommandTimeout: 120000}, () => {

marklogic-data-hub-central/ui/e2e/cypress/support/components/common/tiles.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ class Tiles {
3333
}
3434

3535
closeRunMessage() {
36-
return cy.get("div.ant-modal-confirm-btns button").click({multiple: true, force: true});
36+
cy.get("div.ant-modal-confirm-btns button").click({multiple: true, force: true});
37+
cy.get("body")
38+
.then(($body) => {
39+
if ($body.find("[data-testid=explorer-link]").length) {
40+
cy.get("div.ant-modal-confirm-btns button").click({multiple: true, force: true});
41+
}
42+
});
3743
}
3844
}
3945

0 commit comments

Comments
 (0)