PHPackages                             skylerkatz/phpunit-plugin-browser - 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. skylerkatz/phpunit-plugin-browser

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

skylerkatz/phpunit-plugin-browser
=================================

PHPUnit extension for browser testing with Playwright

v0.0.3(3mo ago)00MITPHPPHP ^8.3

Since Mar 24Pushed 3mo agoCompare

[ Source](https://github.com/skylerkatz/phpunit-plugin-browser)[ Packagist](https://packagist.org/packages/skylerkatz/phpunit-plugin-browser)[ RSS](/packages/skylerkatz-phpunit-plugin-browser/feed)WikiDiscussions main Synced 3w ago

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

PHPUnit Browser Plugin
======================

[](#phpunit-browser-plugin)

A PHPUnit extension for browser testing powered by [Playwright](https://playwright.dev/).

> **Attribution:** This package is a port of [pestphp/pest-plugin-browser](https://github.com/pestphp/pest-plugin-browser) by [Nuno Maduro](https://github.com/nunomaduro) and the Pest team. Full credit goes to the original authors for the API design and Playwright integration. This package adapts that work for use with PHPUnit directly.

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

[](#requirements)

- PHP 8.3+
- `ext-sockets`
- PHPUnit 11+
- Node.js (required for Playwright)

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

[](#installation)

Install via Composer:

```
composer require --dev skylerkatz/phpunit-plugin-browser
```

Install Playwright browsers:

```
npx playwright install --with-deps
```

PHPUnit Configuration
---------------------

[](#phpunit-configuration)

Register the extension in your `phpunit.xml`:

```

```

You can pass optional parameters directly in the bootstrap:

```

```

Writing Tests
-------------

[](#writing-tests)

Extend `BrowserTestCase` and use `$this->visit()` to open a page:

### Basic Example

[](#basic-example)

```
