PHPackages                             joshhanley/livewire-dusk-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. joshhanley/livewire-dusk-extension

ActiveLibrary[Testing &amp; Quality](/categories/testing)

joshhanley/livewire-dusk-extension
==================================

A Laravel Dusk testing helper extension for testing Livewire components.

v0.3.0(3y ago)21.0k1MITPHPPHP ^7.4|^8.0

Since Sep 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/joshhanley/livewire-dusk-extension)[ Packagist](https://packagist.org/packages/joshhanley/livewire-dusk-extension)[ RSS](/packages/joshhanley-livewire-dusk-extension/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Livewire Dusk Extension
=======================

[](#livewire-dusk-extension)

Livewire Dusk Extension adds support for testing individual Livewire components in your app with Laravel Dusk.

Getting Started
---------------

[](#getting-started)

It's recommended you read the documentation of these packages before going through this document:

- [Livewire](https://laravel-livewire.com/docs)
- [Laravel Dusk](https://laravel.com/docs/dusk)

Installation
------------

[](#installation)

To install through composer, run the following command from terminal:

```
composer require --dev joshhanley/livewire-dusk-extension
```

Usage
-----

[](#usage)

To use this package you need to:

### Ensure Laravel Dusk is installed and configured

[](#ensure-laravel-dusk-is-installed-and-configured)

Ensure Laravel Dusk is installed and configured as per the [Laravel Dusk documentation](https://laravel.com/docs/dusk)

### Update DuskTestCase

[](#update-dusktestcase)

Laravel Dusk creates a file `tests\DuskTestCase.php` which needs to be updated to extend `LivewireDuskExtension`

```
use LivewireDuskExtension\LivewireDuskExtensionTestCase;

abstract class DuskTestCase extends LivewireDuskExtensionTestCase
```

### Configure Tests Directory and Namespace

[](#configure-tests-directory-and-namespace)

This package assumes you have a `tests\Browser` directory at the root of your project and that it's namespace is `Tests\Browser`.

If you have a different configuration, you can publish the Livewire Dusk Extension config and specify your tests namespaces and directories.

To publish the config run

```
php artisan vendor:publish --provider="LivewireDuskExtension\LivewireDuskExtensionServiceProvider"
```

Then open the config and update the `test-directories` array with your tests namespace and directory details, with the namespace being the key and the directory is the value.

```
'test-directories' => [
    'My\\Custom\\Namespace' => base_path('my/custom/namespace'),
],
```

### Create a Test

[](#create-a-test)

You can now create a dusk test that uses `$browser->livewire()` to test your component.

To do this, pass the class name of the component you want to test into the `$browser->livewire()` method.

Then you can chain assertions from the `livewire()` call.

```
public function testExample()
{
    $this->browse(function (Browser $browser) {
        $browser->livewire(SampleComponent::class)
            ->assertSee('Sample!');
    });
}
```

### Using a Test Component

[](#using-a-test-component)

If you don't want to test a Livewire component that exists in your app, and instead want to test something like a Blade Component that has Livewire interactivity, then you can create a test Livewire component.

In the same directory as your test, create a Livewire component and reference that in your test. This package will autoload the component for you.

Then in your test component you can include any Blade Components or Alpine, etc that you want to test out.

Troubleshooting
---------------

[](#troubleshooting)

This is just a convenience wrapper around Laravel Dusk to make testing Livewire Components in your app easier.

Consult the documentation for the relevant packages for troubleshooting.

- [Livewire](https://laravel-livewire.com/docs)
- [Laravel Dusk](https://laravel.com/docs/dusk)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1396d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4ad7053094ebecf63993d76e363d37d39ad322351abb57bdf1727f39222ea68?d=identicon)[joshhanley](/maintainers/joshhanley)

---

Top Contributors

[![joshhanley](https://avatars.githubusercontent.com/u/882837?v=4)](https://github.com/joshhanley "joshhanley (12 commits)")

### Embed Badge

![Health badge](/badges/joshhanley-livewire-dusk-extension/health.svg)

```
[![Health](https://phpackages.com/badges/joshhanley-livewire-dusk-extension/health.svg)](https://phpackages.com/packages/joshhanley-livewire-dusk-extension)
```

###  Alternatives

[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)[tomasvotruba/bladestan

PHPStan rule for static analysis of Blade templates

368724.8k6](/packages/tomasvotruba-bladestan)[orchestra/testbench-dusk

Laravel Dusk Testing Helper for Packages Development

1061.0M205](/packages/orchestra-testbench-dusk)[filament/support

Core helper methods and foundation code for all Filament packages.

2331.0M245](/packages/filament-support)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[yajra/laravel-datatables-export

Laravel DataTables Queued Export Plugin.

362.2M4](/packages/yajra-laravel-datatables-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
