playwright-php/playwright-mink

Mink driver powered by Playwright PHP (Chromium/Firefox/WebKit).

Maintainers

Package info

github.com/playwright-php/playwright-mink

Homepage

pkg:composer/playwright-php/playwright-mink

Transparency log

Fund package maintenance!

smnandre

Statistics

Installs: 154

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 2

v1.0.0 2025-11-08 13:43 UTC

This package is auto-updated.

Last update: 2026-07-25 19:07:09 UTC


README

Playwright PHP

  PHP Version   CI   Release   License

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, or webkit;
  • headless: whether to run without a visible browser window;
  • launchOptions: browser launch options such as slowMo and args;
  • 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.