-
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] Verify questionnaire feature: Conditional questions (#951)
* Verify questionnaire featyure: Conditional question Signed-off-by: Nandini Chandra <[email protected]> * Add new questionnaire template file Signed-off-by: Nandini Chandra <[email protected]> * Minor changes Signed-off-by: Nandini Chandra <[email protected]> * Minor changes Signed-off-by: Nandini Chandra <[email protected]> * Update file path Signed-off-by: Nandini Chandra <[email protected]> * Update file path Signed-off-by: Nandini Chandra <[email protected]> * Minor change Signed-off-by: Nandini Chandra <[email protected]> --------- Signed-off-by: Nandini Chandra <[email protected]>
- Loading branch information
Showing
3 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
102 changes: 102 additions & 0 deletions
102
cypress/e2e/tests/migration/applicationinventory/assessment/questionnaire_features.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,102 @@ | ||
/* | ||
Copyright © 2021 the Konveyor Contributors (https://konveyor.io/) | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
/// <reference types="cypress" /> | ||
|
||
import { | ||
login, | ||
deleteByList, | ||
clickItemInKebabMenu, | ||
clickByText, | ||
createMultipleStakeholders, | ||
click, | ||
clickJs, | ||
} from "../../../../../utils/utils"; | ||
import { Stakeholders } from "../../../../models/migration/controls/stakeholders"; | ||
import { AssessmentQuestionnaire } from "../../../../models/administration/assessment_questionnaire/assessment_questionnaire"; | ||
import { confirmButton, nextButton } from "../../../../views/common.view"; | ||
import { | ||
legacyPathfinder, | ||
SEC, | ||
button, | ||
cloudReadinessQuestionnaire, | ||
cloudReadinessFilePath, | ||
} from "../../../../types/constants"; | ||
import { Application } from "../../../../models/migration/applicationinventory/application"; | ||
import { Assessment } from "../../../../models/migration/applicationinventory/assessment"; | ||
import * as data from "../../../../../utils/data_utils"; | ||
import { questionBlock } from "../../../../views/assessment.view"; | ||
|
||
let stakeholderList: Array<Stakeholders> = []; | ||
|
||
describe(["@tier3"], "Tests related to questionnaire features", () => { | ||
before("Import and enable Cloud readiness questionnaire template", function () { | ||
login(); | ||
|
||
AssessmentQuestionnaire.deleteAllQuestionnaires(); | ||
AssessmentQuestionnaire.disable(legacyPathfinder); | ||
AssessmentQuestionnaire.import(cloudReadinessFilePath); | ||
AssessmentQuestionnaire.enable(cloudReadinessQuestionnaire); | ||
stakeholderList = createMultipleStakeholders(1); | ||
}); | ||
|
||
it("1) Test conditional questions during application assessment; 2) Cancel assessment", function () { | ||
//Automates Polarion MTA-385: Test conditional questions | ||
|
||
const appdata = { | ||
name: data.getAppName(), | ||
tags: ["Language / Java"], | ||
}; | ||
const appConditionalQuestion = new Application(appdata); | ||
appConditionalQuestion.create(); | ||
cy.wait(2 * SEC); | ||
|
||
Application.open(); | ||
cy.wait(2 * SEC); | ||
clickItemInKebabMenu(appConditionalQuestion.name, "Assess"); | ||
Assessment.take_questionnaire(cloudReadinessQuestionnaire); | ||
Assessment.selectStakeholders(stakeholderList); | ||
clickJs(nextButton); | ||
cy.wait(SEC); | ||
cy.get(questionBlock) | ||
.eq(0) | ||
.then(($question) => { | ||
cy.wrap($question) | ||
.children() | ||
.find("div.pf-v5-l-split__item") | ||
.then(($questionLine) => { | ||
console.log($questionLine.text()); | ||
console.log("Hello"); | ||
expect($questionLine.text()).equal( | ||
"What is the main technology in your application?", | ||
"Conditional question missing" | ||
); | ||
}); | ||
Assessment.clickRadioOption($question, 1); | ||
cy.wait(2000); | ||
}); | ||
|
||
// Automates Polarion MTA-505: Cancel assessment | ||
clickByText(button, "Cancel"); | ||
click(confirmButton); | ||
Assessment.verifyAssessmentTakeButtonEnabled(); | ||
appConditionalQuestion.delete(); | ||
}); | ||
|
||
after("Perform test data clean up", function () { | ||
deleteByList(stakeholderList); | ||
AssessmentQuestionnaire.deleteAllQuestionnaires(); | ||
}); | ||
}); |
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
92 changes: 92 additions & 0 deletions
92
cypress/fixtures/questionnaire_import/CloudReadiness_7.0.1.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,92 @@ | ||
name: Uploadable Cloud Readiness Questionnaire Template | ||
description: This questionnaire is an example template for assessing cloud readiness. It serves as a guide for users to create and customize their own questionnaire templates. | ||
required: true | ||
sections: | ||
- order: 1 | ||
name: Application Technologies | ||
questions: | ||
- order: 1 | ||
text: What is the main technology in your application? | ||
explanation: Identify the main framework or technology used in your application. | ||
includeFor: | ||
- category: Language | ||
tag: Java | ||
answers: | ||
- order: 1 | ||
text: Quarkus | ||
risk: green | ||
rationale: Quarkus is a modern, container-friendly framework. | ||
mitigation: No mitigation needed. | ||
applyTags: | ||
- category: Runtime | ||
tag: Quarkus | ||
autoAnswerFor: | ||
- category: Runtime | ||
tag: Quarkus | ||
- order: 2 | ||
text: Spring Boot | ||
risk: green | ||
rationale: Spring Boot is versatile and widely used. | ||
mitigation: Ensure container compatibility. | ||
applyTags: | ||
- category: Runtime | ||
tag: Spring Boot | ||
autoAnswerFor: | ||
- category: Runtime | ||
tag: Spring Boot | ||
- order: 3 | ||
text: Legacy Monolithic Application | ||
risk: red | ||
rationale: Legacy monoliths are challenging for cloud adaptation. | ||
mitigation: Consider refactoring into microservices. | ||
- order: 2 | ||
text: Does your application use a microservices architecture? | ||
explanation: Assess if the application is built using a microservices architecture. | ||
answers: | ||
- order: 1 | ||
text: Yes | ||
risk: green | ||
rationale: Microservices are well-suited for cloud environments. | ||
mitigation: Continue monitoring service dependencies. | ||
- order: 2 | ||
text: No | ||
risk: yellow | ||
rationale: Non-microservices architectures may face scalability issues. | ||
mitigation: Assess the feasibility of transitioning to microservices. | ||
- order: 3 | ||
text: Unknown | ||
risk: unknown | ||
rationale: Lack of clarity on architecture can lead to unplanned issues. | ||
mitigation: Conduct an architectural review. | ||
|
||
- order: 3 | ||
text: Is your application's data storage cloud-optimized? | ||
explanation: Evaluate if the data storage solution is optimized for cloud usage. | ||
includeFor: | ||
- category: Language | ||
tag: Java | ||
answers: | ||
- order: 1 | ||
text: Cloud-Native Storage Solution | ||
risk: green | ||
rationale: Cloud-native solutions offer scalability and resilience. | ||
mitigation: Ensure regular backups and disaster recovery plans. | ||
- order: 2 | ||
text: Traditional On-Premises Storage | ||
risk: red | ||
rationale: Traditional storage might not scale well in the cloud. | ||
mitigation: Explore cloud-based storage solutions. | ||
- order: 3 | ||
text: Hybrid Storage Approach | ||
risk: yellow | ||
rationale: Hybrid solutions may have integration complexities. | ||
mitigation: Evaluate and optimize cloud integration points. | ||
thresholds: | ||
red: 1 | ||
yellow: 30 | ||
unknown: 15 | ||
riskMessages: | ||
red: Requires deep changes in architecture or lifecycle | ||
yellow: Cloud friendly but needs minor changes | ||
green: Cloud Native | ||
unknown: More information needed |