Make selenium work on CI

This commit is contained in:
nicolas.dorier 2019-05-14 16:06:51 +09:00
parent 522d745883
commit a1f1e90626
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
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);
}

View File

@ -30,6 +30,7 @@ services:
- "80"
links:
- dev
- selenium
extra_hosts:
- "tests:127.0.0.1"
volumes:
@ -53,7 +54,6 @@ services:
- lightning-charged
- customer_lnd
- merchant_lnd
- selenium
devlnd:
image: btcpayserver/bitcoin:0.18.0
@ -288,6 +288,8 @@ services:
selenium:
image: selenium/standalone-chrome
expose:
- "4444"
volumes:
bitcoin_datadir:

View File

@ -2,7 +2,7 @@
set -e
dotnet test --filter Fast=Fast --no-build
# dotnet test --filter Selenium=Selenium --no-build -v n
dotnet test --filter Selenium=Selenium --no-build -v n
dotnet test --filter Integration=Integration --no-build -v n
if [[ "$TESTS_RUN_EXTERNAL_INTEGRATION" == "true" ]]; then
dotnet test --filter ExternalIntegration=ExternalIntegration --no-build -v n