Skip to content

How to use as drop-in replacement for Playwright/Puppeteer? #815

Closed Answered by capricorn86
tomByrer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tomByrer!

The difference between Playwright, Puppeteer and other E2E test suites compared to Happy DOM is that they run in a real browser, while Happy DOM simulates being a browser directly in the NodeJS environment. This is also why Happy DOM is so much faster and more lightweight.

Happy DOM will not paint the page and you will therefore not be able to get a screenshot out from Happy DOM or get exact painting positions of elements. However, you will probably be able to replace most of your tests with Happy DOM.

I recommend using a unit test framework like Vitest in combination with Testing Library. Vitest supports Happy DOM out of the box and Testing Library will make it easy to simu…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by capricorn86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants