Skip to content

Commit

Permalink
Update a few selectors and functions
Browse files Browse the repository at this point in the history
Signed-off-by: Nandini Chandra <[email protected]>
  • Loading branch information
nachandr committed Aug 14, 2023
1 parent 1ce723d commit aaee2f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/views/applicationinventory.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const selectBox = "input[type=checkbox]";
export const tags = "span";
export const user = "User";
export const kebabMenu = "td[class='pf-v5-c-table__td pf-v5-c-table__action'] > button";
export const topKebabMenu = "div > button[aria-label='Actions']";

//Fields related to analysis - source mode
export const sourceRepository = "input[name=sourceRepository]";
Expand Down
15 changes: 10 additions & 5 deletions cypress/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ import {
owner,
JiraType,
} from "../e2e/types/constants";
import { actionButton, date, createEntitiesCheckbox } from "../e2e/views/applicationinventory.view";
import {
actionButton,
date,
createEntitiesCheckbox,
topKebabMenu,
} from "../e2e/views/applicationinventory.view";
import {
closeSuccessNotification,
confirmButton,
Expand Down Expand Up @@ -706,7 +711,7 @@ export function application_inventory_kebab_menu(menu, tab?): void {
if (tab == "Analysis") navigate_to_application_inventory("Analysis");
else navigate_to_application_inventory();

cy.get(actionButton).eq(1).click({ force: true });
cy.get(topKebabMenu).eq(1).click({ force: true });
if (menu == "Import") {
clickByText(button, "Import");
} else {
Expand All @@ -718,7 +723,7 @@ export function application_inventory_kebab_menu(menu, tab?): void {
if (menu == "Delete") clickByText(button, menu, true);
} else {
// close menu if nothing to do
cy.get(actionButton).eq(1).click({ force: true });
cy.get(topKebabMenu).eq(1).click({ force: true });
}
});
}
Expand Down Expand Up @@ -767,7 +772,7 @@ export function verifyImportErrorMsg(errorMsg: any): void {

export function migration_wave_kebab_menu(menu): void {
// The value for menu could be one of {Export to Issue Manager, Delete}
cy.get(actionButton).eq(1).click({ force: true });
cy.get(topKebabMenu).eq(1).click({ force: true });
cy.get(commonView.kebabMenuItem).contains(menu).click({ force: true });
}

Expand Down Expand Up @@ -818,7 +823,7 @@ export function deleteApplicationTableRows(): void {
.contains(name)
.closest(trTag)
.within(() => {
click(actionButton);
click(topKebabMenu);
})
.contains(button, deleteAction)
.then(($delete_btn) => {
Expand Down

0 comments on commit aaee2f1

Please sign in to comment.