Download the PHP package codeception/module-playwright without Composer
On this page you can find all versions of the php package codeception/module-playwright. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codeception/module-playwright
More information about codeception/module-playwright
Files in codeception/module-playwright
Package module-playwright
Short Description Playwright module for Codeception
License MIT
Informations about the package module-playwright
Playwright module for Codeception
🚀 This is the first and the only module that allows Playwright testing in PHP. Playwright allows testing in Chrome, Firefox, Webkit (safari). It is faster and more reliable alternative to Selenium WebDriver. Finally it is available in PHP!
This module does not implement Playwright API in PHP, rather proxies requests to Playwright helper of CodeceptJS. This is possible because Codeception and CodeceptJS share the same architecture principles, and the interface for web testing is quite the same.
[!Note] This module can be used as a replacement for WebDriver module. Comparing to WebDriver module, Playwright module can speed up your tests x3 times, run in headless mode, record videos, and stack traces out of the box
Requirements
- PHP 8.1+
- NodeJS 20+
Installation
[!Warning] This module is experimental. It is in early development stage. Please report any issues you find.
Install NodeJS part of this module, it will install Playwright and CodeceptJS
Install Playwright browsers
Install PHP part of this module
Configuration
Enable module in codeception.yml
:
Most common config values are:
url
- base url to open pages frombrowser
- eitherchromium
,firefox
,webkit
show
- (default:true
) to show browser or set tofalse
to run tests in headless modetimeout
- (default:5000
) timeout (in ms) for all Playwright operationspw_start
- (default:true
) start Playwright Server (Proxy to CodeceptJS) automatically. Set tofalse
and run server manually in case server doesn't start.pw_server
- (default: 'http://localhost:8191') url of Playwright Serverpw_debug
- (default:false
) print Playwright Server debug informationvideo
- save video on failtrace
- save traces on fail
More configuration options are is listed on CodeceptJS Playwright page
[!Tip] This module is designed as drop-in WebDriver module replacement, you can change
WebDriver
toPlaywright
in your tests and try how it works!
Usage
Playwright module requires NodeJS server to be running. Playwright module will start it and stop automatically. Default port is 8191.
If you want to disable automatic server start, set start
option to false
:
In this case you can start the server manually:
Please check that server can be started with no issues.
If you start server on different host or port, you can configure it:
API
This module provides the same API as WebDriver module. You can try to use it in your tests without any changes.
For the full command list see WebDriver module reference.
Playwright-specific commands are also available in CodeceptJS Playwright Helper