PHPackages                             playwright-php/playwright - 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. playwright-php/playwright

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

playwright-php/playwright
=========================

Modern PHP library for Playwright automation: browsing, scraping, screenshots, testing, and more.

v1.2.0(3mo ago)19231.1k↑258.8%14[11 issues](https://github.com/playwright-php/playwright/issues)[10 PRs](https://github.com/playwright-php/playwright/pulls)6MITPHPPHP ^8.2CI passing

Since Nov 8Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/playwright-php/playwright)[ Packagist](https://packagist.org/packages/playwright-php/playwright)[ GitHub Sponsors](https://github.com/smnandre)[ RSS](/packages/playwright-php-playwright/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (18)Versions (4)Used By (6)

[![Playwright PHP](https://github.com/playwright-php/.github/raw/main/profile/playwright-php.png)](https://github.com/playwright-php/.github/raw/main/profile/playwright-php.png) [![PHP Version](https://camo.githubusercontent.com/e3c573a800a4c73db9b43cccf5963587c070cfa03efef919406eebf23ce49e6d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d3035393731423f6c6162656c436f6c6f723d30393136314526636f6c6f723d314438443233266c6f676f436f6c6f723d464646464646)](https://camo.githubusercontent.com/e3c573a800a4c73db9b43cccf5963587c070cfa03efef919406eebf23ce49e6d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d3035393731423f6c6162656c436f6c6f723d30393136314526636f6c6f723d314438443233266c6f676f436f6c6f723d464646464646) [![CI](https://camo.githubusercontent.com/7387fa90410e8cbb46a080a93b6d8375ee2c530c2f476d65e38644239a37c014/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706c61797772696768742d7068702f706c61797772696768742f43492e79616d6c3f6272616e63683d6d61696e266c6162656c3d546573747326636f6c6f723d314438443233266c6162656c436f6c6f723d303931363145266c6f676f436f6c6f723d464646464646)](https://camo.githubusercontent.com/7387fa90410e8cbb46a080a93b6d8375ee2c530c2f476d65e38644239a37c014/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706c61797772696768742d7068702f706c61797772696768742f43492e79616d6c3f6272616e63683d6d61696e266c6162656c3d546573747326636f6c6f723d314438443233266c6162656c436f6c6f723d303931363145266c6f676f436f6c6f723d464646464646) [![Release](https://camo.githubusercontent.com/8009742d95161f44acf06fbdd68bc5e390d9655e520b0309e8ee3e5231047aba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f706c61797772696768742d7068702f706c61797772696768743f6c6162656c3d537461626c65266c6162656c436f6c6f723d30393136314526636f6c6f723d314438443233266c6f676f436f6c6f723d464646464646)](https://camo.githubusercontent.com/8009742d95161f44acf06fbdd68bc5e390d9655e520b0309e8ee3e5231047aba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f706c61797772696768742d7068702f706c61797772696768743f6c6162656c3d537461626c65266c6162656c436f6c6f723d30393136314526636f6c6f723d314438443233266c6f676f436f6c6f723d464646464646) [![License](https://camo.githubusercontent.com/6b48abd89b586c692c43e6d35131bb0af2a5b199a2d63384d10d2da9ce69ef80/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706c61797772696768742d7068702f706c61797772696768743f6c6162656c3d4c6963656e7365266c6162656c436f6c6f723d30393136314526636f6c6f723d314438443233266c6f676f436f6c6f723d464646464646)](https://camo.githubusercontent.com/6b48abd89b586c692c43e6d35131bb0af2a5b199a2d63384d10d2da9ce69ef80/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706c61797772696768742d7068702f706c61797772696768743f6c6162656c3d4c6963656e7365266c6162656c436f6c6f723d30393136314526636f6c6f723d314438443233266c6f676f436f6c6f723d464646464646)

Playwright PHP - Modern Browser Automation
==========================================

[](#playwright-php---modern-browser-automation)

About
-----

[](#about)

Playwright for PHP lets you launch real browsers (Chromium, Firefox, WebKit), drive pages and locators, and write reliable end‑to‑end tests — all from PHP.

- **Familiar model**: browser → context → page → locator
- **Auto‑waiting** interactions reduce flakiness
- **PHPUnit integration** with a base trait and fluent `expect()` assertions
- **Cross‑browser**: Chromium, Firefox, and WebKit supported
- No separate server to manage — a lightweight Node server is started for you

Requirements:

- PHP 8.2+
- Node.js 20+ (used by the bundled Playwright server and browsers)

Install
-------

[](#install)

Add the library to your project:

```
composer require playwright-php/playwright
```

Install the Playwright browsers (Chromium, Firefox, WebKit):

```
# Run after composer install in your application or in this repository
vendor/bin/playwright-install --browsers

# On fresh machines/CI where you need Playwright's OS dependencies too
vendor/bin/playwright-install --with-deps

# The same commands apply when you work on this repository
# (the script lives in vendor/bin/playwright-install here too)

# Preview commands without changes
vendor/bin/playwright-install --dry-run --with-deps
```

For advanced install options (including browser cache location), see the [Getting Started guide](docs/guide/getting-started.md).

Quick start
-----------

[](#quick-start)

Open a page and print its title:

```
