From 2a73e89eb0ffdf7c3d58418edcf3f2da9fc20934 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Fri, 26 Jan 2024 14:31:26 -0600 Subject: [PATCH] [RFR] Perform application asessment/review of application associated with unassessed archetypes (#930) * Perform application asessment/review of application associated with unassessed archetypes Signed-off-by: Nandini Chandra * Minor changes Signed-off-by: Nandini Chandra * Enable Legacy Pathfinder questionnaire Signed-off-by: Nandini Chandra * fixed type in questionnaire method name Signed-off-by: Nandini Chandra * Delete all questionnaires Signed-off-by: Nandini Chandra * Delete all questionnaires Signed-off-by: Nandini Chandra * Update clean up code Signed-off-by: Nandini Chandra * Minor change Signed-off-by: Nandini Chandra --------- Signed-off-by: Nandini Chandra --- .../assessment_questionnaire.ts | 2 +- .../questionnaires/crud.test.ts | 2 +- .../assessment/archetype_association.test.ts | 2 +- .../assessment/assess_review.test.ts | 2 +- .../assessment_after_import.test.ts | 2 +- .../assessment/miscellaneous.test.ts | 36 ++++++++++++++++++- .../archetypes/assess_review.test.ts | 2 +- .../migration/reports-tab/filter.test.ts | 2 +- .../reports-tab/links-validation.test.ts | 2 +- .../migration/reports-tab/reports.test.ts | 2 +- .../tests/migration/reports-tab/sort.test.ts | 2 +- 11 files changed, 45 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts b/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts index b716aa6ae..90e80c2de 100644 --- a/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts +++ b/cypress/e2e/models/administration/assessment_questionnaire/assessment_questionnaire.ts @@ -90,7 +90,7 @@ export class AssessmentQuestionnaire { }); } - public static deleteAllQuesionnaire() { + public static deleteAllQuestionnaires() { AssessmentQuestionnaire.open(); selectItemsPerPage(100); cy.get(commonView.commonTable) diff --git a/cypress/e2e/tests/administration/questionnaires/crud.test.ts b/cypress/e2e/tests/administration/questionnaires/crud.test.ts index 0ba619a35..0e2e2d026 100644 --- a/cypress/e2e/tests/administration/questionnaires/crud.test.ts +++ b/cypress/e2e/tests/administration/questionnaires/crud.test.ts @@ -15,7 +15,7 @@ describe(["@tier2"], "Questionnaire CRUD operations", () => { before("Login", function () { login(); // This test will fail if there are preexisting questionnaire. - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); }); it("Import questionnaire", function () { diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts index 473af38a4..3827518ca 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts @@ -41,7 +41,7 @@ describe(["@tier2"], "Tests related to application-archetype association ", () = tags = createMultipleTags(2); stakeholders = createMultipleStakeholders(1); - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(legacyPathfinder); }); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/assess_review.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/assess_review.test.ts index 9234cf5c9..c3d8fb282 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/assess_review.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/assess_review.test.ts @@ -41,7 +41,7 @@ describe(["@tier1"], "Application assessment and review tests", () => { before("Login and Create Test Data", function () { login(); // This test will fail if there are preexisting questionnaire. - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(legacyPathfinder); stakeholders = createMultipleStakeholders(1); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/assessment_after_import.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/assessment_after_import.test.ts index b934bef26..82f1bdb63 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/assessment_after_import.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/assessment_after_import.test.ts @@ -40,7 +40,7 @@ describe(["@tier2"], "Operations after application import", () => { before("Login and create test data", function () { login(); // This test will fail if there are preexisting questionnaire. - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(legacyPathfinder); stakeholders = createMultipleStakeholders(1); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts index 254e53682..104a73873 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts @@ -25,6 +25,7 @@ import { clickByText, createMultipleStakeholders, createMultipleTags, + createMultipleArchetypes, click, } from "../../../../../utils/utils"; import { Stakeholders } from "../../../../models/migration/controls/stakeholders"; @@ -50,6 +51,7 @@ describe(["@tier3"], "Tests related to application assessment and review", () => login(); cy.intercept("GET", "/hub/application*").as("getApplication"); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(fileName); stakeholderList = createMultipleStakeholders(1); @@ -157,9 +159,41 @@ describe(["@tier3"], "Tests related to application assessment and review", () => // AssessmentQuestionnaire.delete(cloudNative); }); + it("Assess and review application associated with unassessed/unreviewed archetypes", function () { + // Polarion TC MTA-456 + const tags = createMultipleTags(2); + const archetypeList = createMultipleArchetypes(2, tags); + + AssessmentQuestionnaire.deleteAllQuestionnaires(); + AssessmentQuestionnaire.enable(legacyPathfinder); + + const appdata = { + name: data.getAppName(), + tags: [tags[0].name, tags[1].name], + }; + const application2 = new Application(appdata); + application2.create(); + cy.wait(2 * SEC); + + application2.perform_assessment("medium", stakeholderList); + cy.wait(2 * SEC); + application2.verifyStatus("assessment", "Completed"); + application2.validateAssessmentField("Medium"); + + application2.perform_review("medium"); + cy.wait(2 * SEC); + application2.verifyStatus("review", "Completed"); + application2.validateReviewFields(); + + application2.delete(); + cy.wait(2 * SEC); + deleteByList(archetypeList); + deleteByList(tags); + }); + after("Perform test data clean up", function () { deleteByList(stakeholderList); deleteByList(applicationList); - AssessmentQuestionnaire.delete(cloudNative); + AssessmentQuestionnaire.deleteAllQuestionnaires(); }); }); diff --git a/cypress/e2e/tests/migration/archetypes/assess_review.test.ts b/cypress/e2e/tests/migration/archetypes/assess_review.test.ts index bded9734e..299a9a04b 100644 --- a/cypress/e2e/tests/migration/archetypes/assess_review.test.ts +++ b/cypress/e2e/tests/migration/archetypes/assess_review.test.ts @@ -35,7 +35,7 @@ let tags: Tag[]; describe(["@tier1"], "Archetype assessment and review tests", () => { before("Login and Create Test Data", function () { login(); - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(legacyPathfinder); stakeholders = createMultipleStakeholders(1); diff --git a/cypress/e2e/tests/migration/reports-tab/filter.test.ts b/cypress/e2e/tests/migration/reports-tab/filter.test.ts index fa7058ed7..837af66ce 100644 --- a/cypress/e2e/tests/migration/reports-tab/filter.test.ts +++ b/cypress/e2e/tests/migration/reports-tab/filter.test.ts @@ -81,7 +81,7 @@ describe(["@tier2"], "Reports Tab filter validations", function () { login(); deleteAllMigrationWaves(); deleteApplicationTableRows(); - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.import("questionnaire_import/cloud-native.yaml"); AssessmentQuestionnaire.enable(cloudNative); AssessmentQuestionnaire.enable(legacyPathfinder); diff --git a/cypress/e2e/tests/migration/reports-tab/links-validation.test.ts b/cypress/e2e/tests/migration/reports-tab/links-validation.test.ts index 5549fea52..6a29029a1 100644 --- a/cypress/e2e/tests/migration/reports-tab/links-validation.test.ts +++ b/cypress/e2e/tests/migration/reports-tab/links-validation.test.ts @@ -41,7 +41,7 @@ describe(["@tier2"], "Reports tests", () => { login(); deleteAllMigrationWaves(); deleteApplicationTableRows(); - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(legacyPathfinder); stakeholdersList = createMultipleStakeholders(1); applicationsList = createMultipleApplications(4); diff --git a/cypress/e2e/tests/migration/reports-tab/reports.test.ts b/cypress/e2e/tests/migration/reports-tab/reports.test.ts index 3b918af8b..630fe1650 100644 --- a/cypress/e2e/tests/migration/reports-tab/reports.test.ts +++ b/cypress/e2e/tests/migration/reports-tab/reports.test.ts @@ -42,7 +42,7 @@ let riskType = ["low", "medium", "high", "low", "high", "high"]; describe(["@tier2"], "Reports tests", () => { before("Login and Create Test Data", function () { login(); - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(legacyPathfinder); deleteAllMigrationWaves(); deleteApplicationTableRows(); diff --git a/cypress/e2e/tests/migration/reports-tab/sort.test.ts b/cypress/e2e/tests/migration/reports-tab/sort.test.ts index c3d1af1a7..2fce20e47 100644 --- a/cypress/e2e/tests/migration/reports-tab/sort.test.ts +++ b/cypress/e2e/tests/migration/reports-tab/sort.test.ts @@ -51,7 +51,7 @@ describe(["@tier2"], "Reports tests", () => { login(); deleteAllMigrationWaves(); deleteApplicationTableRows(); - AssessmentQuestionnaire.deleteAllQuesionnaire(); + AssessmentQuestionnaire.deleteAllQuestionnaires(); AssessmentQuestionnaire.enable(legacyPathfinder); stakeholder = createMultipleStakeholders(1)[0]; application = createMultipleApplications(1)[0];