diff --git a/BTCPayServer.Tests/BTCPayServer.Tests.csproj b/BTCPayServer.Tests/BTCPayServer.Tests.csproj index f87871345..87929b282 100644 --- a/BTCPayServer.Tests/BTCPayServer.Tests.csproj +++ b/BTCPayServer.Tests/BTCPayServer.Tests.csproj @@ -21,7 +21,6 @@ - diff --git a/BTCPayServer.Tests/README.md b/BTCPayServer.Tests/README.md index a12e44bbb..dd66ebc7f 100644 --- a/BTCPayServer.Tests/README.md +++ b/BTCPayServer.Tests/README.md @@ -74,5 +74,3 @@ If you still have issues, try to restart docker. Run `dotnet user-secrets set RunSeleniumInBrowser true` to run tests in browser. To switch back to headless mode (recommended) you can run `dotnet user-secrets remove RunSeleniumInBrowser`. - -To run the tests using Firefox (default is Chrome), run `dotnet user-secrets set RunSeleniumInFirefox true`. diff --git a/BTCPayServer.Tests/SeleniumTester.cs b/BTCPayServer.Tests/SeleniumTester.cs index ea3cce819..e34f43dca 100644 --- a/BTCPayServer.Tests/SeleniumTester.cs +++ b/BTCPayServer.Tests/SeleniumTester.cs @@ -17,7 +17,6 @@ using Microsoft.Extensions.Configuration; using NBitcoin; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; -using OpenQA.Selenium.Firefox; using Xunit; namespace BTCPayServer.Tests @@ -45,36 +44,21 @@ namespace BTCPayServer.Tests // Run `dotnet user-secrets set RunSeleniumInBrowser true` to run tests in browser var runInBrowser = config["RunSeleniumInBrowser"] == "true"; - // Run `dotnet user-secrets set RunSeleniumInFirefox true` to run tests in browser - var runInFirefox = config["RunSeleniumInFirefox"] == "true"; - // Reset this using `dotnet user-secrets remove RunSeleniumInBrowser` (or `...Firefox`) + // Reset this using `dotnet user-secrets remove RunSeleniumInBrowser` - if (runInFirefox) + var options = new ChromeOptions(); + if (Server.PayTester.InContainer) { - var options = new FirefoxOptions(); - if (!runInBrowser) - { - options.AddArguments("-headless"); - } - options.AddArguments($"--window-size {windowSize.Width},{windowSize.Height}"); - Driver = new FirefoxDriver(options); + // this must be first option https://stackoverflow.com/questions/53073411/selenium-webdriverexceptionchrome-failed-to-start-crashed-as-google-chrome-is#comment102570662_53073789 + options.AddArgument("no-sandbox"); } - else + if (!runInBrowser) { - var options = new ChromeOptions(); - if (Server.PayTester.InContainer) - { - // this must be first option https://stackoverflow.com/questions/53073411/selenium-webdriverexceptionchrome-failed-to-start-crashed-as-google-chrome-is#comment102570662_53073789 - options.AddArgument("no-sandbox"); - } - if (!runInBrowser) - { - options.AddArguments("headless"); - } - options.AddArguments($"window-size={windowSize.Width}x{windowSize.Height}"); - options.AddArgument("shm-size=2g"); - Driver = new ChromeDriver(Server.PayTester.InContainer ? "/usr/bin" : Directory.GetCurrentDirectory(), options); + options.AddArguments("headless"); } + options.AddArguments($"window-size={windowSize.Width}x{windowSize.Height}"); + options.AddArgument("shm-size=2g"); + Driver = new ChromeDriver(Server.PayTester.InContainer ? "/usr/bin" : Directory.GetCurrentDirectory(), options); if (runInBrowser) {