Skip to content

Commit

Permalink
[RFR] Verify application Review field after inheritance from multiple…
Browse files Browse the repository at this point in the history
… archetypes (#917)

* Verify application Review field after inheritance from multiple archetypes

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

* Update validateReviewFields

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

* Minor change

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

* Update validateReviewFields

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

* update assessment.validateReviewFields()

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

* update assessment.validateReviewFields()

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

---------

Signed-off-by: Nandini Chandra <[email protected]>
  • Loading branch information
nachandr authored Jan 18, 2024
1 parent 594578d commit b3ae85e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,13 @@ export class Application {
click(commonView.sideDrawer.closeDrawer);
}

validateInheritedReviewFields(archetypeNames: string[]): void {
Application.open();
for (let archetypeName of archetypeNames) {
Assessment.validateReviewFields(this.name, "Archetype", archetypeName);
}
}

retake_questionnaire(
risk,
stakeholders?: Stakeholders[],
Expand Down
43 changes: 32 additions & 11 deletions cypress/e2e/models/migration/applicationinventory/assessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,13 @@ export class Assessment {
cy.wait(2 * SEC);
}

public static validateReviewFields(name: string, entityName: string): void {
public static validateReviewFields(
name: string,
entityName: string,
archetypeName?: string
): void {
sidedrawerTab(name, "Review");
if (archetypeName) name = archetypeName;
let list = [
"Proposed action",
"Effort estimate",
Expand Down Expand Up @@ -254,21 +260,36 @@ export class Assessment {
`${entityName} - ${name}-10`,
];

sidedrawerTab(name, "Review");
for (let i in list) {
cy.get("dt")
.contains(list[i])
.closest("div")
.within(() => {
cy.get("dd").then(($value) => {
let text = $value.text();
if (list[i] == "Proposed action") expect(text).to.be.oneOf(actionList);
if (list[i] == "Effort estimate")
expect(text).to.be.oneOf(effortEstimateList);
if (list[i] == "Business criticality" || list[i] == "Work priority")
expect(text).to.be.oneOf(criticalityList);
if (list[i] == "Comments") expect(text).not.equal("Not yet reviewed");
});
if (archetypeName) {
let item;
cy.get("span.pf-v5-c-label__text").each((item) => {
if (Cypress.$(item).text().includes(name)) {
if (list[i] == "Proposed action")
expect(Cypress.$(item).text()).to.be.oneOf(actionList);
if (list[i] == "Effort estimate")
expect(Cypress.$(item).text()).to.be.oneOf(effortEstimateList);
if (list[i] == "Business criticality" || list[i] == "Work priority")
expect(Cypress.$(item).text()).to.be.oneOf(criticalityList);
if (list[i] == "Comments")
expect(Cypress.$(item).text()).not.equal("Not yet reviewed");
}
});
} else {
cy.get("dd").then(($value) => {
let text = $value.text();
if (list[i] == "Proposed action") expect(text).to.be.oneOf(actionList);
if (list[i] == "Effort estimate")
expect(text).to.be.oneOf(effortEstimateList);
if (list[i] == "Business criticality" || list[i] == "Work priority")
expect(text).to.be.oneOf(criticalityList);
if (list[i] == "Comments") expect(text).not.equal("Not yet reviewed");
});
}
});
}
click(commonView.sideDrawer.closeDrawer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ describe(["@tier2"], "Tests related to application-archetype association ", () =
/* Automates MTA-420
This also verifies: Archetype association - Application creation after archetype creation.
*/

archetypeList = createMultipleArchetypes(2, tags);
const archetypeNames = [archetypeList[0].name, archetypeList[1].name];

const appdata = {
name: data.getAppName(),
Expand All @@ -96,6 +98,9 @@ describe(["@tier2"], "Tests related to application-archetype association ", () =

// Assert that 'Archetypes reviewed' is populated on app drawer after review inheritance
application.verifyArchetypeReviewedList(archetypeList);

// Validate 'Reviews' field on app drawer after review inheritance
application.validateInheritedReviewFields(archetypeNames);
});

after("Perform test data clean up", function () {
Expand Down

0 comments on commit b3ae85e

Please sign in to comment.