Example #1
0
        public void RequestingUnsupportedHeadlessBrowserThrowsInformativeException(Browser browser)
        {
            Action act = () => StaticWebDriverFactory.GetLocalWebDriver(browser, true);

            act.Should()
            .ThrowExactly <ArgumentException>($"because headless mode is not supported on {browser}.")
            .WithMessage($"Headless mode is not currently supported for {browser}.");
        }
Example #2
0
        public void RequestingUnsupportedWebDriverThrowsInformativeException(Browser browser)
        {
            Action act = () => StaticWebDriverFactory.GetLocalWebDriver(browser);

            act.Should()
            .Throw <PlatformNotSupportedException>($"because {browser} is not supported on {thisPlatformType}.")
            .WithMessage("*is only available on*");
        }
Example #3
0
        public void FhdBrowserIsOfRequestedSize()
        {
            Driver = StaticWebDriverFactory.GetLocalWebDriver(StaticDriverOptionsFactory.GetFirefoxOptions(true), WindowSize.Fhd);

            Assert.Multiple(() =>
            {
                Size size = Driver.Manage().Window.Size;
                size.Height.Should().Be(1080);
                size.Width.Should().Be(1920);
            });
        }
Example #4
0
 public void Initialize()
 {
     _driver = StaticWebDriverFactory.GetRemoteWebDriver(browser: _browser, gridUrl: new Uri("http://localhost:4444/wd/hub"), proxy: null);
     //_driver = StaticWebDriverFactory.GetLocalWebDriver(_browser, false);
 }
Example #5
0
 public void HeadlessBrowsersCanBeLaunched(Browser browser)
 {
     Driver     = StaticWebDriverFactory.GetLocalWebDriver(browser, true);
     Driver.Url = "https://example.com/";
     Driver.Title.Should().Be("Example Domain");
 }
Example #6
0
 public void LocalWebDriverCanBeLaunchedAndLoadExampleDotCom(Browser browser)
 {
     Driver     = StaticWebDriverFactory.GetLocalWebDriver(browser);
     Driver.Url = "https://example.com/";
     Driver.Title.Should().Be("Example Domain");
 }
Example #7
0
 public void RemoteWebDriverCanBeLaunchedAndLoadExampleDotCom(Browser browser)
 {
     Driver     = StaticWebDriverFactory.GetRemoteWebDriver(browser, new Uri("http://localhost:4444/wd/hub"), PlatformType.Any);
     Driver.Url = "https://example.com/";
     Driver.Title.Should().Be("Example Domain");
 }
Example #8
0
 public void LocalWebDriverCanBeLaunchedAndLoadExampleDotCom()
 {
     LocalDriver     = StaticWebDriverFactory.GetLocalWebDriver((int)Browser.Firefox);
     LocalDriver.Url = "https://example.com/";
     LocalDriver.Title.Should().Be("Example Domain");
 }