-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFR] Questionnaire CRUD operations (#769)
* 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
Showing
5 changed files
with
258 additions
and
4 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
cypress/e2e/tests/administration/questionnaires/crud.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
217 changes: 217 additions & 0 deletions
217
cypress/fixtures/questionnaire_import/cloud-native.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |