diff --git a/.travis.yml b/.travis.yml index d72be52223..e0e85467fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ addons: apt: packages: - libunwind8 + chrome: stable mono: none os: - linux @@ -29,6 +30,7 @@ install: - nvm use 8.9.4 - npm install -g selenium-standalone - selenium-standalone install + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export TEST_CHROME_BINARY=`which google-chrome-stable`; fi - export DOTNET_INSTALL_DIR="$PWD/.dotnetcli" - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current --version latest --install-dir "$DOTNET_INSTALL_DIR" - export PATH="$DOTNET_INSTALL_DIR:$PATH" diff --git a/test/Microsoft.AspNetCore.Blazor.E2ETest/Infrastructure/BrowserFixture.cs b/test/Microsoft.AspNetCore.Blazor.E2ETest/Infrastructure/BrowserFixture.cs index 3b819ecd1b..3c6d5657f4 100644 --- a/test/Microsoft.AspNetCore.Blazor.E2ETest/Infrastructure/BrowserFixture.cs +++ b/test/Microsoft.AspNetCore.Blazor.E2ETest/Infrastructure/BrowserFixture.cs @@ -16,6 +16,16 @@ namespace Microsoft.AspNetCore.Blazor.E2ETest.Infrastructure { var opts = new ChromeOptions(); opts.AddArgument("--headless"); + + // On Windows/Linux, we don't need to set opts.BinaryLocation + // But for Travis Mac builds we do + var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); + if (!string.IsNullOrEmpty(binaryLocation)) + { + opts.BinaryLocation = binaryLocation; + Console.WriteLine($"Set {nameof(ChromeOptions)}.{nameof(opts.BinaryLocation)} to {binaryLocation}"); + } + Browser = new RemoteWebDriver(opts); }