mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 09:29:10 +01:00
Improve test flakyness
This commit is contained in:
parent
24b7705094
commit
fd543bcee1
1 changed files with 13 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue