diff --git a/cypress/e2e/models/migration/applicationinventory/analysis.ts b/cypress/e2e/models/migration/applicationinventory/analysis.ts index 0481bed1b..1394076ef 100644 --- a/cypress/e2e/models/migration/applicationinventory/analysis.ts +++ b/cypress/e2e/models/migration/applicationinventory/analysis.ts @@ -70,7 +70,10 @@ import { tabsPanel, kebabTopMenuButton, } from "../../../views/analysis.view"; -import { kebabMenu } from "../../../views/applicationinventory.view"; +import { + bulkApplicationSelectionCheckBox, + kebabMenu, +} from "../../../views/applicationinventory.view"; import { AnalysisStatuses } from "../../../types/constants"; import { RulesRepositoryFields } from "../../../types/types"; import { CustomMigrationTargetView } from "../../../views/custom-migration-target.view"; @@ -307,7 +310,7 @@ export class Analysis extends Application { public static analyzeAll(params: Analysis): void { Analysis.open(); - selectCheckBox("[name='bulk-selected-items-checkbox']"); + selectCheckBox(bulkApplicationSelectionCheckBox); params.startAnalysis(); } diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/bulk_deletion_applications.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/bulk_deletion_applications.test.ts index 8c9d14e29..a58c2bae4 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/bulk_deletion_applications.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/bulk_deletion_applications.test.ts @@ -20,11 +20,12 @@ import { createMultipleApplications, application_inventory_kebab_menu, navigate_to_application_inventory, + click, } from "../../../../../utils/utils"; import { Assessment } from "../../../../models/migration/applicationinventory/assessment"; - -let applicationList: Array = []; +import * as commonView from "../../../../views/common.view"; +import { bulkApplicationSelectionCheckBox } from "../../../../views/applicationinventory.view"; describe(["@tier2"], "Bulk deletion of applications", () => { before("Login", function () { @@ -32,8 +33,8 @@ describe(["@tier2"], "Bulk deletion of applications", () => { }); beforeEach("Interceptors", function () { - applicationList = createMultipleApplications(11); - // Interceptors + Assessment.open(100, true); + createMultipleApplications(11); cy.intercept("POST", "/hub/tag*").as("postTag"); cy.intercept("POST", "/hub/application*").as("postApplication"); cy.intercept("GET", "/hub/application*").as("getApplication"); @@ -41,24 +42,24 @@ describe(["@tier2"], "Bulk deletion of applications", () => { it("Bulk deletion of applications - Select page ", function () { navigate_to_application_inventory(); - // Click dropdown toggle button to make 'Select page' selection. - cy.get("button[aria-label='Select']").click(); + cy.get("button.pf-v5-c-menu-toggle__button").click(); cy.get("ul[role=menu] > li").contains("Select page").click(); application_inventory_kebab_menu("Delete"); + click(commonView.confirmButton); }); it("Bulk deletion of applications - Select all ", function () { navigate_to_application_inventory(); - // Click dropdown toggle button to make 'Select all' selection. - cy.get("button[aria-label='Select']").click(); + cy.get("button.pf-v5-c-menu-toggle__button").click(); cy.get("ul[role=menu] > li").contains("Select all").click(); application_inventory_kebab_menu("Delete"); + click(commonView.confirmButton); }); it("Bulk deletion of applications - Delete all apps by selecting checkbox ", function () { navigate_to_application_inventory(); - // Click 'bulk-selected-apps-checkbox'. - cy.get("input#bulk-selected-items-checkbox").check({ force: true }); + cy.get(bulkApplicationSelectionCheckBox).check({ force: true }); application_inventory_kebab_menu("Delete"); + click(commonView.confirmButton); }); }); diff --git a/cypress/e2e/views/applicationinventory.view.ts b/cypress/e2e/views/applicationinventory.view.ts index 56920ffba..477919f7f 100644 --- a/cypress/e2e/views/applicationinventory.view.ts +++ b/cypress/e2e/views/applicationinventory.view.ts @@ -44,6 +44,7 @@ export const user = "User"; export const kebabMenu = "#row-actions"; export const topKebabMenu = "#toolbar-kebab"; export const kebabMenuItem = "a.pf-v5-c-dropdown__menu-item"; +export const bulkApplicationSelectionCheckBox = "input[name='bulk-selected-items-checkbox']"; // This is on the Application imports page. export const sideKebabMenuImports = "button[aria-label='Kebab toggle']";