ghcr.io/arne1303/php-playwright-docker:main
This docker image allows easy testing of php applications using the internal dev server and Playwright e2e tests. The image comes with php8.1, composer, npm and playwright 1.22 preinstalled, and is intended to be used in a gitlab ci or github workflow job.
Possible Playwright Configuration:
const config: PlaywrightTestConfig = {
/* ... */
outputDir: "test-results",
webServer: {
command: "php artisan serve --port=80 > php-server.log", // Server output will be saved in php-server.log
reuseExistingServer: !process.env.CI,
port: 80,
},
/* ... */
};
If you are using gitlab there is an example pipeline available to get you up and running:
Possible Playwright Configuration:
const config: PlaywrightTestConfig = {
/* ... */
outputDir: "test-results",
webServer: {
command: "php -S localhost:80 > php-server.log", // Server output will be saved in php-server.log
reuseExistingServer: !process.env.CI,
port: 80,
},
/* ... */
};