public void Gets_location_for_correct_window_scope() { Driver.Click(Link("Open pop up window")); var popUp = new DriverScope(DefaultSessionConfiguration, new WindowFinder(Driver, "Pop Up Window", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); Assert.That(Driver.Location(popUp).AbsoluteUri, Is.StringEnding("src/Coypu.Drivers.Tests/html/popup.htm")); }
protected internal HasXPathQuery(Driver driver, DriverScope scope, string xpath, Options options) : base(scope, options) { this.driver = driver; this.driver = driver; this.xpath = xpath; }
public void Finds_clear_scope_back_to_the_whole_window() { var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver,null,null,null); Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId"); Driver.FindButton("scoped button", Root).Id.should_be("scope1ButtonId"); }
public void Can_scope_inside_an_iframe() { var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null); var iframeForm = new DriverScope(new SessionConfiguration(), new CssFinder(Driver, "form", iframeOne), Driver, null, null, null); Driver.FindField("text input in iframe", iframeForm); }
private static DriverScope GetSelectScope(string locator) { var select = new DriverScope(DefaultSessionConfiguration, new SelectFinder(Driver, locator, Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); return @select; }
protected static Element Css(string locator, string text, DriverScope scope = null, Options options = null) { return(FindSingle(new CssFinder(Driver, locator, scope ?? Root, options ?? DefaultOptions, text))); }
public void Gets_location_for_correct_window_scope() { Driver.Click(Driver.FindLink("Open pop up window", Root)); var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null); Assert.That(Driver.Location(popUp).AbsoluteUri, Is.StringEnding("src/Coypu.Drivers.Tests/html/popup.htm")); }
internal Select(Driver driver, DriverScope scope, string locator, string option, Options timingOptions) : base(driver, timingOptions) { this.scope = scope; this.locator = locator; this.option = option; }
internal DriverScopeQuery(DriverScope driverScope, Options options) { Options = options; DriverScope = driverScope; Timeout = options.Timeout; RetryInterval = options.RetryInterval; }
protected ElementFinder(Driver driver, string locator, DriverScope scope, Options options) { Driver = driver; this.locator = locator; Scope = scope; this.options = options; }
protected ElementFinder(IDriver driver, string locator, DriverScope scope, Options options) { Driver = driver; Locator = locator; Scope = scope; Options = options; }
internal FillIn(Driver driver, DriverScope scope, string locator, string value, Options options) : base(driver, options) { this.locator = locator; this.scope = scope; this.value = value; }
public void Can_fill_in_a_text_input_within_an_iframe() { var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null); Driver.Set(Driver.FindField("text input in iframe", iframeOne), "filled in"); Assert.That(Driver.FindField("text input in iframe", iframeOne).Value, Is.EqualTo("filled in")); }
internal FillIn(Driver driver, DriverScope scope, string locator, string value, Options options) : base(driver,options) { this.locator = locator; this.scope = scope; this.value = value; }
public void Can_fill_in_a_text_input_within_an_iframe() { var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); Driver.Set(FindField("text input in iframe", iframeOne), "filled in"); Assert.That(FindField("text input in iframe", iframeOne).Value, Is.EqualTo("filled in")); }
public void Finds_clear_scope_back_to_the_whole_window() { var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", Root, DefaultOptions), Driver,null,null,null,DisambiguationStrategy); Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId"); Button("scoped button", Root, Options.PreferExact).Id.should_be("scope1ButtonId"); }
public void Finds_elements_among_multiple_scopes() { var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null); var iframeTwo = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe two", Root), Driver, null, null, null); Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId"); Driver.FindButton("scoped button", iframeTwo).Id.should_be("iframe2ButtonId"); }
internal Select(Driver driver, DriverScope scope, string locator, string optionToSelect, DisambiguationStrategy disambiguationStrategy, Options options) : base(driver, scope, options) { this.locator = locator; this.optionToSelect = optionToSelect; this.options = options; this.disambiguationStrategy = disambiguationStrategy; }
public void Errors_on_window_closed() { Driver.Click(Driver.FindLink("Open pop up window", Root)); var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null); Driver.ExecuteScript("self.close();", popUp); Assert.Throws<MissingWindowException>(() => Driver.FindWindow("Open pop up window", Root)); }
public void Finds_elements_among_multiple_scopes() { var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver,null,null,null); var iframeTwo = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe two", Root), Driver,null,null,null); Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId"); Driver.FindButton("scoped button", iframeTwo).Id.should_be("iframe2ButtonId"); }
private static void Finds_elements_among_multiple_scopes(ElementFinder elementFinder1, ElementFinder elementFinder2) { var iframeOne = new DriverScope(DefaultSessionConfiguration, elementFinder1, Driver, null, null, null, DisambiguationStrategy); var iframeTwo = new DriverScope(DefaultSessionConfiguration, elementFinder2, Driver, null, null, null, DisambiguationStrategy); Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId"); Button("scoped button", iframeTwo, DefaultOptions).Id.should_be("iframe2ButtonId"); }
public void Can_fill_in_a_text_input_within_an_iframe() { var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null); Driver.Set(Driver.FindField("text input in iframe", iframeOne), "filled in", false); Assert.That(Driver.FindField("text input in iframe", iframeOne).Value, Is.EqualTo("filled in")); }
public void Errors_on_window_closed() { Driver.Click(Driver.FindLink("Open pop up window", Root)); var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null); Driver.ExecuteScript("self.close();", popUp); Assert.Throws <MissingWindowException>(() => Driver.FindWindow("Open pop up window", Root)); }
public void Finds_clears_scope_back_to_the_whole_window() { var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null); Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId"); Driver.FindButton("scoped button", Root).Id.should_be("scope1ButtonId"); }
public void Finds_clear_scope_back_to_the_whole_window() { var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId"); Button("scoped button", Root, Options.PreferExact).Id.should_be("scope1ButtonId"); }
internal ActionSatisfiesPredicateQuery(BrowserAction tryThis, PredicateQuery until, Options options, TimingStrategy timingStrategy) { this.tryThis = tryThis; this.until = until; this.timingStrategy = timingStrategy; Options = options; Scope = tryThis.Scope; }
internal FillInWith(string locator, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options) { this.locator = locator; this.driver = driver; this.robustWrapper = robustWrapper; this.scope = scope; this.options = options; }
internal WaitThenClick(Driver driver, DriverScope scope, Options options, Waiter waiter, ElementFinder elementFinder, DisambiguationStrategy disambiguationStrategy) : base(driver, scope, options) { waitBeforeClick = options.WaitBeforeClick; this.waiter = waiter; this.elementFinder = elementFinder; this.disambiguationStrategy = disambiguationStrategy; }
internal SelectFrom(string option, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options) { this.option = option; this.driver = driver; this.robustWrapper = robustWrapper; this.scope = scope; this.options = options; }
public BaseView(DriverScope browserScope) { if (browserScope == null) { throw new ArgumentNullException("driver"); } _browserScope = browserScope; }
private static DriverScope GetSelectScope(string locator) { var select = new DriverScope(DefaultSessionConfiguration, new SelectFinder(Driver, locator, Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); return(@select); }
internal FillInWith(Element element, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options) { this.element = element; this.driver = driver; this.robustWrapper = robustWrapper; this.scope = scope; this.options = options; }
private void GetValue <T>(DriverScope scope, Options options) { Assert.That(scope.OuterScope, Is.SameAs(browserSession)); Assert.That(scope.ElementFinder, Is.TypeOf <T>()); Assert.That(scope.ElementFinder.Driver, Is.EqualTo(driver)); Assert.That(scope.ElementFinder.Locator, Is.EqualTo("Some locator")); Assert.That(scope.ElementFinder.Options, Is.EqualTo(Options.Merge(options, sessionConfiguration))); }
public void Finds_scoped_by_window() { Driver.Click(Driver.FindLink("Open pop up window", Root)); var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null); Assert.That(Driver.HasContent("I am a pop up window", popUp), Is.True); Assert.That(Driver.HasContent("I am a pop up window", Root), Is.False); }
internal FillIn(Driver driver, DriverScope scope, string locator, Element element, string value, bool forceAllEvents, Options options) : base(driver, options) { this.locator = locator; this.element = element; this.scope = scope; this.value = value; this.forceAllEvents = forceAllEvents; }
internal FillIn(Driver driver, DriverScope scope, string locator, ElementFound element, string value, bool forceAllEvents, Options options) : base(driver,options) { this.locator = locator; this.element = element; this.scope = scope; this.value = value; this.forceAllEvents = forceAllEvents; }
internal SelectFrom(string option, Driver driver, TimingStrategy timingStrategy, DriverScope scope, Options options, DisambiguationStrategy disambiguationStrategy) { this.option = option; this.driver = driver; this.timingStrategy = timingStrategy; this.scope = scope; this.options = options; this.disambiguationStrategy = disambiguationStrategy; }
public void Can_scope_around_an_iframe() { var body = new DriverScope(new SessionConfiguration(), new CssFinder(Driver, "body", Root), Driver, null, null, null); var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", body), Driver, null, null, null); Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId"); Driver.FindButton("scoped button", body).Id.should_be("scope1ButtonId"); }
private static void RefreshCausesScopeToReload(DriverScope driverScope) { var tickBeforeRefresh = Int64.Parse(Driver.ExecuteScript("return window.SpecData.CurrentTick;", driverScope)); Driver.Refresh(driverScope); var tickAfterRefresh = Int64.Parse(Driver.ExecuteScript("return window.SpecData.CurrentTick;", driverScope)); Assert.That(tickAfterRefresh, Is.GreaterThan(tickBeforeRefresh)); }
internal Select(IDriver driver, DriverScope scope, string locator, string optionToSelect, DisambiguationStrategy disambiguationStrategy, Options options, Options fromOptions) : this(driver, scope, locator, optionToSelect, disambiguationStrategy, options) { _fromOptions = fromOptions; }
public void Can_scope_around_an_iframe() { var body = new DriverScope(DefaultSessionConfiguration, new CssFinder(Driver, "body", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", body,DefaultOptions), Driver, null, null, null, DisambiguationStrategy); Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId"); Button("scoped button", body, Options.PreferExact).Id.should_be("scope1ButtonId"); }
private static void Finds_elements_among_multiple_scopes(ElementFinder elementFinder1, ElementFinder elementFinder2) { var iframeOne = new DriverScope(new SessionConfiguration(), elementFinder1, Driver, null, null, null); var iframeTwo = new DriverScope(new SessionConfiguration(), elementFinder2, Driver, null, null, null); Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId"); Driver.FindButton("scoped button", iframeTwo).Id.should_be("iframe2ButtonId"); }
public void Can_scope_around_an_iframe() { var body = new DriverScope(DefaultSessionConfiguration, new CssFinder(Driver, "body", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", body, DefaultOptions), Driver, null, null, null, DisambiguationStrategy); Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId"); Button("scoped button", body, Options.PreferExact).Id.should_be("scope1ButtonId"); }
private static void AssertMaximisesWindow(DriverScope driverScope) { var availWidth = float.Parse(Driver.ExecuteScript("return window.screen.availWidth;", driverScope)); var initalWidth = float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope)); Assert.That(initalWidth, Is.LessThan(availWidth)); Driver.MaximiseWindow(driverScope); Assert.That(float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope)), Is.GreaterThanOrEqualTo(availWidth)); }
private static void AssertResizesWindow(DriverScope driverScope) { var availWidth = float.Parse(Driver.ExecuteScript("return window.screen.availWidth;", driverScope)); var initalWidth = float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope)); Assert.That(initalWidth, Is.LessThan(availWidth)); Driver.ResizeTo(new Size(768, 500), driverScope); Assert.That(float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope)), Is.EqualTo(768)); Assert.That(float.Parse(Driver.ExecuteScript("return window.outerHeight;", driverScope)), Is.EqualTo(500)); }
public void Stale_window_closed() { Driver.Click(Driver.FindLink("Open pop up window", Root)); var popUpScope = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null); var popUpWindow = popUpScope.Now(); popUpWindow.Stale(new Options()).should_be_false(); Driver.Click(Driver.FindButton("close", popUpScope)); popUpWindow.Stale(new Options()).should_be_true(); }
public void Stale_window_closed() { Driver.Click(Link("Open pop up window")); var popUpScope = new DriverScope(DefaultSessionConfiguration, new WindowFinder(Driver, "Pop Up Window", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy ); var popUpWindow = popUpScope.Now(); popUpWindow.Stale(new Options()).should_be_false(); Driver.Click(Button("close", popUpScope, DefaultOptions)); popUpWindow.Stale(new Options()).should_be_true(); }
public void RefreshesCorrectWindowScope() { Driver.Click(Link("Open pop up window")); var popUp = new DriverScope(DefaultSessionConfiguration, new WindowFinder(Driver,"Pop Up Window",Root,DefaultOptions), Driver, null, null, null, DisambiguationStrategy); try { RefreshCausesScopeToReload(popUp); } finally { Driver.ExecuteScript("return self.close();", popUp); } }