eslint-plugin-playwright icon indicating copy to clipboard operation
eslint-plugin-playwright copied to clipboard

Expect.soft assertions only

Open unlikelyzero opened this issue 3 years ago • 3 comments
trafficstars

It would be great to have a rule to enforce expect.soft assertions. I've found that they've been a great way to isolate failure in tests but find it difficult to keep track of them during code reviews.

unlikelyzero avatar Jun 14 '22 19:06 unlikelyzero

Hmm. @mxschmitt what do you think? Feels like a pretty odd rule to enforce IMO, in my experience soft assertions are a infrequently used feature that comes in handy in a few instances, but certainly not everywhere.

mskelton avatar Jun 15 '22 01:06 mskelton

We can definitely have it, but disabled by default.

A good thing which I might see is that at the end of your test execution you might have more information to fix your test instead of just one assertion which failed. But this sounds also like a source of a lot of redundant information which gets added.

mxschmitt avatar Jun 15 '22 08:06 mxschmitt

@mskelton we're encouraging folks to write "longer" tests given that most of our test duration is spent setting up certain contexts and we're recording the tracefiles which give "pin point accuracy" for test failure.

unlikelyzero avatar Jun 15 '22 17:06 unlikelyzero

Been a while, but I have a PR to fix this finally 🙂

mskelton avatar Jan 16 '23 23:01 mskelton