示例#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}.");
        }
示例#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*");
        }
示例#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);
            });
        }
示例#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);
 }
示例#5
0
 public void HeadlessBrowsersCanBeLaunched(Browser browser)
 {
     Driver     = StaticWebDriverFactory.GetLocalWebDriver(browser, true);
     Driver.Url = "https://example.com/";
     Driver.Title.Should().Be("Example Domain");
 }
示例#6
0
 public void LocalWebDriverCanBeLaunchedAndLoadExampleDotCom(Browser browser)
 {
     Driver     = StaticWebDriverFactory.GetLocalWebDriver(browser);
     Driver.Url = "https://example.com/";
     Driver.Title.Should().Be("Example Domain");
 }
示例#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");
 }
示例#8
0
 public void LocalWebDriverCanBeLaunchedAndLoadExampleDotCom()
 {
     LocalDriver     = StaticWebDriverFactory.GetLocalWebDriver((int)Browser.Firefox);
     LocalDriver.Url = "https://example.com/";
     LocalDriver.Title.Should().Be("Example Domain");
 }