Skip to content

Commit

Permalink
[RFR] Questionnaire CRUD operations (#769)
Browse files Browse the repository at this point in the history
* Questionnaire CRUD operations

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

* Questionnaire CRUD operations

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

* Updated selector name

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

* Add questionnaire YAML file

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

* Add questionnaire

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

* A few updates

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

---------

Signed-off-by: Nandini Chandra <[email protected]>
  • Loading branch information
nachandr authored Oct 26, 2023
1 parent 0fa1fe7 commit 2924672
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 4 deletions.
37 changes: 37 additions & 0 deletions cypress/e2e/tests/administration/questionnaires/crud.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { AssessmentQuestionnaire } from "../../../models/administration/assessment_questionnaire/assessment_questionnaire";
import { checkSuccessAlert, login, closeModalWindow } from "../../../../utils/utils";
import { alertTitle } from "../../../views/common.view";

const yamlFileName = "questionnaire_import/cloud-native.yaml";
const fileName = "Cloud Native";

describe(["@tier2"], "Questionnaire CRUD operations", () => {
before("Login", function () {
login();
});

it("Import questionnaire", function () {
AssessmentQuestionnaire.import(yamlFileName);
checkSuccessAlert(
alertTitle,
`Success alert:Questionnaire ${fileName} was successfully created.`,
true
);
AssessmentQuestionnaire.enable(fileName, false);
});

it("Duplicate questionnaire Test", function () {
AssessmentQuestionnaire.import(yamlFileName);
checkSuccessAlert(alertTitle, "UNIQUE constraint failed: Questionnaire.Name");
closeModalWindow();
});

it("Delete questionnaire", function () {
AssessmentQuestionnaire.delete(fileName);
checkSuccessAlert(
alertTitle,
`Success alert:Questionnaire ${fileName} was successfully deleted.`,
true
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ describe(["@tier1"], "Migration Waves Validations", () => {
migrationWavesList.push(migrationWave1);
//create another MW with same params
migrationWave1.create();
checkSuccessAlert(commonView.duplicateNameWarning, duplicateMigrationWaveError);
checkSuccessAlert(commonView.alertTitle, duplicateMigrationWaveError);

const migrationWave3 = new MigrationWave(null, startDate, endDate, null, null, null);
migrationWave3.create();
migrationWave3.create();
checkSuccessAlert(commonView.duplicateNameWarning, duplicateMigrationWaveError);
checkSuccessAlert(commonView.alertTitle, duplicateMigrationWaveError);
migrationWavesList.push(migrationWave3);

//migrationwave3 name is null, so it can't be deleted by list
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/views/assessmentquestionnaire.view.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const legacyPathfinderToggle = "input#required-switch-0";
export const questionnaireUpload = "input#yamlFile-file-upload-filename";
export const confirmDeletion = ".confirm-deletion-input";
export const confirmDeletion = "#confirm-deletion-input";
export const importQuestionnaire = "#import-questionnaire";
export const switchToggle = ".pf-v5-c-switch__toggle";
2 changes: 1 addition & 1 deletion cypress/e2e/views/common.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const itemsPerPageMenuOptions = "ul.pf-v5-c-menu__list";
export const expandRow = "button[aria-label=Details]";
export const successAlertMessage = ".pf-m-success";
export const infoAlertMessage = ".pf-m-info";
export const duplicateNameWarning = "h4[class*='alert__title']";
export const alertTitle = "h4[class*='alert__title']";
export const appTable = ".pf-v5-c-table";
export const expandableRow = ".pf-c-expandable-row";
export const nameHelper = "span.pf-v5-c-helper-text__item-text";
Expand Down
217 changes: 217 additions & 0 deletions cypress/fixtures/questionnaire_import/cloud-native.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
name: Cloud Native
description: |
Questionnaire that includes the Twelve Factor Application principles.
sections:
- order: 1
name: Application technologies 1
questions:
- text: What is the main technology in your application?
explanation: What would you describe as the main framework used to build your application.
answers:
- text: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- text: Quarkus
risk: green
autoAnswerFor:
- category: Technology
tag: Quarkus
applyTags:
- category: Technology
tag: Quarkus
- text: Spring Boot
risk: green
autoAnswerFor:
- category: Technology
tag: Spring Boot
applyTags:
- category: Technology
tag: Spring Boot
- text: Java EE
rationale: This might not be the most cloud friendly technology.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: yellow
autoAnswerFor:
- category: Technology
tag: Java EE
applyTags:
- category: Technology
tag: Java EE
- text: J2EE
rationale: This is obsolete.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: red
autoAnswerFor:
- category: Technology
tag: J2EE
applyTags:
- category: Technology
tag: J2EE
- text: "What version of Java EE does the application use?"
explanation: "What version of the Java EE specification is your application using?"
answers:
- text: Below 5.
rationale: This technology stack is obsolete.
mitigation: Consider migrating to at least Java EE 7.
risk: red
- text: 5 or 6
rationale: This is a mostly outdated stack.
mitigation: Consider migrating to at least Java EE 7.
risk: yellow
- text: "7"
risk: green
includeFor:
- category: Technology
tag: Java EE
- text: Does your application use any caching mechanism?
answers:
- text: Yes
rationale: This could be problematic in containers and Kubernetes.
mitigation: Review the clustering mechanism to check compatibility and support for container environments.
risk: yellow
autoAnswerFor:
- category: Caching
tag: Infinispan
- category: Caching
tag: Datagrid
- category: Caching
tag: eXtreme Scale
- category: Caching
tag: Coherence
- text: No
risk: green
- text: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- text: What implementation of JAX-WS does your application use?
answers:
- text: Apache Axis
rationale: This version is obsolete
mitigation: Consider migrating to Apache CXF
risk: red
- text: Apache CXF
risk: green
- text: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
excludeFor:
- category: Technology
tag: Spring Boot
- category: Technology
tag: Quarkus

- order: 2
name: Application technologies
questions:
- text: What is the main technology in your application?
explanation: What would you describe as the main framework used to build your application.
answers:
- text: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- text: Quarkus
risk: green
autoAnswerFor:
- category: Technology
tag: Quarkus
applyTags:
- category: Technology
tag: Quarkus
- text: Spring Boot
risk: green
autoAnswerFor:
- category: Technology
tag: Spring Boot
applyTags:
- category: Technology
tag: Spring Boot
- text: Java EE
rationale: This might not be the most cloud friendly technology.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: yellow
autoAnswerFor:
- category: Technology
tag: Java EE
applyTags:
- category: Technology
tag: Java EE
- text: J2EE
rationale: This is obsolete.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: red
autoAnswerFor:
- category: Technology
tag: J2EE
applyTags:
- category: Technology
tag: J2EE
- text: "What version of Java EE does the application use?"
explanation: "What version of the Java EE specification is your application using?"
answers:
- text: Below 5.
rationale: This technology stack is obsolete.
mitigation: Consider migrating to at least Java EE 7.
risk: red
- text: 5 or 6
rationale: This is a mostly outdated stack.
mitigation: Consider migrating to at least Java EE 7.
risk: yellow
- text: "7"
risk: green
includeFor:
- category: Technology
tag: Java EE
- text: Does your application use any caching mechanism?
answers:
- text: Yes
rationale: This could be problematic in containers and Kubernetes.
mitigation: Review the clustering mechanism to check compatibility and support for container environments.
risk: yellow
autoAnswerFor:
- category: Caching
tag: Infinispan
- category: Caching
tag: Datagrid
- category: Caching
tag: eXtreme Scale
- category: Caching
tag: Coherence
- text: No
risk: green
- text: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- text: What implementation of JAX-WS does your application use?
answers:
- text: Apache Axis
rationale: This version is obsolete
mitigation: Consider migrating to Apache CXF
risk: red
- text: Apache CXF
risk: green
- text: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
excludeFor:
- category: Technology
tag: Spring Boot
- category: Technology
tag: Quarkus

thresholds:
red: 1
yellow: 30
unknown: 15

riskMessages:
red: Application requires deep changes in architecture or lifecycle
yellow: Application is Cloud friendly but requires some minor changes
green: Application is Cloud Native
unknown: More information about the application is required

0 comments on commit 2924672

Please sign in to comment.