Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Latest commit

 

History

History
43 lines (35 loc) · 1.27 KB

README.md

File metadata and controls

43 lines (35 loc) · 1.27 KB

Php Playwright Docker image

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.

Playwright Configuration (Laravel)

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:

Gitlab Pipeline example

Playwright Configuration (Stock Php)

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,
    },
    /* ... */
};