orchestra/testbench-dusk
Helper for testing Laravel packages with Laravel Dusk. Provides a Testbench-based setup to run browser tests in a package development workflow, maintained under the Orchestra namespace with ongoing support and community contributions.
tweakApplication() → beforeServingApplication()) to mock dependencies, making it ideal for packages with complex Laravel integrations (e.g., service providers, middleware, or event listeners).--disable-search-engine-choice-screen, --disable-smooth-scrolling), reducing flakiness in CI/CD pipelines—a high-value feature for automated testing.vendor detection in default Testbench skeletons, streamlining boilerplate setup.tweakApplication() are deprecated in favor of beforeServingApplication(), requiring refactoring in existing test suites.composer require --dev orchestra/testbench-dusk
tweakApplication() with beforeServingApplication() in existing tests.Orchestra\TestbenchDusk\TestCase for Dusk-specific tests:
use Orchestra\TestbenchDusk\TestCase;
class ExampleTest extends TestCase {
public function test_package_ui() {
$this->browse(function (Browser $browser) {
$browser->visit('/package-route')
->assertSee('Expected UI Element');
});
}
}
DUSK_BROWSER=chrome)..env:
DUSK_CHROME_ARGS="--disable-search-engine-choice-screen --disable-smooth-scrolling"
jobs:
test-dusk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
- run: composer install
- run: composer test-dusk
orchestra/testbench compatibility).tweakApplication() calls (breaking change).114.0.5735.90 for Dusk v8.5.0).wait() methods, retry logic, or exclude flaky tests.large or xlarge).only: ['@dusk']).| Failure Type | Root Cause | Impact | Mitigation |
|---|---|---|---|
| Dusk Test Flakiness | Network latency, race conditions | Intermittent test failures | Retry logic, wait() methods |
| **ChromeDriver Mism |
How can I help you explore Laravel packages today?