taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 32846ca06070f8a3548a9fac60122eb7ca588864
parent 6943d692a549fa4a14684292be84393616bf2e0b
Author: Florian Dold <dold@taler.net>
Date:   Mon, 28 Sep 2026 21:35:07 +0200

harness: retry Firefox heading lookups after navigation

Firefox may replace heading elements between lookup and reading their
text during checkout navigation. Retry stale element references within
the existing wait deadline, while propagating other WebDriver errors.

Diffstat:
Mpackages/taler-harness/src/integrationtests/test-wallet-web-ui-extension-integration.ts | 21++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-wallet-web-ui-extension-integration.ts b/packages/taler-harness/src/integrationtests/test-wallet-web-ui-extension-integration.ts @@ -882,13 +882,20 @@ export async function runWalletWebUiFirefoxExtensionIntegrationTest( waitHeading: async (label) => { await driver.wait( async () => { - const headings = await driver.findElements( - selenium.By.css("h1,h2,h3"), - ); - for (const heading of headings) { - const text = await heading.getText(); - if (typeof label === "string" ? text === label : label.test(text)) - return true; + try { + const headings = await driver.findElements( + selenium.By.css("h1,h2,h3"), + ); + for (const heading of headings) { + const text = await heading.getText(); + if (typeof label === "string" ? text === label : label.test(text)) + return true; + } + } catch (error) { + // Navigation can replace a heading between lookup and getText. + // Let the next poll locate the headings in the current page. + if (!(error instanceof selenium.error.StaleElementReferenceError)) + throw error; } return false; },