0

I have the following test using Coypu:

var options = new Options { Timeout = TimeSpan.FromSeconds(1) };
using (var browser = GetFreshBrowserSession())
{
    browser.Visit(TestParamNames.LoginUri.GetParameterByName() + "candidateportal/en-US/" + TestParamNames.Namespace.GetParameterByName());
    Assert.True(browser.FindCss("body > div.header > a.nav-item.job-search.selected > span.header-text", "Job Search", options).Exists());
    Assert.True(browser.FindField("keyword", options).Exists());
    Assert.True(browser.FindCss("body > div.content-wrapper > div.center.search-pane > form > span > span > input", options).Exists());
    Assert.True(browser.FindButton("Search", options).Exists());
    Assert.True(browser.FindButton("Reset", options).Exists());
    Assert.True(browser.FindCss("div#advanced-search-link","Advanced Search", options).Exists());
}

As you can see, I pass the options with timeout to every method. Is it possible to set the default timeout once and avoid passing it explicitly to each method?

mark
  • 59,016
  • 79
  • 296
  • 580
  • Did you look at [the docs](https://github.com/featurist/coypu#waits-retries-and-timeout)? I see an example, `sessionConfiguration.Timeout = TimeSpan.FromSeconds(1);` that looks like what you want. – JeffC May 18 '18 at 18:48
  • I found it some time after I posted the question. A bit premature, I agree. – mark May 18 '18 at 22:18

0 Answers0