mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Improve test flakyness
This commit is contained in:
@@ -119,10 +119,19 @@ namespace BTCPayServer.Tests
|
||||
var wait = new WebDriverWait(driver, SeleniumTester.ImplicitWait);
|
||||
wait.UntilJsIsReady();
|
||||
|
||||
var el = driver.FindElement(selector);
|
||||
wait.Until(d => el.Displayed && el.Enabled);
|
||||
el.Click();
|
||||
|
||||
int retriesLeft = 4;
|
||||
retry:
|
||||
try
|
||||
{
|
||||
var el = driver.FindElement(selector);
|
||||
wait.Until(d => el.Displayed && el.Enabled);
|
||||
el.Click();
|
||||
}
|
||||
catch (ElementClickInterceptedException) when (retriesLeft > 0)
|
||||
{
|
||||
retriesLeft--;
|
||||
goto retry;
|
||||
}
|
||||
wait.UntilJsIsReady();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user