playwright-php / playwright-mink
Mink driver powered by Playwright PHP (Chromium/Firefox/WebKit).
Fund package maintenance!
Requires
- php: ^8.2
- behat/mink: ^1.10
- playwright-php/playwright: ^1.0
Requires (Dev)
- mink/driver-testsuite: dev-master
- phpunit/phpunit: ^8.5.22 || ^9.5.11
This package is auto-updated.
Last update: 2026-07-25 19:07:09 UTC
README
Playwright PHP Mink Driver
A Mink driver powered by Playwright PHP.
Use it to keep an existing Mink test suite while running its browser interactions in Chromium, Firefox, or WebKit through Playwright.
Installation
The driver requires PHP 8.2 or later, Mink 1.10 or later, and Playwright PHP 1.x.
composer require --dev playwright-php/playwright-mink vendor/bin/playwright-install --browsers
Usage
Create the driver, pass it to a Mink session, and use the regular Mink API:
<?php use Behat\Mink\Session; use Playwright\Mink\Driver\PlaywrightDriver; $driver = new PlaywrightDriver( browserType: 'chromium', headless: true, ); $session = new Session($driver); $session->start(); try { $session->visit('https://example.com'); echo $session->getPage()->getText(); } finally { $session->stop(); }
The constructor accepts:
browserType:chromium,firefox, orwebkit;headless: whether to run without a visible browser window;launchOptions: browser launch options such asslowMoandargs;contextOptions: options passed to the Playwright browser context.
$driver = new PlaywrightDriver( browserType: 'firefox', headless: false, launchOptions: [ 'slowMo' => 100, ], contextOptions: [ 'viewport' => ['width' => 1440, 'height' => 900], 'locale' => 'en-US', ], );
See Driver support for the tested Mink surface and known limitations.
Testing
The driver is tested against the official
minkphp/driver-testsuite.
Install dependencies, start its test server, then run PHPUnit:
composer install vendor/bin/playwright-install --browsers vendor/bin/mink-test-server
In another terminal:
vendor/bin/phpunit
The test suite currently excludes scenarios that depend on jQuery UI drag and drop or asynchronous popup discovery. These limitations are documented in Driver support.
License
Playwright PHP Mink Driver is released under the MIT License.