Download the PHP package playwright-php/playwright without Composer
On this page you can find all versions of the php package playwright-php/playwright. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download playwright-php/playwright
More information about playwright-php/playwright
Files in playwright-php/playwright
Package playwright
Short Description Modern PHP library for Playwright automation: browsing, scraping, screenshots, testing, and more.
License MIT
Informations about the package playwright




Playwright PHP
Automate Chromium, Firefox, and WebKit from PHP for browser testing, scraping, screenshots, and other browser-driven workflows.
- Familiar browser, context, page, and locator model
- Auto-waiting interactions
- PHPUnit integration with fluent
expect()assertions - No separate server to manage: the package starts its bundled Node server
Requirements:
- PHP 8.2+
- Node.js 20+ (used by the bundled Playwright server and browsers)
Installation
Add the library to your project:
Install the Playwright browsers (Chromium, Firefox, WebKit):
For targeted installation, browser cache location, and Chrome or Edge channels, see Browsers, Browser Types, and Channels.
Quick Start
Open a page and print its title:
Documentation
- Quick Start Guide
- Playwright Inspector
- Contributing: Testing
Usage
Browser
- Choose a browser:
Playwright::chromium(),Playwright::firefox(), orPlaywright::webkit(). Playwright::safari()is an alias ofwebkit().- Common launch options:
headless(bool),slowMo(ms),args(array of CLI args), and an optionalcontextarray with context options.
Page
Create pages, navigate, evaluate scripts, and take screenshots:
Locators and interactions
Storage state and context reuse
PHPUnit integration
The package provides a testing trait and fluent expect() assertions to write robust E2E tests.
Requirements: PHPUnit 10.0 or higher is required to use the PlaywrightTestCaseTrait.
Minimal example:
Notes:
- The trait provides
$this->playwright,$this->browser,$this->context, and$this->pageproperties. - Call
setUpPlaywright()insetUp()andtearDownPlaywright()intearDown()for proper lifecycle management. - Use
$this->expect($locator)or$this->expect($page)for fluent assertions with auto-waiting. - If you prefer full control, you can skip the trait and use the static
Playwrightfacade directly.
GitHub Actions
Example workflow snippet:
Tips:
- Cache Node and Composer if you need faster builds.
- You can also cache Playwright browsers under
~/.cache/ms-playwright.
Contributing
Include tests for behavior changes and update documentation or examples when their public behavior changes. Set up the repository with:
See docs/contributing/testing.md for more details on the local workflow.
License
This package is released by the Playwright PHP project under the MIT License. See the LICENSE file for details.
All versions of playwright with dependencies
psr/clock Version ^1.0
psr/log Version ^2.0 || ^3.0
symfony/console Version ^6.4 || ^7.3 || ^8.0
symfony/process Version ^6.4 || ^7.3 || ^8.0