Skip to content

Commit b0c30a3

Browse files
bug: correct issue with getActionButton not finding the correct item (#122)
1 parent f918d9b commit b0c30a3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pageobjects/sidebar/ViewItem.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ export abstract class TreeItem extends ViewItem {
161161
async getActionButton (label: string): Promise<ViewItemAction | undefined> {
162162
const actions = await this.getActionButtons()
163163
if (actions.length > 0) {
164-
return actions.find((item) => item.getLabel().indexOf(label) > -1)
164+
for (const item of actions) {
165+
const itemLabel = item.getLabel() ?? await item.elem.getAttribute('aria-label')
166+
if (itemLabel.indexOf(label) > -1) {
167+
return item
168+
}
169+
}
165170
}
166171
return undefined
167172
}

0 commit comments

Comments
 (0)