PHPackages                             testflowlabs/pest-plugin-bridge - 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. testflowlabs/pest-plugin-bridge

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

testflowlabs/pest-plugin-bridge
===============================

Pest plugin for browser testing external frontend applications

3917↑542.9%PHPCI passing

Since Dec 29Pushed 6mo agoCompare

[ Source](https://github.com/TestFlowLabs/pest-plugin-bridge)[ Packagist](https://packagist.org/packages/testflowlabs/pest-plugin-bridge)[ RSS](/packages/testflowlabs-pest-plugin-bridge/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

 [![Pest Bridge Plugin](docs/public/logo.svg)](docs/public/logo.svg)

Pest Bridge Plugin
==================

[](#pest-bridge-plugin)

 [![Tests](https://github.com/TestFlowLabs/pest-plugin-bridge/actions/workflows/tests.yml/badge.svg)](https://github.com/TestFlowLabs/pest-plugin-bridge/actions) [![License](https://camo.githubusercontent.com/659aa264be7b7ccdfd305108697fc484b27640a567b4f1d1a739f06b0552045d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f54657374466c6f774c6162732f706573742d706c7567696e2d627269646765)](LICENSE)

 Test external frontends from Laravel — write browser tests in PHP for Vue, React, Nuxt, Next.js.

 [**Documentation**](https://bridge.testflowlabs.dev) · [**Getting Started**](https://bridge.testflowlabs.dev/getting-started/quick-start)

The Problem
-----------

[](#the-problem)

You have a **headless Laravel API** and a **separate frontend** (Vue, Nuxt, React, Next.js). Two apps, two ports, two problems:

- Your **tests can't reach** the frontend
- Your **frontend can't find** the API during tests

The Solution
------------

[](#the-solution)

Pest Bridge Plugin solves both directions:

```
// test → frontend: bridge() visits the external frontend
$this->bridge('/login')->assertSee('Welcome');

// frontend → API: automatic environment variable injection
// VITE_API_URL, NUXT_PUBLIC_API_BASE, NEXT_PUBLIC_API_URL, etc.
```

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

[](#installation)

```
composer require testflowlabs/pest-plugin-bridge --dev
```

> Requires [pestphp/pest-plugin-browser](https://github.com/pestphp/pest-plugin-browser)

Quick Start
-----------

[](#quick-start)

```
// tests/Pest.php
use TestFlowLabs\PestPluginBridge\Bridge;

Bridge::add('http://localhost:3000')
    ->serve('npm run dev', cwd: '../frontend');
```

```
// tests/Browser/LoginTest.php
test('user can login', function () {
    $user = User::factory()->create(['email' => 'test@example.com']);

    $this->bridge('/login')
        ->typeSlowly('[data-testid="email"]', 'test@example.com')
        ->typeSlowly('[data-testid="password"]', 'password')
        ->click('[data-testid="submit"]')
        ->waitForEvent('networkidle')
        ->assertPathContains('/dashboard');
});
```

Features
--------

[](#features)

### Automatic Server Management

[](#automatic-server-management)

Frontend starts on first `bridge()` call, stops when tests complete. No manual server management.

```
Bridge::add('http://localhost:3000')
    ->serve('npm run dev', cwd: '../frontend')
    ->readyWhen('VITE.*ready');
```

### Multiple Bridged Frontends

[](#multiple-bridged-frontends)

Test multiple frontends in one suite. Child frontends share the parent's server process.

```
Bridge::add('http://localhost:3000');                  // Default
Bridge::add('http://localhost:3001', 'admin')
    ->child('/analytics', 'analytics')                 // Same server, /analytics path
    ->serve('npm run dev', cwd: '../admin');
```

```
$this->bridge('/products');                            // Default frontend
$this->bridge('/users', 'admin');                      // Admin frontend
$this->bridge('/', 'analytics');                       // Child of admin
```

### Multi-Repository CI/CD

[](#multi-repository-cicd)

GitHub Actions checks out both repos side-by-side. Works with private repos.

```
- uses: actions/checkout@v4
  with: { path: backend }
- uses: actions/checkout@v4
  with: { repository: your-org/frontend, path: frontend }
```

### Vue/React Compatible

[](#vuereact-compatible)

`typeSlowly()` triggers real keyboard events that Vue v-model and React hooks respond to.

```
// fill() sets DOM directly — Vue won't see it
// typeSlowly() fires keydown/input/keyup events
->typeSlowly('[data-testid="email"]', 'test@example.com')
```

Documentation
-------------

[](#documentation)

For complete guides, examples, and CI/CD workflows:

**[bridge.testflowlabs.dev](https://bridge.testflowlabs.dev)**

- [Introduction](https://bridge.testflowlabs.dev/getting-started/introduction) — How it works
- [Configuration](https://bridge.testflowlabs.dev/guide/configuration) — All options
- [CI/CD Setup](https://bridge.testflowlabs.dev/ci-cd/introduction) — GitHub Actions
- [Troubleshooting](https://bridge.testflowlabs.dev/guide/troubleshooting) — Common issues

Development
-----------

[](#development)

```
composer install
composer test
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance47

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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://avatars.githubusercontent.com/u/3030815?v=4)[Yunus Emre Deligöz](/maintainers/deligoez)[@deligoez](https://github.com/deligoez)

---

Top Contributors

[![deligoez](https://avatars.githubusercontent.com/u/3030815?v=4)](https://github.com/deligoez "deligoez (118 commits)")

---

Tags

browsere2e-testsfrontendpestplugintesting

### Embed Badge

![Health badge](/badges/testflowlabs-pest-plugin-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/testflowlabs-pest-plugin-bridge/health.svg)](https://phpackages.com/packages/testflowlabs-pest-plugin-bridge)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

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