Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Testbench Dusk

Testbench Dusk Laravel Package

orchestra/testbench-dusk

Laravel Dusk testing helper for package development. Orchestra Testbench Dusk lets you write browser tests for your Laravel packages, bootstrapping a test application with Dusk support so you can verify real user interactions end to end.

View on GitHub
Deep Wiki
Context7

Orchestra Testbench Dusk is a helper package for writing Laravel Dusk browser tests for your Laravel packages. It pairs Dusk's browser automation with Testbench, so you can test package routes, views, and UI without scaffolding a full application.

  • Run real browser tests against your package's routes and views
  • Seamless Testbench integration for package development
  • Built on Laravel Dusk and ChromeDriver
  • Headless testing support for CI pipelines
  • Lightweight setup with no full Laravel app required
Frequently asked questions about Testbench Dusk
What is orchestra/testbench-dusk used for?
It is a Laravel Dusk testing helper for Laravel package development. It combines Testbench with Dusk so package authors can run browser-based end-to-end tests without building a full Laravel application. It is maintained under the Orchestra namespace and is intended for package test suites, not application testing.
How do I install orchestra/testbench-dusk?
Install it with Composer as a development dependency, for example composer require --dev orchestra/testbench-dusk. You also need compatible Testbench and Laravel Dusk versions in your package's dev dependencies. After installation, extend Orchestra\TestbenchDusk\TestbenchDuskTestCase in your Dusk test classes.
Which Laravel versions does orchestra/testbench-dusk support?
The package is intended to work with the Laravel and Testbench versions it declares in its Composer constraints, with the assessment noting Testbench v11+ and Dusk v8.3.5+ aligned with Laravel 10/11/13. Because Laravel and Dusk evolve quickly, check the package's composer.json and release notes before upgrading. PHP 8.5+ compatibility is noted for future-proofing in the assessment.
How do I write a Dusk browser test for a Laravel package with Testbench Dusk?
Create a test class that extends Orchestra\TestbenchDusk\TestbenchDuskTestCase and use Dusk's browse method to visit routes and make assertions. You can override beforeServingApplication to adjust package configuration or service providers before the test application boots. Place these tests in a dedicated directory such as tests/Dusk.
Do I need ChromeDriver to use Testbench Dusk?
Yes, because Testbench Dusk builds on Laravel Dusk, which traditionally relies on ChromeDriver for browser automation. Your local and CI environments need a compatible Chrome or Chromium binary and driver setup. The assessment notes that a future Dusk migration to Playwright could affect this requirement, so monitor Dusk release notes.
How do I override package configuration in Testbench Dusk tests?
Use the beforeServingApplication hook in your TestbenchDuskTestCase subclass to change configuration before the application is served. For example, call config(['my-package.setting' => true]) inside that method. This replaces older approaches such as tweakApplication, which the assessment notes is deprecated in favor of beforeServingApplication.
Is orchestra/testbench-dusk production ready?
It is a development-only testing helper, so it is not something you ship in production code. The README describes it as early development, and the assessment notes limited adopters and possible undocumented edge cases. Use it for package test suites, pin compatible versions, and review changes before upgrading.
How is Testbench Dusk different from Laravel Dusk?
Laravel Dusk is the browser testing tool for Laravel applications, while Testbench Dusk adapts Dusk for package development using Testbench's package bootstrapping. It reduces boilerplate for serving a test application and configuring package providers during browser tests. You still use Dusk's browser APIs and assertions in your tests.
Can I run Testbench Dusk tests in GitHub Actions?
Yes, but you need to set up a browser and driver in the CI environment, such as headless Chrome/Chromium with ChromeDriver. The assessment includes an example using google-chrome headless and CHROME_BIN with DUSK_DRIVER=chrome. Run these Dusk tests separately from or alongside your unit tests, and consider parallelization for larger suites.
What are alternatives to orchestra/testbench-dusk for Laravel package testing?
For non-browser tests, use Testbench Core, PHPUnit, or Pest to test service providers, facades, and package logic. For browser tests, you can set up native Laravel Dusk in a test application or use other E2E tools. Testbench Dusk is most useful when you want Dusk browser coverage without maintaining a full Laravel app skeleton.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections