PHPackages                             apsonex/laravel-dusk-screenrecordings - 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. apsonex/laravel-dusk-screenrecordings

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

apsonex/laravel-dusk-screenrecordings
=====================================

A package to have screen recordings of Dusk tests

23PHP

Since Sep 9Pushed 2y ago2 watchersCompare

[ Source](https://github.com/apsonex/laravel-dusk-screenrecordings)[ Packagist](https://packagist.org/packages/apsonex/laravel-dusk-screenrecordings)[ RSS](/packages/apsonex-laravel-dusk-screenrecordings/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

About Laravel Dusk Screenrecordings
===================================

[](#about-laravel-dusk-screenrecordings)

Laravel Dusk Screenrecording is a package, that was created by and maintained by [Sander van Kasteel](http://github.com/sandervankasteel/)that enables you to do screenrecording of your Dusk tests.

&lt;INSERT\_EXAMPLE&gt;

Usage
-----

[](#usage)

### Warning: Currently only Chrome is supported

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

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

1. First install the pacakge

```
composer require --dev sandervankasteel/laravel-dusk-screenrecordings

```

2. Publish the configuration

```
php artisan vendor: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 Sandervankasteel\LaravelDuskScreenrecordings\WithScreenRecordings;

abstract class DuskTestCase extends BaseTestCase
{
    use CreatesApplication,
        WithScreenRecordings;

    // 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 screenrecording and then executes the test as usual.

Once the tests are finished, based on the configuration it will 'download' the screenrecording 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

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![gurindersingh](https://avatars.githubusercontent.com/u/6223752?v=4)](https://github.com/gurindersingh "gurindersingh (1 commits)")

### Embed Badge

![Health badge](/badges/apsonex-laravel-dusk-screenrecordings/health.svg)

```
[![Health](https://phpackages.com/badges/apsonex-laravel-dusk-screenrecordings/health.svg)](https://phpackages.com/packages/apsonex-laravel-dusk-screenrecordings)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/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.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/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.1k](/packages/orchestra-testbench)

PHPackages © 2026

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