diff --git a/cypress/e2e/tests/migration/applicationinventory/applications/filter.test.ts b/cypress/e2e/tests/migration/applicationinventory/applications/filter.test.ts index 8275731fa..e44bddf22 100644 --- a/cypress/e2e/tests/migration/applicationinventory/applications/filter.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/applications/filter.test.ts @@ -45,6 +45,7 @@ import { SEC, tags, archetypes, + analysis, } from "../../../../types/constants"; import * as data from "../../../../../utils/data_utils"; @@ -140,6 +141,16 @@ describe(["@tier3"], "Application inventory filter validations", function () { clickByText(button, clearAllFilters); }); + it("Analysis filter validations",function(){ + Application.open(); + getFirstAnalysisColumnValue().then((firstValue) => { + cy.log("First Analysis column value: ", firstValue); + applySearchFilter(analysis,firstValue); + cy.wait(2000); + exists(firstValue) + }); + } ); + it("Tag filter validations", function () { Application.open(); @@ -368,3 +379,17 @@ const filterApplicationsBySubstring = (): void => { clickByText(button, clearAllFilters); }; + +// this function finds the analysis status of the first application +const getFirstAnalysisColumnValue = (): Cypress.Chainable => { + return cy.get('table').then(($table) => { + const analysisColumnIndex = $table.find('th').toArray().findIndex(th => th.innerText.trim() === "Analysis"); + if (analysisColumnIndex >= 0) { + return cy.get(`tbody tr td:nth-child(${analysisColumnIndex + 1})`).first().invoke('text').then((text) => { + return text.trim(); + }); + } else { + return cy.wrap("").then(() => ""); + } + }); +}; \ No newline at end of file diff --git a/cypress/e2e/tests/migration/applicationinventory/applications/sort.test.ts b/cypress/e2e/tests/migration/applicationinventory/applications/sort.test.ts index 2b015ce58..69eaf0def 100644 --- a/cypress/e2e/tests/migration/applicationinventory/applications/sort.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/applications/sort.test.ts @@ -24,7 +24,7 @@ import { clickOnSortButton, deleteByList, } from "../../../../../utils/utils"; -import { name, tags, SortType, businessService, SEC } from "../../../../types/constants"; +import { name, tags, SortType, businessService, SEC, analysis } from "../../../../types/constants"; import * as data from "../../../../../utils/data_utils"; import { BusinessServices } from "../../../../models/migration/controls/businessservices"; import { Application } from "../../../../models/migration/applicationinventory/application"; @@ -74,6 +74,24 @@ describe(["@tier3"], "Application inventory sort validations", function () { verifySortDesc(afterDescSortList, unsortedList); }); + it("Analysis status sort validations", function () { + Application.open(); + // get unsorted list when page loads + const unsortedList = getTableColumnData(analysis); + // Sort the application inventory by Tag count in ascending order + clickOnSortButton(analysis, SortType.ascending); + cy.wait(2 * SEC); + // Verify that the application inventory table rows are displayed in ascending order + const afterAscSortList = getTableColumnData(analysis); + verifySortAsc(afterAscSortList, unsortedList); + // Sort the application inventory by analysis in descending order + clickOnSortButton(analysis, SortType.descending); + cy.wait(2000); + // Verify that the application inventory table rows are displayed in descending order + const afterDescSortList = getTableColumnData(analysis); + verifySortDesc(afterDescSortList, unsortedList); + }); + it("Business service sort validations", function () { Application.open();