PHPackages                             jackbayliss/laravel-dusk-parallel - 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. jackbayliss/laravel-dusk-parallel

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

jackbayliss/laravel-dusk-parallel
=================================

Parallel test execution for Laravel Dusk.

1.0.1(3mo ago)427[1 PRs](https://github.com/jackbayliss/laravel-dusk-parallel/pulls)MITPHPPHP ^8.1CI passing

Since Feb 26Pushed 2d agoCompare

[ Source](https://github.com/jackbayliss/laravel-dusk-parallel)[ Packagist](https://packagist.org/packages/jackbayliss/laravel-dusk-parallel)[ RSS](/packages/jackbayliss-laravel-dusk-parallel/feed)WikiDiscussions main Synced 3w ago

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

Laravel Dusk Parallel
=====================

[](#laravel-dusk-parallel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9b1663e5d23af3ca83035a4eb27df17851cef1db42e69e6aec07f1b3d794c840/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61636b6261796c6973732f6c61726176656c2d6475736b2d706172616c6c656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jackbayliss/laravel-dusk-parallel)[![Tests](https://camo.githubusercontent.com/2297cdc9b44bee93487d1ffaadc5089fa07e8c6ab5ad079fe3f09035b0930aec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a61636b6261796c6973732f6c61726176656c2d6475736b2d706172616c6c656c2f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/jackbayliss/laravel-dusk-parallel/actions/workflows/ci.yml)[![PHP Version](https://camo.githubusercontent.com/7baddf81e93f0edae6bd52235743c2cefd8872132b52ccc17a7b3c1af3d743d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a61636b6261796c6973732f6c61726176656c2d6475736b2d706172616c6c656c2e7376673f7374796c653d666c61742d737175617265)](composer.json)[![License](https://camo.githubusercontent.com/e4acdbf9ff45174b60746b1a807d9ff3abe5f3fcebe84cfa1de795ee85e8cf14/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a61636b6261796c6973732f6c61726176656c2d6475736b2d706172616c6c656c2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Run your [Laravel Dusk](https://laravel.com/docs/dusk) browser tests in parallel — multiple ChromeDriver instances, one CI runner, faster feedback.

> **This package is currently in beta.** It may not work, so give it a try and create an issue if something is broken - a failing test would be fantastic!

---

Why parallel Dusk tests?
------------------------

[](#why-parallel-dusk-tests)

Dusk tests are slow by nature: each test launches a real browser, navigates to a page, and waits for it to render. A suite of 20–30 tests can easily take several minutes when run sequentially.

The common workaround is splitting tests across multiple CI runners — but that means paying for extra parallel jobs. This package takes a different approach: it runs multiple ChromeDriver instances on the **same** runner, splitting your test suite across them automatically. You get the speed of parallelism without the added infrastructure cost.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10+
- Laravel Dusk 8+
- [ParaTest](https://github.com/paratestphp/paratest) (`brianium/paratest`)

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

[](#installation)

```
composer require --dev jackbayliss/laravel-dusk-parallel
composer require --dev brianium/paratest
```

Setup
-----

[](#setup)

### 1. Start ChromeDriver instances

[](#1-start-chromedriver-instances)

You need one ChromeDriver instance per parallel process. By default the package assigns ports starting from `9515`. Start a few more than you intend to use, as ParaTest's token assignment can vary by environment:

```
chromedriver --port=9515 &
chromedriver --port=9516 &
chromedriver --port=9517 &
chromedriver --port=9518 &
```

### 2. Run your tests

[](#2-run-your-tests)

```
php artisan dusk:parallel
```

By default this uses 2 parallel processes. Pass `--processes` to change it:

```
php artisan dusk:parallel --processes=4
```

Configuration
-------------

[](#configuration)

### Changing the base port

[](#changing-the-base-port)

If port `9515` is already in use, set `DUSK_DRIVER_BASE_PORT` in your `.env`:

```
DUSK_DRIVER_BASE_PORT=9600
```

Worker processes will use ports `9600`, `9601`, etc. Remember to start ChromeDriver on those ports.

### Using a remote WebDriver

[](#using-a-remote-webdriver)

For Selenium Grid, BrowserStack, or any other remote WebDriver, set `DUSK_DRIVER_URL` and the port logic is bypassed entirely:

```
DUSK_DRIVER_URL=http://selenium-grid:4444
```

### Customising Chrome options

[](#customising-chrome-options)

Extend the package's `TestCase` in your `tests/DuskTestCase.php` and override the `driver()` method:

```
use JackBayliss\DuskParallel\ParallelDriver;
use JackBayliss\DuskParallel\TestCase as ParallelTestCase;

abstract class DuskTestCase extends ParallelTestCase
{
    protected function driver(): RemoteWebDriver
    {
        $options = (new ChromeOptions)->addArguments([
            '--headless=new',
            '--no-sandbox',
            '--disable-dev-shm-usage',
        ]);

        return RemoteWebDriver::create(
            ParallelDriver::resolveDriverUrl(),
            DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY,
                $options
            )
        );
    }
}
```

> Extending the package's `TestCase` is optional — it works with a standard Laravel Dusk setup out of the box.

CI — GitHub Actions
-------------------

[](#ci--github-actions)

```
- name: Start ChromeDriver instances
  run: |
    chromedriver --port=9515 &
    chromedriver --port=9516 &
    chromedriver --port=9517 &
    chromedriver --port=9518 &
    sleep 2

- name: Run Dusk tests
  run: php artisan dusk:parallel --processes=2
```

All ChromeDriver instances run on the same runner, so there is no additional CI cost compared to running Dusk sequentially.

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

[](#how-it-works)

ParaTest splits your test suite across multiple worker processes. Each worker receives a `TEST_TOKEN` environment variable (`0`, `1`, `2` …) which the package uses to:

1. Route that worker's ChromeDriver to a unique port (`basePort + TEST_TOKEN`).
2. Set a `dusk_db_token` cookie on the browser so every HTTP request is handled by the correct per-worker test database.

Each worker gets a fully independent browser session and database — all within a single CI job.

Available commands
------------------

[](#available-commands)

ScriptDescription`composer test`Run the test suite`composer lint`Fix code style with Pint`composer analyse`Static analysis with PHPStanExample project
---------------

[](#example-project)

See [dusk-parallel-demo](https://github.com/jackbayliss/dusk-parallel-demo) for a working Laravel application with passing parallel Dusk tests and a complete GitHub Actions workflow.

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

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

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

119d ago

Major Versions

0.0.1 → 1.0.02026-02-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/79e2e2281e64b7800db09d468ce14156b604138636efd6f85c7b6b8d2f0994b7?d=identicon)[jackbayliss](/maintainers/jackbayliss)

---

Top Contributors

[![jackbayliss](https://avatars.githubusercontent.com/u/13621738?v=4)](https://github.com/jackbayliss "jackbayliss (36 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

testinglaravelparalleldusk

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jackbayliss-laravel-dusk-parallel/health.svg)

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

###  Alternatives

[code-distortion/adapt

A Laravel package that builds databases for your tests, improving their speed.

2837.1k](/packages/code-distortion-adapt)[derekmd/laravel-dusk-firefox

Run Laravel Dusk tests in a Firefox browser

4885.1k1](/packages/derekmd-laravel-dusk-firefox)[appstract/laravel-dusk-safari

Run Dusk tests on Safari

117.8k](/packages/appstract-laravel-dusk-safari)

PHPackages © 2026

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