From de04241bdc3e36b833f5933fa2d0cd8f6ead01af Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 19 Oct 2023 10:41:23 -0500 Subject: [PATCH] Remove copy_assessment directory (#755) Signed-off-by: Nandini Chandra --- .../copy_assessment/copy_assessment.test.ts | 138 -------------- .../assessment/copy_assessment/filter.test.ts | 178 ------------------ .../copy_assessment/pagination.test.ts | 119 ------------ .../assessment/copy_assessment/sort.test.ts | 91 --------- 4 files changed, 526 deletions(-) delete mode 100644 cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts delete mode 100644 cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/filter.test.ts delete mode 100644 cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/pagination.test.ts delete mode 100644 cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/sort.test.ts diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts deleted file mode 100644 index 5ae401811..000000000 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/copy_assessment.test.ts +++ /dev/null @@ -1,138 +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, - createMultipleStakeholders, - createMultipleApplications, - deleteByList, - selectAssessmentApplications, - closeModalWindow, -} from "../../../../../../utils/utils"; - -import { Stakeholders } from "../../../../../models/migration/controls/stakeholders"; -import { SEC, trTag } from "../../../../../types/constants"; -import { copy, selectBox } from "../../../../../views/applicationinventory.view"; -import { Assessment } from "../../../../../models/migration/applicationinventory/assessment"; - -let stakeholdersList: Array = []; -let applicationList: Array = []; - -describe(["@tier2"], "Copy assessment and review tests", () => { - before("Login and Create Test Data", function () { - login(); - - // Create data - stakeholdersList = createMultipleStakeholders(1); - applicationList = createMultipleApplications(4); - - // Verify copy assessment is not enabled until assessment is done - applicationList[0].verifyCopyAssessmentDisabled(); - - // Perform assessment of application - applicationList[0].perform_assessment("low", [stakeholdersList[0].name]); - applicationList[0].verifyStatus("assessment", "Completed"); - - // Perform application review - applicationList[0].perform_review("low"); - applicationList[0].verifyStatus("review", "Completed"); - }); - - beforeEach("Interceptors", function () { - // Interceptors - cy.intercept("GET", "/hub/application*").as("getApplication"); - }); - - it("Copy assessment to self", function () { - // Copy assessment to self, checkbox should be disabled - applicationList[0].openCopyAssessmentModel(); - cy.get(".pf-m-compact> tbody > tr > td") - .contains(applicationList[0].name) - .parent(trTag) - .within(() => { - cy.get(selectBox).should("be.disabled"); - cy.wait(2 * SEC); - }); - closeModalWindow(); - }); - - it("Copy button not enabled until one app is selected", function () { - // Copy assessment to self, should be disabled - applicationList[0].openCopyAssessmentModel(); - cy.get(copy).should("be.disabled"); - applicationList[0].selectApps(applicationList); - cy.get(copy).should("not.be.disabled"); - closeModalWindow(); - }); - - it("Copy assessment to more than one application and discard assessment", function () { - // Verify copy assessment is not enabled until assessment is done - applicationList[1].verifyCopyAssessmentDisabled(); - - // Perform copy assessment of all the applications - applicationList[0].copy_assessment(applicationList); - - // Verify that all the applications were assessed - for (let i = 1; i < applicationList.length; i++) { - applicationList[i].verifyStatus("assessment", "Completed"); - applicationList[i].discard_assessment(); - applicationList[i].verifyStatus("assessment", "Not started"); - } - }); - - it("Copy assessment,review and discard assessment, review", function () { - // Perform copy assessment and review of all the applications - applicationList[0].copy_assessment_review(applicationList); - - // Verify that all the applications were assessed - for (let i = 1; i < applicationList.length; i++) { - applicationList[i].verifyStatus("assessment", "Completed"); - applicationList[i].verifyStatus("review", "Completed"); - - // Discard assessment and review - applicationList[i].discard_assessment(); - applicationList[i].verifyStatus("assessment", "Not started"); - applicationList[i].verifyStatus("review", "Not started"); - } - }); - - it("Copy assessment select options validations", function () { - applicationList[0].openCopyAssessmentModel(); - - // select 10 items per page - applicationList[0].selectItemsPerPage(10); - cy.wait(SEC); - - // Select all the applications on page - selectAssessmentApplications("page"); - cy.get(copy).should("be.visible").should("not.be.disabled"); - - // Select all applications - selectAssessmentApplications("all"); - cy.get(copy).should("be.visible").should("not.be.disabled"); - - // Deselect all applications - selectAssessmentApplications("none"); - cy.get(copy).should("be.visible").should("be.disabled"); - closeModalWindow(); - }); - - after("Perform test data clean up", function () { - deleteByList(stakeholdersList); - deleteByList(applicationList); - }); -}); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/filter.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/filter.test.ts deleted file mode 100644 index 34c8c33bc..000000000 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/filter.test.ts +++ /dev/null @@ -1,178 +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, - createMultipleStakeholders, - createMultipleBusinessServices, - createMultipleTags, - createApplicationObjects, - applySearchFilter, - clickByText, - deleteByList, -} from "../../../../../../utils/utils"; - -import { Stakeholders } from "../../../../../models/migration/controls/stakeholders"; -import { - businessService, - button, - clearAllFilters, - description, - name, - tag, -} from "../../../../../types/constants"; -import { BusinessServices } from "../../../../../models/migration/controls/businessservices"; -import { Tag } from "../../../../../models/migration/controls/tags"; -import { closeButton } from "../../../../../views/common.view"; -import { copyAssessmentTableTd } from "../../../../../views/applicationinventory.view"; -import { Assessment } from "../../../../../models/migration/applicationinventory/assessment"; - -var stakeholdersList: Array = []; -var businessservicesList: Array = []; -var applicationList: Array = []; -var tagList: Array = []; -var invalidSearchInput = "11111"; - -describe(["@tier2"], "Copy assessment filter tests", () => { - before("Login and Create Test Data", function () { - login(); - - // Create data - stakeholdersList = createMultipleStakeholders(1); - businessservicesList = createMultipleBusinessServices(2); - tagList = createMultipleTags(2); - applicationList = createApplicationObjects(4); - - // Assign same business service to application number 2 and 3 - applicationList[1].business = businessservicesList[0].name; - applicationList[2].business = businessservicesList[0].name; - - // Assign unique description to application number 3 - applicationList[2].description = "Description for test application"; - - // Assign tag to application number 4 - applicationList[3].tags = [tagList[0].name]; - - for (let i = 0; i < applicationList.length; i++) { - applicationList[i].create(); - } - - // Perform assessment of application 1 - applicationList[0].perform_assessment("low", [stakeholdersList[0].name]); - applicationList[0].verifyStatus("assessment", "Completed"); - }); - - beforeEach("Interceptors", function () { - // Interceptors - cy.intercept("GET", "/hub/application*").as("getApplication"); - }); - - it("Name filter validations", function () { - // Open the copy assessment model for application 1 - applicationList[0].openCopyAssessmentModel(); - - // Enter an existing application name and assert - var validSearchInput = applicationList[1].name; - applySearchFilter(name, validSearchInput, true, 1); - cy.wait(2000); - cy.get(copyAssessmentTableTd).should("contain", applicationList[1].name); - clickByText(button, clearAllFilters); - - // Enter a non-existing application name and apply it as search filter - applySearchFilter(name, invalidSearchInput, true, 1); - cy.wait(3000); - - // Assert that no search results are found - cy.get("h2").contains("No data available"); - - // Clear all filters and close model - clickByText(button, clearAllFilters); - cy.get(closeButton).click(); - }); - - it("Description filter validations", function () { - // This test fails because of this Tackle 2.x issue - https://issues.redhat.com/browse/TACKLE-822 - // Open the copy assessment model for application 1 - applicationList[0].openCopyAssessmentModel(); - - // Enter an existing application description and assert - var validSearchInput = applicationList[2].description; - applySearchFilter(description, validSearchInput, true, 1); - cy.wait(2000); - cy.get(copyAssessmentTableTd).should("contain", applicationList[2].name); - clickByText(button, clearAllFilters); - - // Enter a non-existing description and apply it as search filter - applySearchFilter(description, invalidSearchInput, true, 1); - cy.wait(3000); - - // Assert that no search results are found - cy.get("h2").contains("No data available"); - - // Clear all filters and close model - clickByText(button, clearAllFilters); - cy.get(closeButton).click(); - }); - - it("Bussiness service filter validations", function () { - // Open the copy assessment model for application 1 - applicationList[0].openCopyAssessmentModel(); - - // Enter an existing business seervice linked to application and assert - var validSearchInput = applicationList[1].business; - applySearchFilter(businessService, validSearchInput, true, 1); - cy.wait(2000); - cy.get(copyAssessmentTableTd) - .should("contain", applicationList[1].name) - .and("contain", applicationList[2].name); - - // Clear all filters and close model - clickByText(button, clearAllFilters); - cy.get(closeButton).click(); - }); - - it("Tag filter validations", function () { - // This test fails because of this Tackle 2.x issue - https://issues.redhat.com/browse/TACKLE-822 - // Open the copy assessment model for application 1 - applicationList[0].openCopyAssessmentModel(); - - // Enter a tag linked to application and assert - var validSearchInput = applicationList[3].tags[0]; - applySearchFilter(tag, validSearchInput, true, 1); - cy.wait(2000); - cy.get(copyAssessmentTableTd).should("contain", applicationList[3].name); - clickByText(button, clearAllFilters); - - // Enter a tag name not linked to any application and apply it as search filter - applySearchFilter(tag, tagList[1].name, true, 1); - cy.wait(3000); - - // Assert that no search results are found - cy.get("h2").contains("No data available"); - - // Clear all filters and close model - clickByText(button, clearAllFilters); - cy.get(closeButton).click(); - }); - - after("Perform test data clean up", function () { - deleteByList(applicationList); - deleteByList(businessservicesList); - deleteByList(tagList); - deleteByList(stakeholdersList); - }); -}); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/pagination.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/pagination.test.ts deleted file mode 100644 index 65308c996..000000000 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/pagination.test.ts +++ /dev/null @@ -1,119 +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, - createMultipleStakeholders, - createMultipleApplications, - click, - deleteByList, -} from "../../../../../../utils/utils"; -import { - copyAssessmentTableTr, - copyAssessmentPagination, -} from "../../../../../views/applicationinventory.view"; -import * as commonView from "../../../../../views/common.view"; -import { Stakeholders } from "../../../../../models/migration/controls/stakeholders"; -import { Assessment } from "../../../../../models/migration/applicationinventory/assessment"; -import { closeModal } from "../../../../../views/assessment.view"; - -var stakeholdersList: Array = []; -var applicationList: Array = []; - -describe(["@tier2"], "Assessment pagination validations", function () { - before("Login and create test data", function () { - login(); - - // Create data - stakeholdersList = createMultipleStakeholders(1); - applicationList = createMultipleApplications(11); - - // Perform assessment of application - applicationList[0].perform_assessment("low", [stakeholdersList[0].name]); - applicationList[0].verifyStatus("assessment", "Completed"); - }); - - it("Navigation button validations", function () { - // Navigate to Application assessment copy dialogue - applicationList[0].openCopyAssessmentModel(); - cy.wait(2000); - - // select 10 items per page - applicationList[0].selectItemsPerPage(10); - cy.wait(2000); - - // Verify next buttons are enabled as there are more than 10 rows present - cy.get(copyAssessmentPagination) - .find(commonView.nextPageButton) - .each(($nextBtn) => { - cy.wrap($nextBtn).should("not.be.disabled"); - }); - - // Verify that previous buttons are disabled being on the first page - cy.get(copyAssessmentPagination) - .find(commonView.prevPageButton) - .each(($previousBtn) => { - cy.wrap($previousBtn).should("be.disabled"); - }); - - // Navigate to next page - cy.get(copyAssessmentPagination).find(commonView.nextPageButton).click(); - cy.wait(2000); - - // Verify that previous buttons are enabled after moving to next page - cy.get(copyAssessmentPagination) - .find(commonView.prevPageButton) - .each(($previousBtn) => { - cy.wrap($previousBtn).should("not.be.disabled"); - }); - }); - - it("Items per page validations", function () { - // Navigate to Application assessment copy dialogue - applicationList[0].openCopyAssessmentModel(); - cy.wait(2000); - - // Select 10 items per page - applicationList[0].selectItemsPerPage(10); - cy.wait(2000); - - // Verify that only 10 items are displayed - cy.get(copyAssessmentTableTr) - .find("td[data-label=Name]") - .then(($rows) => { - cy.wrap($rows.length).should("eq", 10); - }); - - // Select 20 items per page - applicationList[0].selectItemsPerPage(20); - cy.wait(2000); - - // Verify that items less than or equal to 20 and greater than 10 are displayed - cy.get(copyAssessmentTableTr) - .find("td[data-label=Name]") - .then(($rows) => { - cy.wrap($rows.length).should("be.lte", 20).and("be.gt", 10); - }); - - click(closeModal, false, true); - }); - - after("Perform test data clean up", function () { - deleteByList(applicationList); - deleteByList(stakeholdersList); - }); -}); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/sort.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/sort.test.ts deleted file mode 100644 index 2aab9d429..000000000 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/copy_assessment/sort.test.ts +++ /dev/null @@ -1,91 +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, - sortAscCopyAssessmentTable, - sortDescCopyAssessmentTable, - verifySortAsc, - verifySortDesc, - getColumnDataforCopyAssessmentTable, - createMultipleStakeholders, - createMultipleStakeholderGroups, - createMultipleApplications, - deleteByList, - selectItemsPerPage, -} from "../../../../../../utils/utils"; -import { name } from "../../../../../types/constants"; -import { Stakeholders } from "../../../../../models/migration/controls/stakeholders"; -import { Stakeholdergroups } from "../../../../../models/migration/controls/stakeholdergroups"; -import { Assessment } from "../../../../../models/migration/applicationinventory/assessment"; -import { modal } from "../../../../../views/common.view"; - -let stakeholdersList: Array = []; -let stakeholderGroupsList: Array = []; -let applicationsList: Array = []; - -describe(["@tier2"], "Copy assessment and review tests", () => { - before("Login and Create Test Data", function () { - login(); - // Create data - stakeholdersList = createMultipleStakeholders(1); - stakeholderGroupsList = createMultipleStakeholderGroups(1, stakeholdersList); - applicationsList = createMultipleApplications(4); - - // Perform assessment of application - applicationsList[0].perform_assessment("low", [stakeholdersList[0].name]); - applicationsList[0].verifyStatus("assessment", "Completed"); - }); - - beforeEach("Interceptors", function () { - // Interceptors - cy.intercept("GET", "/hub/application*").as("getApplication"); - }); - - it("Application name sort validations", function () { - // Navigate to application inventory page and open copy assessment page - applicationsList[0].openCopyAssessmentModel(); - - cy.get(modal) - .eq(0) - .within((_) => selectItemsPerPage(100)); - - // get unsorted list when page loads - const unsortedList = getColumnDataforCopyAssessmentTable(name); - - // Sort the applications groups by name in ascending order - sortAscCopyAssessmentTable(name); - - // Verify that the applications rows are displayed in ascending order - const afterAscSortList = getColumnDataforCopyAssessmentTable(name); - verifySortAsc(afterAscSortList, unsortedList); - - // Sort the applications by name in descending order - sortDescCopyAssessmentTable(name); - - // Verify that the applications are displayed in descending order - const afterDescSortList = getColumnDataforCopyAssessmentTable(name); - verifySortDesc(afterDescSortList, unsortedList); - }); - - after("Perform test data clean up", function () { - Assessment.open(100, true); - deleteByList(applicationsList); - deleteByList(stakeholdersList); - deleteByList(stakeholderGroupsList); - }); -});