Made in JS. Unleashed in PHP.
Real browsers.From PHP.
A synchronous, typed PHP API for Chromium, Firefox, and WebKit, with web-first assertions and trace-based debugging.
$
composer require playwright-php/playwright
Target what users see.
Use roles and labels instead of coupling tests to DOM structure. Each action resolves the current page and waits for its own preconditions.
Read the locators guide →<?php
$page->getByRole('button', ['name' => 'Sign in'])->click();
$page->getByLabel('Email')->fill('ada@example.com');
$page->getByText('Welcome back')->waitFor();Assert the outcome.
Web-first assertions re-read the page until the expected state appears or the timeout is reached.
Read the assertions guide →<?php
expect($locator)->toBeVisible(); // retries
expect($locator)->toContainText('Saved');
expect($page)->toHaveTitle('Dashboard');Bring the failure home.
Save DOM snapshots, network activity, console output, and screenshots in one trace archive from the failed run.
Read the debugging guide →$context->tracing()->start([
'snapshots' => true,
'screenshots' => true,
]);
// ... the test ...
$context->tracing()->stop([
'path' => 'trace.zip',
]);Real browsers, inside Symfony.
Route browser requests through the test kernel. Prepare state with application services, then combine Playwright assertions with Symfony responses and profiler data.
$page = $this->visit('/account');
$this->assertResponseIsSuccessful();
expect($page->getByRole('heading', [
'name' => 'Account',
]))->toBeVisible();Fits existing PHP workflows.
Run browser tests in PHPUnit, keep valuable Mink suites moving, and prepare GitHub Actions runners with a focused setup step.
Add focused capabilities.
Bring device profiles, accessibility audits, and performance budgets into the same browser runs.