internal State FindState(State[] states, Scope scope, Options options) { var query = new LambdaPredicateQuery(() => { var was = timingStrategy.ZeroTimeout; timingStrategy.ZeroTimeout = true; try { return(((Func <bool>)(() => states.Any(s => s.CheckCondition())))()); } finally { timingStrategy.ZeroTimeout = was; } }, options); var foundState = timingStrategy.Synchronise(query); if (!foundState) { throw new MissingHtmlException("None of the given states was reached within the configured timeout."); } return(states.First(e => e.ConditionWasMet)); }
/// <summary> /// Supply a value for the text field /// </summary> /// <param name="value">The value to fill in</param> /// <exception cref="T:Coypu.MissingHtmlException">Thrown if the element cannot be found</exception> public void With(string value) { timingStrategy.Synchronise(new FillIn(driver, element, value, options)); }
/// <summary> /// Find the first matching select to appear within the SessionConfiguration.Timeout from which to select this option. /// </summary> /// <param name="locator">The text of the associated label element, the id or name</param> /// <param name="fromOptions"> /// <para>Override the way Coypu is configured to find elements for this call only.</para> /// <para>E.g. A longer wait</para></param> /// <exception cref="T:Coypu.MissingHtmlException">Thrown if the element cannot be found</exception> public void From(string locator, Options fromOptions) { _timingStrategy.Synchronise(new Select(_driver, _scope, locator, _option, _disambiguationStrategy, _options, fromOptions)); }
public override Element Now() { return(TimingStrategy.Synchronise(new ElementQuery(this, options))); }
public bool Run() { tryThis.Act(); return(timingStrategy.Synchronise(until)); }
public void RetryUntilTimeout(Action action, Options options = null) { timingStrategy.Synchronise(new LambdaBrowserAction(action, Merge(options))); }
/// <summary> /// Find the first matching select to appear within the SessionConfiguration.Timeout from which to select this option. /// </summary> /// <param name="locator">The text of the associated label element, the id or name</param> /// <exception cref="T:Coypu.MissingHtmlException">Thrown if the element cannot be found</exception> public void From(string locator) { timingStrategy.Synchronise(new Select(driver, scope, locator, option, options, disambiguationStrategy)); }