0

I use Coypu for my tests.

How can I wait until either a certain css appears or a certain text?

Right now my solution is this:

browser.Visit(uriContext.Uri.ToString());
var deadline = DateTime.UtcNow.Add(WebAppWarmUpTimeout);
while (DateTime.UtcNow < deadline)
{
    if (browser.HasContent("404 - File or directory not found.", SmallTimeoutOptions))
    {
        Assert.Fail("404");
    }
    else if (browser.FindCss("body nav a", "Job Search", SmallTimeoutOptions).Exists())
    {
        break;
    }
}

Is there a better way to do it?

mark
  • 59,016
  • 79
  • 296
  • 580

1 Answers1

0

I admit of not having read the entire documentation attentively, it is all there - https://github.com/featurist/coypu#finding-states-nondeterministic-testing

From the source:

enter image description here

P.S.

Thank you to Adrian Longley who answered promptly my question on their github page - https://github.com/featurist/coypu/issues/187

mark
  • 59,016
  • 79
  • 296
  • 580