mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-31 11:54:24 +01:00
Make CanUsePayjoinForTopUp more resilient
This commit is contained in:
@@ -49,12 +49,14 @@ namespace BTCPayServer.Tests
|
||||
}
|
||||
|
||||
// Sometimes, selenium is flaky...
|
||||
public static IWebElement FindElementUntilNotStaled(this IWebDriver driver, By by)
|
||||
public static IWebElement FindElementUntilNotStaled(this IWebDriver driver, By by, Action<IWebElement> act)
|
||||
{
|
||||
retry:
|
||||
try
|
||||
{
|
||||
return driver.FindElement(by);
|
||||
var el = driver.FindElement(by);
|
||||
act(el);
|
||||
return el;
|
||||
}
|
||||
catch (StaleElementReferenceException)
|
||||
{
|
||||
|
||||
@@ -255,8 +255,8 @@ namespace BTCPayServer.Tests
|
||||
s.Driver.FindElement(By.Id("bip21parse")).Click();
|
||||
s.Driver.SwitchTo().Alert().SendKeys(bip21);
|
||||
s.Driver.SwitchTo().Alert().Accept();
|
||||
s.Driver.FindElementUntilNotStaled(By.Id("Outputs_0__Amount")).Clear();
|
||||
s.Driver.FindElementUntilNotStaled(By.Id("Outputs_0__Amount")).SendKeys("0.023");
|
||||
s.Driver.FindElementUntilNotStaled(By.Id("Outputs_0__Amount"), we => we.Clear());
|
||||
s.Driver.FindElementUntilNotStaled(By.Id("Outputs_0__Amount"), we => we.SendKeys("0.023"));
|
||||
|
||||
s.Driver.FindElement(By.Id("SignTransaction")).Click();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user