Skip to content

Commit

Permalink
[RFR] Added sorting test for single app issues (#922)
Browse files Browse the repository at this point in the history
* Added sorting test for single app issues

Signed-off-by: Igor Braginsky <[email protected]>

* Updated tests to make them shorter

Signed-off-by: Igor Braginsky <[email protected]>

* Some fixes by Shveta's request

Signed-off-by: Igor Braginsky <[email protected]>

---------

Signed-off-by: Igor Braginsky <[email protected]>
  • Loading branch information
ibragins authored Jan 18, 2024
1 parent b3ae85e commit c24da17
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import { Issues } from "../../../../../models/migration/dynamic-report/issues/is

describe(["@tier2"], "Issues sort validations", function () {
let application: Analysis;
const sortByList = ["Issue", "Category", "Effort", "Affected applications"];

before("Load data, create Analysis instance and run analysis", function () {
before("Load data", function () {
login();
cy.fixture("application").then(function (appData) {
this.appData = appData;
Expand All @@ -23,8 +24,7 @@ describe(["@tier2"], "Issues sort validations", function () {
cy.intercept("GET", "/hub/application*").as("getApplication");
});

it("BUG MTA-2067 - Source Analysis on daytrader app and its issues sorting validation", function () {
// Create Analysis instance in before hook
it("Creating data for sorting", function () {
application = new Analysis(
getRandomApplicationData("daytrader-app", {
sourceData: this.appData["daytrader-app"],
Expand All @@ -36,23 +36,13 @@ describe(["@tier2"], "Issues sort validations", function () {
application.analyze();
cy.wait(2 * SEC);
application.verifyAnalysisStatus("Completed");
Issues.openList();
validateSortBy("Issue");
});

it("Sort issues by category", function () {
Issues.openList();
validateSortBy("Category");
});

it("Sort issues by effort", function () {
Issues.openList();
validateSortBy("Effort");
});

it("Sort issues by affected applications", function () {
Issues.openList();
validateSortBy("Affected applications");
sortByList.forEach((column) => {
it(`${column == "Issue" ? "BUG MTA-2067 - " : ""}Sort issues by ${column}`, function () {
Issues.openList();
validateSortBy(column);
});
});

after("Perform test data clean up", function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Analysis } from "../../../../../models/migration/applicationinventory/analysis";
import {
getRandomAnalysisData,
getRandomApplicationData,
login,
validateSortBy,
} from "../../../../../../utils/utils";
import { SEC } from "../../../../../types/constants";
import { Issues } from "../../../../../models/migration/dynamic-report/issues/issues";

describe(["@tier2"], "Issues sort validations", function () {
let application: Analysis;
const sortByList = ["Issue", "Category", "Effort", "Affected files"];

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

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

it("Creating data for sorting", function () {
application = new Analysis(
getRandomApplicationData("daytrader-app", {
sourceData: this.appData["daytrader-app"],
}),
getRandomAnalysisData(this.analysisData["source+dep_analysis_on_daytrader-app"])
);
application.create();
cy.wait("@getApplication");
application.analyze();
cy.wait(2 * SEC);
application.verifyAnalysisStatus("Completed");
});

sortByList.forEach((column) => {
it(`${
column == "Issue" ? "BUG MTA-2067 - " : ""
}Sort single application issues by ${column}`, function () {
Issues.openSingleApplication(application.name);
validateSortBy(column);
});
});

after("Perform test data clean up", function () {
Analysis.open(true);
application.delete();
});
});

0 comments on commit c24da17

Please sign in to comment.