Skip to content

Commit

Permalink
Added assessment to pre-upgrade test
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Braginsky <[email protected]>
  • Loading branch information
ibragins committed Feb 1, 2024
1 parent cde07d2 commit 2ea35d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cypress/e2e/tests/upgrade/create_upgrade_data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ import { getRandomCredentialsData } from "../../../utils/data_utils";
import { Analysis } from "../../models/migration/applicationinventory/analysis";
import { UpgradeData } from "../../types/types";
import { CredentialsMaven } from "../../models/administration/credentials/credentialsMaven";
import { Assessment } from "../../models/migration/applicationinventory/assessment";

describe(["@pre-upgrade"], "Creating pre-requisites before an upgrade", () => {
let mavenCredentialsUsername: CredentialsMaven;
let sourceControlUsernameCredentials: CredentialsSourceControlUsername;
const assessment = new Assessment(getRandomApplicationData());
let stakeHolder: Stakeholders;

before("Login", function () {
// Perform login
Expand Down Expand Up @@ -92,7 +95,7 @@ describe(["@pre-upgrade"], "Creating pre-requisites before an upgrade", () => {
// Defining stakeholder groups
const stakeHolderGroup = new Stakeholdergroups(stakeHolderGroupName);
// Defining stakeholders
const stakeHolder = new Stakeholders("[email protected]", stakeHolderName, jobFunctionName, [
stakeHolder = new Stakeholders("[email protected]", stakeHolderName, jobFunctionName, [
stakeHolderGroupName,
]);
// Defining business Service
Expand Down Expand Up @@ -122,6 +125,7 @@ describe(["@pre-upgrade"], "Creating pre-requisites before an upgrade", () => {
cy.wait(2 * SEC);
sourceApplication.analyze();
sourceApplication.verifyAnalysisStatus("Completed");
sourceApplication.selectApplicationRow();
});

it("Creating Upload Binary Analysis", function () {
Expand All @@ -135,6 +139,7 @@ describe(["@pre-upgrade"], "Creating pre-requisites before an upgrade", () => {
// No credentials required for uploaded binary.
uploadBinaryApplication.analyze();
uploadBinaryApplication.verifyAnalysisStatus("Completed");
uploadBinaryApplication.selectApplicationRow();
});

it("Binary Analysis", function () {
Expand All @@ -155,5 +160,12 @@ describe(["@pre-upgrade"], "Creating pre-requisites before an upgrade", () => {
);
binaryApplication.analyze();
binaryApplication.verifyAnalysisStatus("Completed");
binaryApplication.selectApplicationRow();
});

it("Assess application", function () {
assessment.name = this.upgradeData.assessmentName;
assessment.create();
assessment.perform_assessment("low", [stakeHolder.name]);
});
});
1 change: 1 addition & 0 deletions cypress/e2e/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export type RbacValidationRules = {
};

export type UpgradeData = {
assessmentName?: string;
jobFunctionName?: string;
stakeHolderGroupName?: string;
stakeHolderName?: string;
Expand Down
1 change: 1 addition & 0 deletions cypress/fixtures/upgrade-data.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"assessmentName": "upgrade-assessment",
"jobFunctionName": "upgrade-jobFunction",
"stakeHolderGroupName": "upgrade-stakeHolderGroup",
"stakeHolderName": "upgrade-stakeHolder",
Expand Down

0 comments on commit 2ea35d6

Please sign in to comment.