A Mink driver powered by Playwright PHP.
Important
This package is experimental. Its API may still change before the upcoming 1.0
release.
Curious or interested? Try it out, share your feedback, or ideas!
- Run real browsers: Chromium, Firefox, WebKit (headless or not)
- Control the DOM: navigation, forms, cookies, JS, events
- Handle windows, iframes, uploads, screenshots, dialogs
Requirements
- PHP 8.2 or higher
- Playwright PHP
Install the driver
composer require --dev playwright-php/playwright-mink
use Behat\Mink\Session;
use Playwright\Mink\Driver\PlaywrightDriver;
$driver = new PlaywrightDriver(browserType: 'chromium', headless: true);
$session = new Session($driver);
$session->start();
$session->visit('https://example.org');
echo $session->getPage()->getText();
$session->stop();
This driver is validated against the official minkphp/driver-testsuite
.
Test Results: 212/218 tests passing (97.2%) with 491 assertions
Start the test server
vendor/bin/mink-test-server
Run tests
vendor/bin/phpunit
6 tests are skipped due to known limitations:
- jQuery UI Drag & Drop (2 tests): jQuery UI uses mouse events API, Playwright uses HTML5 Drag & Drop API - these are incompatible
- Popup Window Tracking (4 tests): Async event timing with
window.open()
requires improvements in Playwright PHP event handling
This package is released by the Playwright PHP project under the MIT License. See the LICENSE file for details.