Hacker News new | ask | show | jobs
by niklaslogren 1896 days ago
We are using Cypress at my workplace and we're quite happy with it. It also has endpoint mocking, mobile emulation etc.

Out of curiosity, does anyone know of any advantages of Playwright when compared to Cypress?

2 comments

Cypress appears to have more features dedicated specifically to making testing easier, such as a user interface and various debugging additions and integrations into various other tools.

Playwright is just an API for controlling the browser, and appears to be far more powerful in that regard.

Compare the api documentation, and it's not even close: https://docs.cypress.io/api/table-of-contents

https://playwright.dev/docs/api/class-playwright

It looks like Cypress added Firefox & Edge support last year but initially it was just Chrome.

Playwright also has a python version (https://github.com/microsoft/playwright-python)

And I just discovered that they now have a real nifty debugger you can use to inspect/step-through tests as they run (https://playwright.dev/docs/next/debug/#playwright-inspector)

They also have a code generator that can record your actions and turn them into scripts
If cypress works for you that’s great, playwright doesn’t have all of the same tools but it does excel at cross browser testing. It runs safari, Firefox, and chrome.

We’re working on plugging in playwright into a cloud service for visual testing @superadmin.so, running multiple browsers in Linux can be pretty hairy to setup.