mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Hack selenium
This commit is contained in:
@@ -15,7 +15,7 @@ namespace BTCPayServer.Tests
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Assert.NotNull(driver.FindElement(By.ClassName("navbar-brand")));
|
Assert.NotEmpty(driver.FindElements(By.ClassName("navbar-brand")));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using OpenQA.Selenium.Chrome;
|
|||||||
using Xunit;
|
using Xunit;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using BTCPayServer.Tests.Logging;
|
using BTCPayServer.Tests.Logging;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace BTCPayServer.Tests
|
namespace BTCPayServer.Tests
|
||||||
{
|
{
|
||||||
@@ -43,7 +44,15 @@ namespace BTCPayServer.Tests
|
|||||||
Logs.Tester.LogInformation("Selenium: Using chrome driver");
|
Logs.Tester.LogInformation("Selenium: Using chrome driver");
|
||||||
}
|
}
|
||||||
Logs.Tester.LogInformation("Selenium: Browsing to " + Server.PayTester.ServerUri);
|
Logs.Tester.LogInformation("Selenium: Browsing to " + Server.PayTester.ServerUri);
|
||||||
|
int tryCount = 0;
|
||||||
|
retry:
|
||||||
Driver.Navigate().GoToUrl(Server.PayTester.ServerUri);
|
Driver.Navigate().GoToUrl(Server.PayTester.ServerUri);
|
||||||
|
if (tryCount < 10 && Driver.FindElements(By.ClassName("navbar-brand")).Count == 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
tryCount++;
|
||||||
|
goto retry;
|
||||||
|
}
|
||||||
Driver.AssertNoError();
|
Driver.AssertNoError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user