Hacker News new | past | comments | ask | show | jobs | submit login

really curious about peoples experience with this compared to things like Cypress.



I've had some issues with Cypress selectors randomly failing to find matching elements, even though they are clearly present. Like if I run the same script 10 times it goes through ~7 times. I wanted to try Playwright for another application to avoid such issues.

And then I was very surprised to get almost the exact same issues with Playwright. Running against a different application with different test cases.

Has anyone else had issues like this with React applications? It's very annoying to not be able to write repeatable tests.


Were you able to use the DOM snapshots to debug why the selectors did not resolve? Would love to know more.


> DOM snapshots

I should definitely try that the next time I'm working on this issue. Maybe I can get some kind of small example as well if possible. But replicating the problematic conditions is probably hard.


Got less once I started using dom-testing-library :)


Well, Cypress is going to use playwright for their Webkit integration.

Cypress is more limited compared to Playwright such as multi-domains aren't supported, multiple tabs, or popup windows. For my tests that require that I am using Playwright and for the rest I am currently using Cypress. But I do think the test writing experience is better with Cypress :)

I am considering to move to Playwright for everything now with the new Trace Viewer (https://playwright.dev/docs/debug#playwright-trace-viewer); and contribute to that.


> such as multi-domains aren't supported

Thankfully this is being actively worked on: https://github.com/cypress-io/cypress/issues/944#issuecommen...


This question does come up quite a lot. One thing the remember is that Cypress is "batteries included" testing framework, where Playwright is essentially just the browser automation part of it.

I know the Playwright team is "moving up the stack" and adding many specific testing features, but it's not at the same level (yet?) as Cypress.


I think you're thinking of Puppeteer? Playwright has stuff like automatically waiting for elements, selecting by text etc all built in - with modern JavaScript/TypeScript, none of the weird chaining syntax and debugger.

There are also tools that give you pretty much any feature Cypress has on top of Playwright.

(Not saying which is better - only that they're both sort of the same slot)


With the latest release, Playwright includes an integrated test runner: https://playwright.dev/docs/next/test-intro




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: