roquie/laravel-dusk-select2
Laravel Dusk Select2 adds a simple helper for interacting with Select2 dropdowns in Dusk browser tests. Pick options by visible text or value without fragile JavaScript workarounds, keeping your end-to-end tests readable and reliable.
This package sits on top of laravel/dusk and is intended to be used inside your Dusk test suite rather than in application runtime code. Minimum steps:
composer require --dev <package> — it is a test-only dependency; keep it out of production.laravel/dusk is installed and php artisan dusk:install has been run, so tests/DuskTestCase.php and the tests/Browser directory exist.tests/DuskTestCase.php or in the specific browser tests that need it.php artisan dusk --filter=YourTestName to prove the wiring works before writing broader suites.Where to look first: the package's README for the supported Dusk version, then its src/ for the base test case/traits you are expected to extend or use. The 2.1.0 release moved back to depending on laravel/dusk directly instead of pulling in the full framework, so if you are upgrading from 1.x, check that your Dusk version satisfies the new constraint before anything else.
First realistic use case: replace hand-rolled browser-test boilerplate (login helpers, selectors, page objects) with the package's abstractions, and verify a single critical flow — login → dashboard — end to end.
$page->loginAs($user)). This is where Dusk-based packages pay off — when the markup changes you edit one class, not thirty tests.RefreshDatabase (or the Dusk equivalent with a dedicated testing database) plus explicit factories per test. Browser tests are slow and stateful; any shared state turns into flaky failures that are painful to bisect.laravel/dusk. If your app pins an older Dusk or an older Laravel, composer resolution will fail or silently downgrade. Pin laravel/dusk explicitly in composer.json and verify with composer why laravel/dusk.composer.lock in the package is normal, but not for you. The package removing its lock file only affects contributors. Your application must commit its own lock file so CI browser jobs are reproducible.phpunit.xml attribute names differ from older Dusk setups. If you copied an old phpunit.dusk.xml, expect warnings or ignored settings — regenerate from dusk:install and re-apply your customisations.--filter, or require-style includes may break. Check your composer.json autoload-dev mapping covers tests/Browser.latest, and re-validate that the Chrome/driver versions inside still match your local Dusk.--browse locally to watch the browser, and add $browser->pause(500) temporarily rather than sprinkling sleep(). Persistent flakiness is almost always a wait-condition problem, not a package bug.Overall: 2.1.0 is mostly a maintenance and tooling release — the dependency narrowing from the full framework to laravel/dusk is the one change that can actually break an install, and it is worth verifying before adopting.
How can I help you explore Laravel packages today?