gncljsn's avatar

What automation testing tools is best with Laravel project for blackbox testing? (v10)? Playwright or Laravel Dusk?

Hi, i'm currently looking for an automated testing tool for my Laravel 10 project. I want to focus on user's perspective so it must support Blackbox type of testing. Can someone suggest which one should I use between Playwright and Laravel Dusk? Or any other suggestions. Thank you.

0 likes
1 reply
Braunson's avatar
Level 18

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

1 like

Please or to participate in this conversation.