Skip to content

Commit

Permalink
[RFR] Verify multiple apps inherit archetype assessment/review (#945)
Browse files Browse the repository at this point in the history
* Verify multiple apps inherit archetype assessment/review

Signed-off-by: Nandini Chandra <[email protected]>

* updates

Signed-off-by: Nandini Chandra <[email protected]>

* Update createMultipleApplications()

Signed-off-by: Nandini Chandra <[email protected]>

---------

Signed-off-by: Nandini Chandra <[email protected]>
  • Loading branch information
nachandr authored Feb 2, 2024
1 parent e41354d commit 6e81ddd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
createMultipleArchetypes,
deleteByList,
createMultipleStakeholders,
createMultipleApplications,
} from "../../../../../utils/utils";
import { Application } from "../../../../models/migration/applicationinventory/application";
import { Archetype } from "../../../../models/migration/archetypes/archetype";
Expand All @@ -30,8 +31,8 @@ import { AssessmentQuestionnaire } from "../../../../models/administration/asses
import { legacyPathfinder, SEC } from "../../../../types/constants";
import { Stakeholders } from "../../../../models/migration/controls/stakeholders";

let applicationList: Array<Application> = [];
let archetypeList: Array<Archetype> = [];
let applicationList: Application[];
let archetypeList: Archetype[];
let tags: Tag[];
let stakeholders: Stakeholders[];

Expand All @@ -45,29 +46,34 @@ describe(["@tier2"], "Tests related to application-archetype association ", () =
AssessmentQuestionnaire.enable(legacyPathfinder);
});

it("Archetype association - Application creation before archetype creation ", function () {
// Automates Polarion MTA-400
const appdata = {
name: data.getAppName(),
tags: ["Web / WebSocket"],
};

const application = new Application(appdata);
applicationList.push(application);
application.create();
cy.wait(2 * SEC);
it("Verify multiple applications inherit assessment and review inheritance from an archetype", function () {
// Automates Polarion MTA-400 Archetype association - Application creation before archetype creation.
applicationList = createMultipleApplications(2, [tags[0].name]);

const archetype = new Archetype(
data.getRandomWord(8),
["Web / WebSocket"],
["Web / WebSocket"],
[tags[0].name],
[tags[1].name],
null
);
archetype.create();
cy.wait(2 * SEC);

// Assert that associated archetypes are listed on app drawer after application gets associated with archetype(s)
application.verifyArchetypeList([archetype.name], "Associated archetypes");
//Automates Polarion MTA-499 Verify multiple applications inherit assessment and review inheritance from an archetype
archetype.perform_review("low");
archetype.perform_assessment("low");

for (let i = 0; i < applicationList.length; i++) {
// Assert that associated archetypes are listed on app drawer after application gets associated with archetype(s)
applicationList[i].verifyArchetypeList([archetype.name], "Associated archetypes");
applicationList[i].verifyArchetypeList([archetype.name], "Archetypes reviewed");
applicationList[i].validateInheritedReviewFields([archetype.name]);
applicationList[i].verifyStatus("review", "Completed");
applicationList[i].verifyArchetypeList([archetype.name], "Archetypes assessed");
applicationList[i].validateAssessmentField("Low");
applicationList[i].verifyStatus("assessment", "Completed");
}

archetype.delete();
});

Expand Down
9 changes: 7 additions & 2 deletions cypress/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1102,11 +1102,16 @@ export function getRandomAnalysisData(analysisdata): analysisData {
};
}

export function createMultipleApplications(numberofapplications: number): Array<Application> {
export function createMultipleApplications(
numberofapplications: number,
tags?: [string]
): Array<Application> {
let applicationList: Array<Application> = [];
let application: Application;
for (let i = 0; i < numberofapplications; i++) {
// Navigate to application inventory tab and create new application
const application = new Application(getRandomApplicationData());
if (tags) application = new Application(getRandomApplicationData(tags));
else application = new Application(getRandomApplicationData());
application.create();
applicationList.push(application);
cy.wait(2000);
Expand Down

0 comments on commit 6e81ddd

Please sign in to comment.