Skip to content

Commit

Permalink
[RFR][TA] MTA-392 --- View archived assessments (#841)
Browse files Browse the repository at this point in the history
* Signed-off-by: mohamed idays [email protected]
initial commit

* Signed-off-by: mohamed idays [email protected]
tweaks

* Signed-off-by: mohamed idays [email protected]
tweaks

* Signed-off-by: mohamed idays [email protected]
tweaks

* Signed-off-by: mohamed idays [email protected]
rename test

* Signed-off-by: mohamed idays [email protected]
fixed formatting
  • Loading branch information
midays authored Nov 29, 2023
1 parent b523e52 commit 163fa9a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class AssessmentQuestionnaire {
AssessmentQuestionnaire.operation(fileName, "View");
}

public static disable(fileName: string) {
this.enable(fileName, false);
}
public static enable(fileName: string, enable = true) {
AssessmentQuestionnaire.open();
let selector = enable ? ".pf-m-on" : ".pf-m-off";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,26 @@ import {
createMultipleApplications,
deleteByList,
checkSuccessAlert,
selectItemsPerPage,
getRandomApplicationData,
} from "../../../../../utils/utils";

import * as data from "../../../../../utils/data_utils";
import { Stakeholders } from "../../../../models/migration/controls/stakeholders";
import { Assessment } from "../../../../models/migration/applicationinventory/assessment";
import { AssessmentQuestionnaire } from "../../../../models/administration/assessment_questionnaire/assessment_questionnaire";
import { alertTitle } from "../../../../views/common.view";
import { Application } from "../../../../models/migration/applicationinventory/application";
const yamlFile = "questionnaire_import/cloud-native.yaml";

import { legacyPathfinder, cloudNative, SEC } from "../../../../types/constants";
import {
ArchivedQuestionnaires,
ArchivedQuestionnairesTableDataCell,
} from "../../../../views/assessmentquestionnaire.view";

const fileName = "Legacy Pathfinder";
let stakeholderList: Array<Stakeholders> = [];
let stakeholderNameList: Array<string> = [];
let applicationList: Array<Assessment> = [];
let applicationOpen: boolean;

describe(["@tier3"], "Tests related to application assessment and review", () => {
before("Perform application assessment and review", function () {
Expand Down Expand Up @@ -81,8 +86,40 @@ describe(["@tier3"], "Tests related to application assessment and review", () =>
applicationList[0].verifyStatus("review", "Not started");
});

// Polarion TC MTA-392
it("Bug MTA-1722: View archived questionnaire", function () {
const application = new Assessment(getRandomApplicationData());
application.create();
cy.wait("@getApplication");
cy.wait(2 * SEC);

application.perform_assessment("high", stakeholderNameList);
cy.wait(2 * SEC);

application.verifyStatus("assessment", "Completed");
AssessmentQuestionnaire.disable(legacyPathfinder);

application.clickAssessButton();

cy.contains("table", ArchivedQuestionnaires)
.find(ArchivedQuestionnairesTableDataCell)
.should("have.text", legacyPathfinder);

AssessmentQuestionnaire.import(yamlFile);
AssessmentQuestionnaire.disable(cloudNative);

application.clickAssessButton();
cy.contains("table", ArchivedQuestionnaires)
.find(ArchivedQuestionnairesTableDataCell)
.last()
.should("not.have.text", cloudNative);
// todo: uncomment when the bug is fixed
// AssessmentQuestionnaire.delete(cloudNative);
});

after("Perform test data clean up", function () {
deleteByList(stakeholderList);
deleteByList(applicationList);
AssessmentQuestionnaire.delete(cloudNative);
});
});
2 changes: 2 additions & 0 deletions cypress/e2e/views/assessmentquestionnaire.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export const confirmDeletion = "#confirm-deletion-input";
export const importQuestionnaire = "#import-questionnaire";
export const switchToggle = ".pf-v5-c-switch__toggle";
export const downloadYamlTemplate = "#download-yaml-template";
export const ArchivedQuestionnaires = "Archived questionnaires";
export const ArchivedQuestionnairesTableDataCell = 'td[data-label="Archived questionnaires"]';

0 comments on commit 163fa9a

Please sign in to comment.