3 ms·
It is to me, testing arbitrary tree of components in live browsers can be invaluable, espcially for things like a design system, where snapshot testing can actu
by no_wizard 3y ago
It is to me, testing arbitrary tree of components in live browsers can be invaluable, espcially for things like a design system, where snapshot testing can actually be really valuable[0].
RTL is great, but jsdom and similar solutions have limitations, being able to run similar tests in live browsers is really validating, in many cases allows us to cut down on writing somewhat more brittle E2E tests
The biggest win with playwright its like writing vitest / jest tests, it uses a similar `expect` function (I believe its a modified version of Jest expect but that may have changed) and I like their Pages API
The only thing I haven't used Playwright for yet is API testing
[0]: as you get more than just a DOM tree snapshot, you get the styles too. Great for catching regressions