Make selenium work on CI

This commit is contained in:
nicolas.dorier
2019-05-14 16:06:51 +09:00
parent 522d745883
commit a1f1e90626
3 changed files with 12 additions and 3 deletions

View File

@@ -34,7 +34,14 @@ namespace BTCPayServer.Tests
ChromeOptions options = new ChromeOptions();
options.AddArguments("headless"); // Comment to view browser
options.AddArguments("window-size=1200x600"); // Comment to view browser
Driver = new ChromeDriver(Directory.GetCurrentDirectory(), options);
if (Server.PayTester.InContainer)
{
Driver = new OpenQA.Selenium.Remote.RemoteWebDriver(new Uri("http://selenium:4444/wd/hub"), options);
}
else
{
Driver = new ChromeDriver(Directory.GetCurrentDirectory(), options);
}
Driver.Navigate().GoToUrl(Server.PayTester.ServerUri);
}