diff --git a/cypress/e2e/models/migration/applicationinventory/reportPage.ts b/cypress/e2e/models/migration/applicationinventory/reportPage.ts deleted file mode 100644 index c2c82181f..000000000 --- a/cypress/e2e/models/migration/applicationinventory/reportPage.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { SEC } from "../../../types/constants"; -import { clickByText } from "../../../../utils/utils"; -import { - dropdownMenu, - selectFilter, - inputTextField, - selectSortBy, -} from "../../../views/reportPage.view"; - -export class Report { - applyFilter(filterName: string, searchText: string): void { - // Select the filter by filterName - cy.get(selectFilter).within(() => { - cy.get("div.input-group-btn").eq(0).click(); - cy.get(dropdownMenu).within(() => { - clickByText("a", filterName); - }); - }); - // Enter the search text and Enter - cy.get(inputTextField).eq(0).clear().type(searchText).type("{enter}"); - cy.wait(2 * SEC); - } - - applySortAction(sortbyName: string) { - // Select the sort-by options - cy.get(selectSortBy).click(); - cy.get(dropdownMenu).within(() => { - clickByText("a", sortbyName); - }); - } - - matchAppsOrder(): void { - cy.get("div[class='fileName'] > a").then(($elements) => { - const apps = Array.from($elements, (element) => element.innerText); - expect(apps).to.deep.eq(apps.sort()); - }); - } - - matchStoryPointsOrder(): void { - cy.get("span[class='points']").then(($elements) => { - const points = Array.from($elements, (element) => element.innerText); - expect(points).to.deep.eq(points.sort()); - }); - } -} diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/load_analysis.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/load_analysis.test.ts similarity index 100% rename from cypress/e2e/tests/migration/applicationinventory/analysis/load_analysis.ts rename to cypress/e2e/tests/migration/applicationinventory/analysis/load_analysis.test.ts diff --git a/cypress/e2e/tests/migration/applicationinventory/reports/filter.test.ts b/cypress/e2e/tests/migration/applicationinventory/reports/filter.test.ts deleted file mode 100644 index 13f044395..000000000 --- a/cypress/e2e/tests/migration/applicationinventory/reports/filter.test.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* -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. -*/ -/// - -import { - login, - getRandomApplicationData, - getRandomAnalysisData, - resetURL, - deleteByList, -} from "../../../../../utils/utils"; -import * as data from "../../../../../utils/data_utils"; -import { Analysis } from "../../../../models/migration/applicationinventory/analysis"; -import { CredentialsMaven } from "../../../../models/administration/credentials/credentialsMaven"; -import { CredentialsSourceControlUsername } from "../../../../models/administration/credentials/credentialsSourceControlUsername"; -import { CredentialType, UserCredentials } from "../../../../types/constants"; -import { Report } from "../../../../models/migration/applicationinventory/reportPage"; -import { name, tag } from "../../../../types/constants"; -import { clearAllFilters } from "../../../../views/reportPage.view"; -let source_credential; -let maven_credential; -const dependencies = "deps"; -let applicationsList: Analysis[] = []; -describe(["@tier2"], "Report Page Filter Validation", () => { - const report = new Report(); - before("Login", function () { - login(); - source_credential = new CredentialsSourceControlUsername( - data.getRandomCredentialsData( - CredentialType.sourceControl, - UserCredentials.usernamePassword, - true - ) - ); - source_credential.create(); - maven_credential = new CredentialsMaven( - data.getRandomCredentialsData(CredentialType.maven, "None", true) - ); - maven_credential.create(); - }); - - beforeEach("Load Data", function () { - cy.fixture("application").then(function (appData) { - this.appData = appData; - }); - cy.fixture("analysis").then(function (analysisData) { - this.analysisData = analysisData; - }); - - cy.intercept("POST", "/hub/application*").as("postApplication"); - cy.intercept("GET", "/hub/application*").as("getApplication"); - }); - - it("Filter by application/dependency name on anaysis report page", function () { - const application = new Analysis( - getRandomApplicationData("tackleTestApp_Source+dependencies", { - sourceData: this.appData["tackle-testapp-git"], - }), - getRandomAnalysisData(this.analysisData["source+dep_analysis_on_tackletestapp"]) - ); - application.create(); - applicationsList.push(application); - cy.wait("@getApplication"); - cy.wait(2000); - application.manageCredentials(source_credential.name, maven_credential.name); - application.analyze(); - application.verifyAnalysisStatus("Completed"); - application.openReport(); - - // Enter an existing display name substring and assert that appName is listed in filter results - report.applyFilter(name, application.appName.substring(0, 6)); - cy.get("[role=main]").should("contain.text", application.appName); - cy.get(clearAllFilters).click(); - - // Enter an existing display exact name and assert that application dependency is listed in filter results - report.applyFilter(name, "deps"); - cy.get("[role=main]").should("contain.text", dependencies); - cy.get(clearAllFilters).click(); - - // Enter a non-existing Name and apply it as search filter - let invalidSearchInput = "SomeInvalidInput"; - report.applyFilter(name, invalidSearchInput); - - // Assert that no search results are found - cy.get("span[id=count-results]").should("have.text", "0"); - cy.get(clearAllFilters).click(); - }); - - it("Filter by application tag on analysis report page", function () { - const application = new Analysis( - getRandomApplicationData("tackleTestApp_Source+dependencies", { - sourceData: this.appData["tackle-testapp-git"], - }), - getRandomAnalysisData(this.analysisData["source+dep_analysis_on_tackletestapp"]) - ); - application.create(); - applicationsList.push(application); - cy.wait("@getApplication"); - cy.wait(2000); - application.manageCredentials(source_credential.name, maven_credential.name); - application.analyze(); - application.verifyAnalysisStatus("Completed"); - application.openReport(); - - // Enter an existing Tag and assert appName is listed in filter results - report.applyFilter(tag, "Servlet"); - cy.get("[role=main]").should("contain.text", application.appName); - cy.get(clearAllFilters).click(); - - // Enter an existing Tag and assert that application dependency is listed in filter results - report.applyFilter(tag, "JDBC"); - cy.get("[role=main]").should("contain.text", dependencies); - cy.get(clearAllFilters).click(); - - // Enter a non-existing tag and apply it as search filter - let invalidSearchInput = "SomeInvalidInput0"; - report.applyFilter(tag, invalidSearchInput); - - // Assert that no search results are found - cy.get("span[id=count-results]").should("have.text", "0"); - cy.get(clearAllFilters).click(); - }); - - afterEach("Reset url", function () { - // Reset URL from report page to web UI - resetURL(); - }); - - after("Perform test data clean up", function () { - deleteByList(applicationsList); - }); -}); diff --git a/cypress/e2e/tests/migration/applicationinventory/reports/sort.test.ts b/cypress/e2e/tests/migration/applicationinventory/reports/sort.test.ts deleted file mode 100644 index 8435afc96..000000000 --- a/cypress/e2e/tests/migration/applicationinventory/reports/sort.test.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* -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. -*/ -/// - -import { - login, - getRandomApplicationData, - getRandomAnalysisData, - resetURL, - deleteByList, -} from "../../../../../utils/utils"; -import { Analysis } from "../../../../models/migration/applicationinventory/analysis"; -import { Report } from "../../../../models/migration/applicationinventory/reportPage"; -import { CredentialsSourceControlUsername } from "../../../../models/administration/credentials/credentialsSourceControlUsername"; -import * as data from "../../../../../utils/data_utils"; -import { CredentialType, UserCredentials } from "../../../../types/constants"; -import { CredentialsMaven } from "../../../../models/administration/credentials/credentialsMaven"; - -let applicationsList: Analysis[] = []; - -describe(["@tier2"], "Report Page's Sort Validation", () => { - const report = new Report(); - let source_credential; - let maven_credential; - - before("Login", function () { - login(); - - source_credential = new CredentialsSourceControlUsername( - data.getRandomCredentialsData( - CredentialType.sourceControl, - UserCredentials.usernamePassword, - true - ) - ); - source_credential.create(); - - maven_credential = new CredentialsMaven( - data.getRandomCredentialsData(CredentialType.maven, "None", true) - ); - maven_credential.create(); - }); - - beforeEach("Load Data", function () { - cy.fixture("application").then(function (appData) { - this.appData = appData; - }); - cy.fixture("analysis").then(function (analysisData) { - this.analysisData = analysisData; - }); - - cy.intercept("POST", "/hub/application*").as("postApplication"); - cy.intercept("GET", "/hub/application*").as("getApplication"); - }); - - it("Sort by Name validation test using Upload Binary Analysis", function () { - const application: any = new Analysis( - getRandomApplicationData("Source+dependencies", { - sourceData: this.appData["daytrader-app"], - }), - getRandomAnalysisData(this.analysisData["source+dep_analysis_on_daytrader-app"]) - ); - application.create(); - applicationsList.push(application); - cy.wait("@getApplication"); - cy.wait(2000); - application.analyze(); - application.verifyAnalysisStatus("Completed"); - application.openReport(); - - // Sort the Application by Name - report.applySortAction("Name"); - cy.wait(2000); - report.matchAppsOrder(); - }); - - it("Sort by Story points test using Upload Binary Analysis", function () { - const application: any = new Analysis( - getRandomApplicationData("sort_Source+dependencies", { - sourceData: this.appData["daytrader-app"], - }), - getRandomAnalysisData(this.analysisData["source+dep_analysis_on_daytrader-app"]) - ); - application.create(); - applicationsList.push(application); - cy.wait("@getApplication"); - cy.wait(2000); - application.analyze(); - application.verifyAnalysisStatus("Completed"); - application.openReport(); - - // Sort the Application by Story points - report.applySortAction("Story Points"); - cy.wait(2000); - report.matchStoryPointsOrder(); - }); - - afterEach("Reset url", function () { - resetURL(); - }); - - after("Perform test data clean up", function () { - deleteByList(applicationsList); - }); -}); diff --git a/cypress/e2e/tests/rbac/disable_keycloak.test.ts b/cypress/e2e/tests/rbac/disable_keycloak.test.ts deleted file mode 100644 index 683cb67ed..000000000 --- a/cypress/e2e/tests/rbac/disable_keycloak.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* -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. -*/ -/// - -import * as data from "../../../utils/data_utils"; -import { getRandomApplicationData, login, patchTackleCR } from "../../../utils/utils"; -import { Stakeholders } from "../../models/migration/controls/stakeholders"; -import { Assessment } from "../../models/migration/applicationinventory/assessment"; -let application = new Assessment(getRandomApplicationData()); -let stakeholder = new Stakeholders(data.getEmail(), data.getFullName()); - -describe(["@tier4"], "Perform certain operations after disabling Keycloak", function () { - // Automates Polarion MTA-293 - before("Disable Keycloak", function () { - login(); - // Skipping patching Tackle CR due to a bug MTA-1152 - // patchTackleCR("keycloak", false); - - stakeholder.create(); - application.create(); - }); - - beforeEach("Load data", function () { - // RBAC rules for architect are applicable to admin as well - cy.fixture("rbac").then(function (rbacRules) { - this.rbacRules = rbacRules["architect"]; - }); - }); - - it.skip("Bug MTA-1152: Auth disabled, Perform application assessment", function () { - application.perform_assessment("low", [stakeholder.name]); - cy.wait(1000); - application.verifyStatus("assessment", "Completed"); - }); - - it.skip("Bug MTA-1152: Auth disabled, Verify presence of Review application button", function () { - // Application.validateReviewButton(this.rbacRules); - }); - - after("Re-enable Keycloak", function () { - // Skipping patching Tackle CR due to a bug MTA-1152 - // patchTackleCR("keycloak", true); - login(); - - application.delete(); - stakeholder.delete(); - }); -});