From 0716929e84a275204d77e720c7e62a6cb855faa6 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Tue, 14 Nov 2023 08:54:08 -0600 Subject: [PATCH] [RFR] Add separate tests for discarding Assessment and Review (#800) * Add separate tests for discarding Assessment and Review * Minor changes Signed-off-by: Nandini Chandra * Minor changes Signed-off-by: Nandini Chandra --------- Signed-off-by: Nandini Chandra --- .../migration/applicationinventory/assessment.ts | 4 ++-- .../assessment/miscellaneous.test.ts | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/models/migration/applicationinventory/assessment.ts b/cypress/e2e/models/migration/applicationinventory/assessment.ts index 025839c26..c0963fbd9 100644 --- a/cypress/e2e/models/migration/applicationinventory/assessment.ts +++ b/cypress/e2e/models/migration/applicationinventory/assessment.ts @@ -394,11 +394,11 @@ export class Assessment extends Application { } } - discard_assessment(): void { + selectKebabMenuItem(selection: string): void { Application.open(); selectItemsPerPage(100); this.selectApplication(); - clickItemInKebabMenu(this.name, "Discard assessment/review"); + clickItemInKebabMenu(this.name, selection); cy.get(continueButton).click(); } diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts index c2df7a09d..8f88204ab 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts @@ -55,11 +55,17 @@ describe(["@tier3"], "Tests related to application assessment and review", () => applicationList[0].verifyStatus("review", "Completed"); }); - it("Discard Assess/Review", function () { - applicationList[0].discard_assessment(); - /* Add this after bug MTA-1611 is resolved. - checkSuccessAlert(alertTitle, `Success alert:Success! Assessment discarded for applicationList[0].name.`); - applicationList[0].verifyStatus("assessment", "Not started"); */ + it("Discard Assessment", function () { + applicationList[0].selectKebabMenuItem("Discard assessment(s)"); + checkSuccessAlert( + alertTitle, + `Success alert:Success! Assessment discarded for ${applicationList[0].name}.` + ); + applicationList[0].verifyStatus("assessment", "Not started"); + }); + + it("Discard Review", function () { + applicationList[0].selectKebabMenuItem("Discard review"); checkSuccessAlert( alertTitle, `Success alert:Success! Review discarded for ${applicationList[0].name}.`