mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
Make CanUsePayjoinForTopUp more resilient
This commit is contained in:
parent
cf2c147f4f
commit
156ddd24fa
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user