Download the PHP package playwright-php/playwright-symfony without Composer
On this page you can find all versions of the php package playwright-php/playwright-symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download playwright-php/playwright-symfony
More information about playwright-php/playwright-symfony
Files in playwright-php/playwright-symfony
Package playwright-symfony
Short Description Playwright PHP integration for Symfony BrowserKit, DomCrawler and WebTestCase
License MIT
Informations about the package playwright-symfony


[](https://packagist.org/packages/playwright-php/playwright-symfony)

Playwright PHP for Symfony
Run real-browser Symfony tests while routing application requests through the kernel in the same PHP process.
[!IMPORTANT] This package is in active development. Its public API may change before 1.0.
Installation
Requirements:
- PHP 8.2+
- Symfony 6.4, 7.x, or 8.x
- Node.js 20+
Register the bundle for the test environment:
The bundle works without additional configuration. To change the base URL or intercepted hosts:
Quick Start
Extend PlaywrightTestCase, visit an application route, and use the regular Playwright page API:
Run the test with PHPUnit:
Set PLAYWRIGHT_HEADLESS=false to see the browser, or PLAYWRIGHT_BROWSER=firefox to use another engine.
How It Works
For requests to an intercepted host, the package:
- Intercepts the browser request through Playwright.
- Converts it to a Symfony request.
- Handles it with the application kernel.
- Returns the Symfony response to the browser.
This keeps JavaScript, CSS, navigation, cookies, and browser storage in a real browser while preserving access to the Symfony test container, request, response, and profiler.
The kernel and browser start lazily when a browser helper or client is first used.
Static files and AssetMapper output can be served directly by the asset bridge without passing through the kernel.
Multiple browser clients
Use the primary client alongside fresh clients when a test needs isolated browser contexts:
The clients share the browser process and Symfony kernel, but not cookies or browser storage.
Authentication
Use loginUser() when login itself is not under test:
The package also provides cookie helpers and access to the last intercepted request and response.
Limits
PlaywrightTestCaseis for browser navigation. Prefervisit()and the Playwright page API over direct BrowserKit requests.- Only configured hosts are routed through the Symfony kernel. Other requests use the browser network normally.
- Browser tests are slower than unit and functional tests. Keep them in a dedicated PHPUnit suite or group.
Documentation
- Getting started
- Configuration
- Test helpers
- Asset development server
- Continuous integration
- Architecture
Contributing
Contributions are welcome. Before submitting a pull request, run:
Changes to public behavior should include tests and documentation.
License
Playwright PHP for Symfony is released under the MIT License.
All versions of playwright-symfony with dependencies
playwright-php/playwright Version ^1.5
symfony/browser-kit Version ^6.4 || ^7.0 || ^8.0
symfony/framework-bundle Version ^6.4 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0