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

Arne1303/php-playwright-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Allows easy testing of php applications using the internal dev server and Playwright e2e tests. Focused but not limited to Laravel and gitlab

Topics

Resources

License

Stars

Watchers

Forks