PHPackages                             brianclogan/dusk-recordings - 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. brianclogan/dusk-recordings

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

brianclogan/dusk-recordings
===========================

Record your dusk tests even when headless.

0168[1 PRs](https://github.com/brianclogan/dusk-recording/pulls)PHP

Since Dec 30Pushed 3y agoCompare

[ Source](https://github.com/brianclogan/dusk-recording)[ Packagist](https://packagist.org/packages/brianclogan/dusk-recordings)[ RSS](/packages/brianclogan-dusk-recordings/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

About Dusk Recordings
=====================

[](#about-dusk-recordings)

This packge is forked from [Sander van Kasteel's](https://github.com/sandervankasteel/) [Laravel Dusk Screenrecordings](https://github.com/sandervankasteel/laravel-dusk-screenrecordings).

This update brings it to the current versions of Laravel, and is being worked on to include Firefox and Edge support.

Usage
-----

[](#usage)

### Warning: Currently only Chrome is supported

[](#warning-currently-only-chrome-is-supported)

> **Requires [PHP 8.0+](https://php.net/releases/)**
>
> **Requires Laravel 8 (or higher)**

1. First install the pacakge

```
composer require --dev brianclogan/dusk-recordings

```

2. Publish the configuration

```
php artisan recordings:publish

```

3. Modify your `tests/DuskTestcase.php` to have screen recordings work.

### Example implmentation

[](#example-implmentation)

```
    protected function driver()
    {
        $options = (new ChromeOptions)
            ->setExperimentalOption("prefs", [
                "download.default_directory" => $this->downloadDir
            ])
        ->addArguments(collect([
            '--window-size=1920,1080',
        ])->unless($this->hasHeadlessDisabled(), function ($items) {
            return $items->merge([
                '--disable-gpu',
                '--headless',
            ]);
        })->merge(
            $this->getChromeArgs()
        )->all());

        return RemoteWebDriver::create(
            $_ENV['DUSK_DRIVER_URL'] ?? 'http://localhost:9515',
            DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY, $options
            )
        );
    }
```

The most important parts are the

```
$this->getChromeArgs()
```

and the

```
->setExperimentalOption("prefs", [
    "download.default_directory" => $this->downloadDir
])
```

Firstly, we need to get a specific set of arguments, so that Chrome will allow us to record from an non-HTTPS source and automatically select the source from which to record from.

Lastly, we need to set `download.default_directory` to a known directory, so we know from which directory we need to move our recordings from.

4. Add the `WithScreenRecordings` to your `tests/DuskTestCase.php`, so we will actually record and store the recordings.

```
use Brianclogan\DuskRecordings\WithDuskRecordings;

abstract class DuskTestCase extends BaseTestCase
{
    use CreatesApplication,
        WithDuskRecordings;

    // Rest of your DuskTestCase
}
```

5. Run `php artisan dusk` to see it in action 🥳 🚀

How it works
------------

[](#how-it-works)

This package works by loading a browser plugin, which in turns creates a new (pinned) tab in the browser, then it initializes the recording and then executes the test as usual.

Once the tests are finished, based on the configuration it will 'download' the recording from the tab created by the browser extension.

TODO
----

[](#todo)

- Add Firefox support
- Fix `--auto-select-desktop-capture-source` argument under Linux
- Ideal case scenario: enable window recording (instead of the full desktop).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 73.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/093f0f4c952fb410a2324eb9acfa28d8a9bd44ed9158bce0b336fec77a674820?d=identicon)[brianclogan](/maintainers/brianclogan)

---

Top Contributors

[![brianclogan](https://avatars.githubusercontent.com/u/9066551?v=4)](https://github.com/brianclogan "brianclogan (11 commits)")[![sandervankasteel](https://avatars.githubusercontent.com/u/17492906?v=4)](https://github.com/sandervankasteel "sandervankasteel (4 commits)")

### Embed Badge

![Health badge](/badges/brianclogan-dusk-recordings/health.svg)

```
[![Health](https://phpackages.com/badges/brianclogan-dusk-recordings/health.svg)](https://phpackages.com/packages/brianclogan-dusk-recordings)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M679](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M753](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M571](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.0k](/packages/orchestra-testbench)

PHPackages © 2026

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