diff --git a/cypress/e2e/tests/administration/questionnaires/crud.test.ts b/cypress/e2e/tests/administration/questionnaires/crud.test.ts new file mode 100644 index 000000000..ef21b780e --- /dev/null +++ b/cypress/e2e/tests/administration/questionnaires/crud.test.ts @@ -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 + ); + }); +}); diff --git a/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts b/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts index bc5923e4f..a806d3bbf 100644 --- a/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts +++ b/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts @@ -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 diff --git a/cypress/e2e/views/assessmentquestionnaire.view.ts b/cypress/e2e/views/assessmentquestionnaire.view.ts index 2dc4c61d7..d60807172 100644 --- a/cypress/e2e/views/assessmentquestionnaire.view.ts +++ b/cypress/e2e/views/assessmentquestionnaire.view.ts @@ -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"; diff --git a/cypress/e2e/views/common.view.ts b/cypress/e2e/views/common.view.ts index 6cc6f3b16..03beffc49 100644 --- a/cypress/e2e/views/common.view.ts +++ b/cypress/e2e/views/common.view.ts @@ -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"; diff --git a/cypress/fixtures/questionnaire_import/cloud-native.yaml b/cypress/fixtures/questionnaire_import/cloud-native.yaml new file mode 100644 index 000000000..b699d8a91 --- /dev/null +++ b/cypress/fixtures/questionnaire_import/cloud-native.yaml @@ -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