public void Should_be_able_to_dispose_of_an_explicit_instance_without_affecting_standard_instance() { SeleniumSupport target = CreateTarget(true); const string serverHost = "localhost"; const int serverPort = 4444; string browserString = _firefoxBrowser; ISelenium defaultInstance = target.Start(serverHost, serverPort, browserString, "http://www.google.co.uk"); Assert.IsNotNull(defaultInstance); Assert.AreEqual(1, target.Instances.Count); ISelenium explicitInstance = target.CreateInstance(serverHost, serverPort, browserString, "http://www.microsoft.com"); Assert.IsNotNull(explicitInstance); Assert.AreEqual(2, target.Instances.Count); Assert.AreNotSame(defaultInstance, explicitInstance); Assert.AreSame(target.Selenium, defaultInstance); target.DisposeInstance(explicitInstance); Assert.AreEqual(1, target.Instances.Count); Assert.IsNotNull(target.Selenium); // Dispose of class to clear up resources target.Dispose(); }
public void Should_start_default_selenium_instance_of_ie() { SeleniumSupport target = CreateTarget(true); const string serverHost = "localhost"; const int serverPort = 4444; string browserString = _ieBrowser; const string browserUrl = "http://www.google.co.uk"; ISelenium actual = target.Start(serverHost, serverPort, browserString, browserUrl); Assert.IsNotNull(actual); Assert.AreEqual(1, target.Instances.Count); Assert.AreSame(target.Selenium, actual); // Dispose of the selenium support instance otherwise tests to ensure errors thrown when // it is not running will not work target.Dispose(); }
public void Should_thow_exception_when_starting_instance_due_to_url_not_provided() { SeleniumSupport target = CreateTarget(true); target.Start("localhost", 4444, _firefoxBrowser, ""); }
public void Should_thow_exception_when_starting_instance_due_to_browser_string_not_provided() { SeleniumSupport target = CreateTarget(true); target.Start("localhost", 4444, "", "http://www.google.co.uk"); }
public void Should_thow_exception_when_starting_instance_due_to_serverhost_not_provided() { SeleniumSupport target = CreateTarget(true); target.Start("", 4444, _firefoxBrowser, "http://www.google.co.uk"); }