Shift with red gradient lettering

Dusk Converter

The Dusk Converter automates the process of converting from Laravel Dusk to Pest Browser Tests.

The Pest Browser Tests offer a similar API to Laravel Dusk, but with the ease of use and speed of Playwright. After using the Dusk Converter you may continue running your browser tests separately. Or, if you are already using Pest, run them with your existing Pest test suite.

Using the Dusk Converter to automatically convert your test suite has an estimated time savings of 2 hours.

Screenshot of a pull request with automated changes from the Dusk Converter

Requirements

  • A laravel/dusk dependency of 6.0 or higher
  • Laravel Dusk tests under a tests/Browser folder
  • Running Pest 4.0 or higher

Automated Conversions

The Dusk Converter automates the following conversions:

  • Adds dependencies for Pest Browser Testing, like pestphp/pest-plugin-browser.
  • Converts existing Dusk Tests from PHPUnit to Pest.
  • Converts from Dusk API to Pest Browser Testing API.
  • Converts any `dusk` HTML attributes used for Testing.
  • Removes Laravel Dusk installation.
  • Updates your build pipeline to use the vendor/bin/pest runner instead of artisan dusk.

Manual Conversions

Laravel Dusk is built on top of Selenium. Any low-level calls to Selenium will not be converted. In addition, some of the Dusk API does not have a direct replacement in the Pest Browser Testing API. These will be noted in the comments with possible refactors.

Sign in with any of the following services to connect Shift with your Laravel project.


Don't use one of these services?

Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.