Beispiel #1
0
 public void StartChromeTest()
 {
     if (_chromeProcessFactory == null)
     {
         var chromePath = ChromePathFinder.GetChromePath(new NativeFsAbstraction());
         _chromeProcessFactory = new ChromeProcessFactory(chromePath);
     }
     if (_chromeProcess == null)
     {
         try
         {
             _chromeProcess = _chromeProcessFactory.Create($"http://localhost:{_webServer.Port}/bb/test/");
         }
         catch (Exception ex)
         {
             Console.WriteLine("Failed To Start Chrome Headless");
             Console.WriteLine(ex);
         }
     }
 }
Beispiel #2
0
        void ThrowsExceptionWhenChromeNorChromiumIsNotFound()
        {
            Exception ex = Assert.Throws <Exception>(() => ChromePathFinder.GetChromePath(new FakeFs(true)));

            Assert.Equal("Chrome not found. Install Google Chrome or Chromium.", ex.Message);
        }
Beispiel #3
0
        void ReturnsLinuxPathIfIsUnixFs()
        {
            var chromePath = ChromePathFinder.GetChromePath(new FakeFs(true, "/opt/google/chrome/google-chrome"));

            Assert.Equal("/opt/google/chrome/google-chrome", chromePath);
        }
Beispiel #4
0
        void ReturnsLinuxChromiumBrowserPathIfIsUnixFsAndChromeNotInstalled()
        {
            var chromePath = ChromePathFinder.GetChromePath(new FakeFs(true, "/usr/bin/chromium-browser"));

            Assert.Equal("/usr/bin/chromium-browser", chromePath);
        }
Beispiel #5
0
        void ReturnsWindowsPathIfNotUnixFs()
        {
            var chromePath = ChromePathFinder.GetChromePath(new FakeFs(false, @"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"));

            Assert.Equal(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", chromePath);
        }