Skip to content

Commit

Permalink
[RFR] [JF] Use legacy questionnaire for export test (#809)
Browse files Browse the repository at this point in the history
* Use legacy questionnaire for export test

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

* Format file

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

* Format file

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

---------

Signed-off-by: Nandini Chandra <[email protected]>
  • Loading branch information
nachandr authored Nov 15, 2023
1 parent 90acbfa commit 98cf669
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions cypress/e2e/tests/administration/questionnaires/crud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
import { alertTitle } from "../../../views/common.view";

const yamlFileName = "questionnaire_import/cloud-native.yaml";
const fileName = "Cloud Native";
const importedQuestionnaire = "Cloud Native";
const legacyQuestionnaire = "Legacy Pathfinder";

describe(["@tier2"], "Questionnaire CRUD operations", () => {
before("Login", function () {
Expand All @@ -20,10 +21,10 @@ describe(["@tier2"], "Questionnaire CRUD operations", () => {
AssessmentQuestionnaire.import(yamlFileName);
checkSuccessAlert(
alertTitle,
`Success alert:Questionnaire ${fileName} was successfully created.`,
`Success alert:Questionnaire ${importedQuestionnaire} was successfully created.`,
true
);
AssessmentQuestionnaire.enable(fileName, false);
AssessmentQuestionnaire.enable(importedQuestionnaire, false);
});

it("Duplicate questionnaire Test", function () {
Expand All @@ -33,15 +34,18 @@ describe(["@tier2"], "Questionnaire CRUD operations", () => {
});

it("Export questionnaire", function () {
AssessmentQuestionnaire.export(fileName);
cy.readFile("cypress/downloads/questionnaire-4.yaml").should("contain", fileName);
AssessmentQuestionnaire.export(legacyQuestionnaire);
cy.readFile("cypress/downloads/questionnaire-1.yaml").should(
"contain",
legacyQuestionnaire
);
});

it("Delete questionnaire", function () {
AssessmentQuestionnaire.delete(fileName);
AssessmentQuestionnaire.delete(importedQuestionnaire);
checkSuccessAlert(
alertTitle,
`Success alert:Questionnaire ${fileName} was successfully deleted.`,
`Success alert:Questionnaire ${importedQuestionnaire} was successfully deleted.`,
true
);
});
Expand Down

0 comments on commit 98cf669

Please sign in to comment.