Skip to content

Commit

Permalink
bug: correct issue with getActionButton not finding the correct item (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tylor-metrics authored Jun 13, 2024
1 parent f918d9b commit b0c30a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pageobjects/sidebar/ViewItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ export abstract class TreeItem extends ViewItem {
async getActionButton (label: string): Promise<ViewItemAction | undefined> {
const actions = await this.getActionButtons()
if (actions.length > 0) {
return actions.find((item) => item.getLabel().indexOf(label) > -1)
for (const item of actions) {
const itemLabel = item.getLabel() ?? await item.elem.getAttribute('aria-label')
if (itemLabel.indexOf(label) > -1) {
return item
}
}
}
return undefined
}
Expand Down

0 comments on commit b0c30a3

Please sign in to comment.