From f94cc9d833387e13df4ab52ab430249f9520725e Mon Sep 17 00:00:00 2001 From: Ramona Hartinger Date: Fri, 20 Sep 2024 07:25:48 +0200 Subject: [PATCH] test: trying to add some more error handling for clicks --- src/test/e2e/webview/WebviewTestUtils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/e2e/webview/WebviewTestUtils.ts b/src/test/e2e/webview/WebviewTestUtils.ts index 4e836e8..a823380 100644 --- a/src/test/e2e/webview/WebviewTestUtils.ts +++ b/src/test/e2e/webview/WebviewTestUtils.ts @@ -184,9 +184,13 @@ export class WebviewTestUtils { await databaseName.sendKeys(config.databaseName, Key.TAB); const button = await webView.findWebElement(By.id(config.buttonToClick)); + assert.deepStrictEqual(await button.getAttribute("id"), config.buttonToClick, "button id"); - if (await button.isEnabled()) { + try { await button.click(); + } catch { + await webView.switchToFrame(1000); + await webView.getDriver().executeScript("arguments[0].click();", button); } });