From 4538f897b9197f509ce10b594d01f238341308b8 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Fri, 11 Aug 2023 15:16:43 -0500 Subject: [PATCH 1/6] Update a few methods in assessment class Signed-off-by: Nandini Chandra --- .../applicationinventory/assessment.ts | 21 ++++--------------- .../copy_assessment/copy_assessment.test.ts | 2 +- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/models/migration/applicationinventory/assessment.ts b/cypress/e2e/models/migration/applicationinventory/assessment.ts index 3aea2e05a..e215ed0d9 100644 --- a/cypress/e2e/models/migration/applicationinventory/assessment.ts +++ b/cypress/e2e/models/migration/applicationinventory/assessment.ts @@ -392,15 +392,8 @@ export class Assessment extends Application { Assessment.open(); selectItemsPerPage(100); cy.wait(2 * SEC); - cy.get(tdTag) - .contains(this.name) - .parent(tdTag) - .parent(trTag) - .within(() => { - click(actionButton); - cy.wait(500); - cy.get("ul > li").find(button).should("not.contain", "Copy assessment"); - }); + performRowActionByIcon(this.name, kebabMenu); + cy.get("ul > li").find(button).should("not.contain", "Copy assessment"); } copy_assessment(applicationList: Array, cancel = false): void { @@ -472,14 +465,8 @@ export class Assessment extends Application { Assessment.open(); selectItemsPerPage(items); cy.wait(2 * SEC); - cy.get(tdTag) - .contains(this.name) - .closest(trTag) - .within(() => { - click(actionButton); - cy.wait(500); - clickByText(button, action); - }); + performRowActionByIcon(this.name, kebabMenu); + clickByText(button, action); cy.get("div.pf-c-modal-box").within(() => { selectItemsPerPage(items); }); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts index 5ae401811..4769d35b5 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts @@ -60,7 +60,7 @@ describe(["@tier2"], "Copy assessment and review tests", () => { it("Copy assessment to self", function () { // Copy assessment to self, checkbox should be disabled applicationList[0].openCopyAssessmentModel(); - cy.get(".pf-m-compact> tbody > tr > td") + cy.get("[id^=pf-modal-part-]") .contains(applicationList[0].name) .parent(trTag) .within(() => { From ac5604991c18c174e14cc698ce797c820d11aecc Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Fri, 11 Aug 2023 16:39:29 -0500 Subject: [PATCH 2/6] Update a few methods in assessment class Signed-off-by: Nandini Chandra --- .../applicationinventory/assessment.ts | 21 +++++++++++++++---- .../copy_assessment/copy_assessment.test.ts | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/models/migration/applicationinventory/assessment.ts b/cypress/e2e/models/migration/applicationinventory/assessment.ts index e215ed0d9..3aea2e05a 100644 --- a/cypress/e2e/models/migration/applicationinventory/assessment.ts +++ b/cypress/e2e/models/migration/applicationinventory/assessment.ts @@ -392,8 +392,15 @@ export class Assessment extends Application { Assessment.open(); selectItemsPerPage(100); cy.wait(2 * SEC); - performRowActionByIcon(this.name, kebabMenu); - cy.get("ul > li").find(button).should("not.contain", "Copy assessment"); + cy.get(tdTag) + .contains(this.name) + .parent(tdTag) + .parent(trTag) + .within(() => { + click(actionButton); + cy.wait(500); + cy.get("ul > li").find(button).should("not.contain", "Copy assessment"); + }); } copy_assessment(applicationList: Array, cancel = false): void { @@ -465,8 +472,14 @@ export class Assessment extends Application { Assessment.open(); selectItemsPerPage(items); cy.wait(2 * SEC); - performRowActionByIcon(this.name, kebabMenu); - clickByText(button, action); + cy.get(tdTag) + .contains(this.name) + .closest(trTag) + .within(() => { + click(actionButton); + cy.wait(500); + clickByText(button, action); + }); cy.get("div.pf-c-modal-box").within(() => { selectItemsPerPage(items); }); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts index 4769d35b5..5ae401811 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts @@ -60,7 +60,7 @@ describe(["@tier2"], "Copy assessment and review tests", () => { it("Copy assessment to self", function () { // Copy assessment to self, checkbox should be disabled applicationList[0].openCopyAssessmentModel(); - cy.get("[id^=pf-modal-part-]") + cy.get(".pf-m-compact> tbody > tr > td") .contains(applicationList[0].name) .parent(trTag) .within(() => { From 8f7e6729bd2424b82620646417405b186db262d3 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Wed, 23 Aug 2023 18:27:16 -0500 Subject: [PATCH 3/6] Fix field validation on application creation dialog Signed-off-by: Nandini Chandra --- .../assessment/create.test.ts | 26 ++++++++++--------- .../e2e/views/applicationinventory.view.ts | 2 ++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts index 5e88c32c2..7dd234815 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts @@ -45,6 +45,8 @@ import { applicationBusinessServiceSelect, applicationContributorsInput, applicationOwnerInput, + applicationContributorsText, + applicationContributorsAction, } from "../../../../views/applicationinventory.view"; import * as commonView from "../../../../views/common.view"; @@ -61,7 +63,7 @@ describe(["@tier2"], "Application validations", () => { before("Login", function () { login(); businessservicesList = createMultipleBusinessServices(1); - stakeHoldersList = createMultipleStakeholders(2); + // stakeHoldersList = createMultipleStakeholders(2); }); beforeEach("Interceptors", function () { @@ -75,8 +77,7 @@ describe(["@tier2"], "Application validations", () => { // Navigate to application inventory page and click "Create New" button Assessment.open(); clickByText(button, createNewButton); - - selectFormItems(applicationBusinessServiceSelect, businessservicesList[0].name); + selectFormItems(applicationBusinessServiceSelect, "Collins LLC"); // Name constraints inputText(applicationNameInput, data.getRandomWord(2)); @@ -86,7 +87,7 @@ describe(["@tier2"], "Application validations", () => { // Description constraint inputText(applicationDescriptionInput, data.getRandomWords(90)); - cy.get(commonView.descriptionHelper).should("contain", max250CharsMsg); + cy.get(commonView.nameHelper).should("contain", max250CharsMsg); // Clear description field to make it valid input cy.get(applicationDescriptionInput).clear(); @@ -105,7 +106,7 @@ describe(["@tier2"], "Application validations", () => { }); cy.get(applicationOwnerInput) - .parent() + .closest("div") .next("button") .click() .then(() => { @@ -124,17 +125,18 @@ describe(["@tier2"], "Application validations", () => { cy.get("button").contains(stakeHoldersList[1].name).click(); cy.get(applicationContributorsInput) - .parent() + .closest("div") .should("contain", stakeHoldersList[0].name) .and("contain", stakeHoldersList[1].name); - cy.get(applicationContributorsInput) + cy.get(applicationContributorsText) + .contains(stakeHoldersList[0].name) .parent() - .contains("span", stakeHoldersList[0].name) - .next("button") + .next(applicationContributorsAction) .click(); - - cy.get(applicationContributorsInput).parent().and("contain", stakeHoldersList[1].name); + cy.get(applicationContributorsInput) + .closest("div") + .should("contain", stakeHoldersList[1].name); // Close the form cy.get(commonView.closeButton).click(); @@ -164,7 +166,7 @@ describe(["@tier2"], "Application validations", () => { cy.contains(button, createNewButton).should("exist"); }); - it("Application success alert and unique constraint validation", function () { + it.only("Application success alert and unique constraint validation", function () { Assessment.open(); const application = new Assessment(getRandomApplicationData()); diff --git a/cypress/e2e/views/applicationinventory.view.ts b/cypress/e2e/views/applicationinventory.view.ts index 3c163c947..2520cddfe 100644 --- a/cypress/e2e/views/applicationinventory.view.ts +++ b/cypress/e2e/views/applicationinventory.view.ts @@ -19,6 +19,8 @@ export const applicationDescriptionInput = "input[name=description]"; export const applicationBusinessServiceSelect = "[placeholder='Select a business service']"; export const applicationContributorsInput = "#contributors-select-toggle-select-multi-typeahead-typeahead"; +export const applicationContributorsText = ".pf-v5-c-chip__text"; +export const applicationContributionAction = ".pf-v5-c-chip__actions"; export const applicationOwnerInput = "#owner-toggle-select-typeahead"; export const repoTypeSelect = "button[id='repo-type-toggle']"; export const applicationTagsSelect = "[placeholder='Select tags']"; From 939c8d8ad9a30b7ee22d1b30cf51d61f255fceb4 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Wed, 23 Aug 2023 18:30:17 -0500 Subject: [PATCH 4/6] Fix field validation on application creation dialog Signed-off-by: Nandini Chandra --- .../migration/applicationinventory/assessment/create.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts index 7dd234815..2b337a8d7 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts @@ -63,7 +63,7 @@ describe(["@tier2"], "Application validations", () => { before("Login", function () { login(); businessservicesList = createMultipleBusinessServices(1); - // stakeHoldersList = createMultipleStakeholders(2); + stakeHoldersList = createMultipleStakeholders(2); }); beforeEach("Interceptors", function () { @@ -166,7 +166,7 @@ describe(["@tier2"], "Application validations", () => { cy.contains(button, createNewButton).should("exist"); }); - it.only("Application success alert and unique constraint validation", function () { + it("Application success alert and unique constraint validation", function () { Assessment.open(); const application = new Assessment(getRandomApplicationData()); From 849c91365216eddccd15c1cf9394658f244378fa Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 24 Aug 2023 11:21:22 -0500 Subject: [PATCH 5/6] Fix typo Signed-off-by: Nandini Chandra --- .../migration/applicationinventory/assessment/create.test.ts | 3 +-- cypress/e2e/views/applicationinventory.view.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts index 2b337a8d7..f52ffe532 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts @@ -67,14 +67,12 @@ describe(["@tier2"], "Application validations", () => { }); beforeEach("Interceptors", function () { - // Interceptors cy.intercept("POST", "/hub/tag*").as("postTag"); cy.intercept("POST", "/hub/application*").as("postApplication"); cy.intercept("GET", "/hub/application*").as("getApplication"); }); it("Application field validations", function () { - // Navigate to application inventory page and click "Create New" button Assessment.open(); clickByText(button, createNewButton); selectFormItems(applicationBusinessServiceSelect, "Collins LLC"); @@ -129,6 +127,7 @@ describe(["@tier2"], "Application validations", () => { .should("contain", stakeHoldersList[0].name) .and("contain", stakeHoldersList[1].name); + // Unassign contributor#1 and verify only contributor#2 is listed cy.get(applicationContributorsText) .contains(stakeHoldersList[0].name) .parent() diff --git a/cypress/e2e/views/applicationinventory.view.ts b/cypress/e2e/views/applicationinventory.view.ts index 2520cddfe..352e21346 100644 --- a/cypress/e2e/views/applicationinventory.view.ts +++ b/cypress/e2e/views/applicationinventory.view.ts @@ -20,7 +20,7 @@ export const applicationBusinessServiceSelect = "[placeholder='Select a business export const applicationContributorsInput = "#contributors-select-toggle-select-multi-typeahead-typeahead"; export const applicationContributorsText = ".pf-v5-c-chip__text"; -export const applicationContributionAction = ".pf-v5-c-chip__actions"; +export const applicationContributorsAction = ".pf-v5-c-chip__actions"; export const applicationOwnerInput = "#owner-toggle-select-typeahead"; export const repoTypeSelect = "button[id='repo-type-toggle']"; export const applicationTagsSelect = "[placeholder='Select tags']"; From 1b46fe9f56e2e418b2b2911298e7acb034bce895 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 24 Aug 2023 12:23:22 -0500 Subject: [PATCH 6/6] Update test Signed-off-by: Nandini Chandra --- .../migration/applicationinventory/assessment/create.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts index f52ffe532..794e96829 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/create.test.ts @@ -75,13 +75,14 @@ describe(["@tier2"], "Application validations", () => { it("Application field validations", function () { Assessment.open(); clickByText(button, createNewButton); - selectFormItems(applicationBusinessServiceSelect, "Collins LLC"); + selectFormItems(applicationBusinessServiceSelect, businessservicesList[0].name); // Name constraints inputText(applicationNameInput, data.getRandomWord(2)); cy.get(commonView.nameHelper).should("contain", minCharsMsg); inputText(applicationNameInput, data.getRandomWords(90)); cy.get(commonView.nameHelper).should("contain", max120CharsMsg); + cy.get(applicationNameInput).clear(); // Description constraint inputText(applicationDescriptionInput, data.getRandomWords(90));