Laravel - Browser Tests - Running Tests On Travis Ci

To run your Dusk tests on Travis CI, use the following .travis.yml configuration. Since Travis CI is not a graphical environment, we will need to take some extra steps in order to launch a Chrome browser. In addition, we will use php artisan serve to launch PHP's built-in web server:

    
    language: php
    
    php:
      - 7.3
    
    addons:
      chrome: stable
    
    install:
      - cp .env.testing .env
      - travis_retry composer install --no-interaction --prefer-dist
      - php artisan key:generate
      - php artisan dusk:chrome-driver
    
    before_script:
      - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
      - php artisan serve --no-reload &
    
    script:
      - php artisan dusk