Skip to content

Commit

Permalink
[RFR] Automate Bug MTA-2006
Browse files Browse the repository at this point in the history
Signed-off-by: Karishma Punwatkar <kpunwatk@redhat.com>

	modified:   cypress/e2e/models/migration/applicationinventory/analysis.ts
	new file:   cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts
	modified:   cypress/fixtures/analysis.json
  • Loading branch information
kpunwatk committed Jan 18, 2024
1 parent cd40654 commit 4b103fe
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class Analysis extends Application {

protected selectTarget(target: string[]): void {
for (let i = 0; i < target.length; i++) {
cy.get("div.pf-v5-c-empty-state__content").children("h4").contains(target[i]).click();
cy.get("div.pf-v5-c-empty-state__content").contains(target[i]).click();
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
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,
writeMavenSettingsFile,
deleteByList,
} from "../../../../../utils/utils";
import { Analysis } from "../../../../models/migration/applicationinventory/analysis";
import { SEC } from "../../../../types/constants";
import * as data from "../../../../../utils/data_utils";
import { Application } from "../../../../models/migration/applicationinventory/application";
import { AppIssue } from "../../../../types/types";
let applicationsList: Array<Analysis> = [];

describe(["@tier1"], "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);
writeMavenSettingsFile(data.getRandomWord(5), data.getRandomWord(5));
});
});
16 changes: 16 additions & 0 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,21 @@
"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": ["JBoss EAP 7"],
"appName": "deps",
"storyPoints": 24,
"issues": [
{
"name": [
"Hibernate Search 5 - Changes in indexing numeric and date values",
"WebSphere JSP engine configuration (ibm-web-ext)"
],
"affectedFiles": [202, 1]
}
]
}
}

0 comments on commit 4b103fe

Please sign in to comment.