To simplify the pros/cons of Playwright vs Laravel Dusk:
Playwright is like having a real user with multiple browsers testing your app, while Dusk is like having a Laravel-savvy user with Chrome testing your app.
In order for you to decide, ask yourself these questions:
- How much JS/Alpine/Livewire interactions do you need to test?
- Do you need multi-browser support?
- Are you comfortable with Node.js/TS ore prefer staying inside PHP?
- What would your team maintain better?
If you are using Alpine/Livewire, I might lean towards Playwright. However there is another option: Cypress.
tldr:
Playwright = Testing a modern SPA-like experience (even if it's not technically an SPA) Dusk = Testing a traditional web application with some JavaScript sprinkles