From b0c30a3a1044730a9afdf447be7f3b70b2eeb5e5 Mon Sep 17 00:00:00 2001 From: tylor-metrics <138033970+tylor-metrics@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:58:54 -0400 Subject: [PATCH] bug: correct issue with getActionButton not finding the correct item (#122) --- src/pageobjects/sidebar/ViewItem.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pageobjects/sidebar/ViewItem.ts b/src/pageobjects/sidebar/ViewItem.ts index d54a1b17..ba466a9a 100644 --- a/src/pageobjects/sidebar/ViewItem.ts +++ b/src/pageobjects/sidebar/ViewItem.ts @@ -161,7 +161,12 @@ export abstract class TreeItem extends ViewItem { async getActionButton (label: string): Promise { 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 }