Skip to content

Commit

Permalink
adapt bulk-deletion-test
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Brugarolas <[email protected]>
  • Loading branch information
abrugaro committed Oct 16, 2023
1 parent db9335e commit f8c99f3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
7 changes: 5 additions & 2 deletions cypress/e2e/models/migration/applicationinventory/analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,46 @@ import {
createMultipleApplications,
application_inventory_kebab_menu,
navigate_to_application_inventory,
click,
} from "../../../../../utils/utils";

import { Assessment } from "../../../../models/migration/applicationinventory/assessment";

let applicationList: Array<Assessment> = [];
import * as commonView from "../../../../views/common.view";
import { bulkApplicationSelectionCheckBox } from "../../../../views/applicationinventory.view";

describe(["@tier2"], "Bulk deletion of applications", () => {
before("Login", function () {
login();
});

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");
});

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);
});
});
1 change: 1 addition & 0 deletions cypress/e2e/views/applicationinventory.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']";

Expand Down

0 comments on commit f8c99f3

Please sign in to comment.