Skip to content

Commit

Permalink
QA-15348: Add selectByValue for choicelist dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
gflores-jahia committed Nov 5, 2024
1 parent 705db41 commit 43d04b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/page-object/moonstone/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ export class Menu extends BaseComponent {
return this;
}

/** Can be used for choicelist dropdown menu */
selectByValue(value: string): Menu {
this.get().find(`.moonstone-menuItem[data-value="${value}"]`).scrollIntoView().should('be.visible');
this.get().find(`.moonstone-menuItem[data-value="${value}"]`).trigger('click');
return this;
}

close(): Chainable<unknown> {
return cy.get(Menu.overlaySelector).click('topRight');
}
Expand Down

0 comments on commit 43d04b7

Please sign in to comment.