mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Improve test flakyness
This commit is contained in:
@@ -119,10 +119,19 @@ namespace BTCPayServer.Tests
|
|||||||
var wait = new WebDriverWait(driver, SeleniumTester.ImplicitWait);
|
var wait = new WebDriverWait(driver, SeleniumTester.ImplicitWait);
|
||||||
wait.UntilJsIsReady();
|
wait.UntilJsIsReady();
|
||||||
|
|
||||||
var el = driver.FindElement(selector);
|
int retriesLeft = 4;
|
||||||
wait.Until(d => el.Displayed && el.Enabled);
|
retry:
|
||||||
el.Click();
|
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();
|
wait.UntilJsIsReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user