Docker + Laravel + Codeception

Record when using Codeception with Laravel

Preparing for Codeception

Install with the command below

composer require codeception/codeception --dev

Create the necessary files for the test with the command below

composer exec codecept bootstrap

selenium server ready

Prepare a selenium server to use for Acception test Add the following 4 lines to docker-compose.yml

    selenium:
...
      depends_on:
        - nginx
      links:
        - nginx:localhost

Server startup

docker-compose up -d selenium

Other preparations

Copy env file

cp .env .env.testing

/tests/functional.suite.yml

actor: FunctionalTester
modules:
    enabled:
        - Laravel5:
            environment_file: .env.testing
        - \Helper\Functional

/tests/unit.suite.yml

actor: UnitTester
modules:
    enabled:
        - Asserts
        - Laravel5:
            environment_file: .env.testing
        - \Helper\Unit

/tests/acceptance.suite.yml

actor: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: http://localhost/
            browser: chrome 
            host: selenium
        - \Helper\Acceptance

reference

https://codeception.com/for/laravel

Recommended Posts

Docker + Laravel + Codeception
Deploy with EC2 / Docker / Laravel
docker
Laravel + Docker Laradock usage environment construction
General error: 1812 occurs with docker + laravel
Install laravel/Dusk in docker environment (laravel6)
Create Laravel environment with Docker (docker-compose)
Build docker + laravel environment with laradock
Laravel8 ubuntu20
docker memo
kubernetes + docker
spring × docker
About Docker
Laravel development environment construction with Docker (Mac)
Docker Intellij
Docker basics
Environment construction with Docker (Ubuntu20.04) + Laravel + nginx
Docker installation
About Docker
Laravel + MySQL + phpMyadmin environment construction with Docker
Docker command
Docker memorandum
Display API specifications with Laravel + SwaggerUI + Docker
Understand Docker
Docker memorandum
Just install Laravel8 on docker in PHP8 environment
Build a Laravel / Docker environment with VSCode devcontainer
Docker x Laravel Insanely slow Docker for Windows explodes
Build a container for Docker x Laravel phpMyAdmin
Docker × Laravel HTTPS (SSL) communication in local environment