mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Install chrome driver on alpine
This commit is contained in:
@@ -8,6 +8,7 @@ WORKDIR /source
|
|||||||
COPY BTCPayServer/BTCPayServer.csproj BTCPayServer/BTCPayServer.csproj
|
COPY BTCPayServer/BTCPayServer.csproj BTCPayServer/BTCPayServer.csproj
|
||||||
COPY BTCPayServer.Tests/BTCPayServer.Tests.csproj BTCPayServer.Tests/BTCPayServer.Tests.csproj
|
COPY BTCPayServer.Tests/BTCPayServer.Tests.csproj BTCPayServer.Tests/BTCPayServer.Tests.csproj
|
||||||
RUN dotnet restore BTCPayServer.Tests/BTCPayServer.Tests.csproj
|
RUN dotnet restore BTCPayServer.Tests/BTCPayServer.Tests.csproj
|
||||||
|
RUN apk add chromium-chromedriver
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN dotnet build
|
RUN dotnet build
|
||||||
WORKDIR /source/BTCPayServer.Tests
|
WORKDIR /source/BTCPayServer.Tests
|
||||||
|
|||||||
@@ -33,26 +33,12 @@ namespace BTCPayServer.Tests
|
|||||||
ChromeOptions options = new ChromeOptions();
|
ChromeOptions options = new ChromeOptions();
|
||||||
options.AddArguments("headless"); // Comment to view browser
|
options.AddArguments("headless"); // Comment to view browser
|
||||||
options.AddArguments("window-size=1200x600"); // Comment to view browser
|
options.AddArguments("window-size=1200x600"); // Comment to view browser
|
||||||
if (Server.PayTester.InContainer)
|
|
||||||
{
|
Driver = new ChromeDriver(Directory.GetCurrentDirectory(), options);
|
||||||
Driver = new OpenQA.Selenium.Remote.RemoteWebDriver(new Uri("http://selenium:4444/wd/hub"), options);
|
Logs.Tester.LogInformation("Selenium: Using chrome driver");
|
||||||
Logs.Tester.LogInformation("Selenium: Using remote driver");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Driver = new ChromeDriver(Directory.GetCurrentDirectory(), options);
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -286,11 +286,6 @@ services:
|
|||||||
links:
|
links:
|
||||||
- bitcoind
|
- bitcoind
|
||||||
|
|
||||||
selenium:
|
|
||||||
image: selenium/standalone-chrome
|
|
||||||
expose:
|
|
||||||
- "4444"
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
bitcoin_datadir:
|
bitcoin_datadir:
|
||||||
customer_lightningd_datadir:
|
customer_lightningd_datadir:
|
||||||
|
|||||||
Reference in New Issue
Block a user