Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kpunwatk committed Jan 19, 2024
1 parent cd40654 commit bc82128
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
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,
getRandomApplicationData,
getRandomAnalysisData,
deleteByList,
} from "../../../../../utils/utils";
import { Analysis } from "../../../../models/migration/applicationinventory/analysis";
import { SEC } from "../../../../types/constants";
import { Application } from "../../../../models/migration/applicationinventory/application";
import { AppIssue } from "../../../../types/types";
let applicationsList: Array<Analysis> = [];

describe(["@tier2"], "Bug MTA-2006: Affected files validation", () => {
before("Login", function () {
login();
});

beforeEach("Load data", function () {
cy.fixture("application").then(function (appData) {
this.appData = appData;
});
cy.fixture("analysis").then(function (analysisData) {
this.analysisData = analysisData;
});

// Interceptors
cy.intercept("POST", "/hub/application*").as("postApplication");
cy.intercept("GET", "/hub/application*").as("getApplication");
});

afterEach("Reset url", function () {
Application.open(true);
});

it("Bug MTA-2006: Affected files validation with Source + dependencies analysis on daytrader app", function () {
// Automate bug https://issues.redhat.com/browse/MTA-2006
const application = new Analysis(
getRandomApplicationData("dayTraderApp_Source+dependencies-affected-files", {
sourceData: this.appData["daytrader-app"],
}),
getRandomAnalysisData(
this.analysisData["source+dep_analysis_on_daytrader-app-affected-files"]
)
);
application.create();
applicationsList.push(application);
cy.wait("@getApplication");
cy.wait(2 * SEC);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.validateIssues(
this.analysisData["source+dep_analysis_on_daytrader-app-affected-files"]["issues"]
);
this.analysisData["source+dep_analysis_on_daytrader-app-affected-files"]["issues"].forEach(
(currentIssue: AppIssue) => {
application.validateAffected(currentIssue);
}
);
});

after("Perform test data clean up", function () {
deleteByList(applicationsList);
});
});
21 changes: 21 additions & 0 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,26 @@
"source_analysis_on_pet_clinic_app": {
"source": "Source code",
"appName": "pet-clinic"
},

"source+dep_analysis_on_daytrader-app-affected-files": {
"source": "Source code + dependencies",
"target": ["Application server migration to"],
"appName": "deps",
"storyPoints": 24,
"issues": [
{
"name": "Hibernate Search 5 - Changes in indexing numeric and date values",
"category": "optional",
"source": "eap",
"targets": ["eap"],
"effort": 1,
"incidents": 2,
"affectedFiles": 64,
"ruleSet": "eap7/weblogic/tests/data",
"rule": "hsearch-00116",
"labels": ["hibernate", "hibernate-search"]
}
]
}
}

0 comments on commit bc82128

Please sign in to comment.