rod: Easier way to avoid panic with Must helpers.

Currently all the Must helpers call to utils.E, which panics the test. One option would be to avoid Must methods altogether, however, they are rather convenient.

This is a problem, because with concurrent tests it will stop all the tests rather than just the test that failed.

I propose adding a browser.OnFail which accepts interface { Fatal(args ...interface{}) } and returns a rod.Browser. Instead of calling utils.E the browser would then call the on fail func.

The actual method name can be something entirely different.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

It’s too late tonight. I’ll explain why yours has the same fundermental design issue as #166 tomorrow. You can polish your PR before that.

I think if you can solve the problem, I will be super happy to accept your PR.