forked from konveyor/tackle-ui-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.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,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); | ||
}); | ||
}); |
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