From f23c1c381b42f248367ca52e39d9217489e87dc6 Mon Sep 17 00:00:00 2001 From: "tylor.spence" Date: Wed, 12 Jun 2024 10:21:31 -0400 Subject: [PATCH] correct issue with getActionButton not finding the correct item --- 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 }