public void ShouldTakeSauceOptions() { SauceOptions options = new SauceOptions(); var session = new SauceSession(options); session.Should().NotBeNull(); }
public void Stop_TestFailed_UpdatesTestStatus() { SauceSession = new SauceSession(_dummyDriver.Object); SauceSession.Start(); SauceSession.Stop(false); _dummyDriver.Verify(driver => driver.ExecuteScript("sauce:job-result=failed"), Times.Exactly(1)); }
public void Stop_CallsQuit() { SauceSession = new SauceSession(_dummyDriver.Object); SauceSession.Start(); SauceSession.Stop(true); _dummyDriver.Verify(driver => driver.Quit(), Times.Exactly(1)); }
public void Start_Default_IsChrome() { SauceSession = new SauceSession(_dummyDriver.Object); SauceSession.Start(); SauceSession.Options.ConfiguredChromeOptions.Should().NotBeNull(); }
public void ChromeIsDefaultBrowser() { _session = new SauceSession(); _driver = _session.Start(); var capabilities = ((RemoteWebDriver)_driver).Capabilities; capabilities.GetCapability("browserName").Should().Be("chrome"); }
public void Start_Default_IsChrome() { var session = new SauceSession(); var driver = session.Start(); var capabilities = ((RemoteWebDriver)driver).Capabilities; capabilities.GetCapability("browserName").Should().Be("chrome"); }
public void Start_Default_IsChrome() { var dummyManager = new Mock <IRemoteDriver>(); var session = new SauceSession(dummyManager.Object); session.Start(); session.ChromeOptions.Should().NotBeNull(); }
public void RunTestWithSafariDefault() { _sauceOptions = new SauceOptions(); _sauceOptions.WithSafari(); _session = new SauceSession(_sauceOptions); _driver = _session.Start(); var capabilities = ((RemoteWebDriver)_driver).Capabilities; capabilities.GetCapability("browserName").Should().Be("Safari"); }
public void RunTestWithEdge15() { _sauceOptions = new SauceOptions(); _sauceOptions.WithEdge(EdgeVersion._15); _session = new SauceSession(_sauceOptions); _driver = _session.Start(); var capabilities = ((RemoteWebDriver)_driver).Capabilities; capabilities.GetCapability("browserName").Should().Be("MicrosoftEdge"); }
public void Start_WithChromeVersionSet_CreatesCorrectDriver() { SauceOptions = new SauceOptions(); SauceOptions.WithChrome("72"); SauceSession = new SauceSession(SauceOptions, _dummyDriver.Object); SauceSession.Start(); SauceSession.Options.ConfiguredChromeOptions.BrowserVersion.Should().Be("72"); }
public void Start_WithChrome_SetsChromeBrowser() { SauceOptions = new SauceOptions(); SauceOptions.WithChrome(); SauceSession = new SauceSession(SauceOptions, _dummyDriver.Object); SauceSession.Start(); SauceSession.Options.ConfiguredChromeOptions.Should(). NotBeNull("we passed in options configured with Chrome, hence ChromeOptions should be set."); }
public void RunTestWithEdge() { var options = new SauceOptions(); options.WithEdge(); var session = new SauceSession(options); var driver = session.Start(); var capabilities = ((RemoteWebDriver)driver).Capabilities; capabilities.GetCapability("browserName").Should().Be("MicrosoftEdge"); }
public void Start_Default_SetsSauceOptionsTag() { SauceSession = new SauceSession(_dummyDriver.Object); SauceSession.Start(); var browserOptionsSetInSauceJson = SauceSession.Options.ConfiguredChromeOptions.ToString(); var browserOptionsSetInSauce = DeserializeToObject(browserOptionsSetInSauceJson); AssertUsernameAndAccessKeyExist(browserOptionsSetInSauce); }
public void Start_Default_SetsSauceOptionsTag() { SauceSession = new SauceSession(_dummyDriver.Object); SauceSession.Start(); var optionsString = SauceSession.Options.ConfiguredChromeOptions.ToString(); var configuredOptions = JsonConvert.DeserializeObject <Root>(optionsString); configuredOptions.SauceOptions.Username.Should().NotBeNullOrEmpty(); configuredOptions.SauceOptions.AccessKey.Should().NotBeNullOrEmpty(); }
public void Start_WithEdge_SetsUsernameAndAccessKey() { SauceOptions = new SauceOptions(); SauceOptions.WithEdge(); SauceSession = new SauceSession(SauceOptions, _dummyDriver.Object); SauceSession.Start(); var browserOptionsSetInSauceJson = SauceSession.Options.ConfiguredEdgeOptions.ToString(); var browserOptionsSetInSauce = DeserializeToObject(browserOptionsSetInSauceJson); AssertUsernameAndAccessKeyExist(browserOptionsSetInSauce); }
public void RunTestWithFirefox() { _sauceOptions = new SauceOptions { BrowserName = Browser.Firefox }; _session = new SauceSession(_sauceOptions); _driver = _session.Start(); ((IJavaScriptExecutor)_driver).ExecuteScript("sauce:job-name=" + TestContext.TestName); var capabilities = ((RemoteWebDriver)_driver).Capabilities; capabilities.GetCapability("browserName").Should().Be("firefox"); }
public void Start_WithEdge_SetsEdgeBrowser() { SauceOptions = new SauceOptions(); SauceOptions.WithEdge(); SauceSession = new SauceSession(SauceOptions, _dummyDriver.Object); SauceSession.Start(); SauceSession.Options.ConfiguredEdgeOptions.Should().NotBeNull("because we set SauceSession to run withEdge()"); var edgeOptionsString = SauceSession.Options.ConfiguredEdgeOptions.ToString(); var configuredOptions = JsonConvert.DeserializeObject <Root>(edgeOptionsString); configuredOptions.SauceOptions.Username.Should().NotBeNullOrEmpty(); configuredOptions.SauceOptions.AccessKey.Should().NotBeNullOrEmpty(); }
public void ShouldReturnObject() { var session = new SauceSession(); session.Should().NotBeNull(); }
public void ShouldCompile() { var sauce = new SauceSession(); Assert.IsNotNull(sauce); }
public void GetDataCenter_Default_IsWest() { SauceSession = new SauceSession(); SauceSession.DataCenter.Should().BeEquivalentTo(DataCenter.UsWest); }
public void SauceSession_NoConstructorParam_OptionsInitialized() { SauceSession = new SauceSession(); Assert.IsNotNull(SauceSession.Options); }
public void SauceSession_OptionsPassedIn_SetsConcreteDriver() { SauceOptions = new SauceOptions(); SauceSession = new SauceSession(SauceOptions); SauceSession.Driver.Should().BeOfType(typeof(SauceDriver)); }