I have just added the tests with Laravel Dusk. Everything works if I test on my pc. I thus set up a travis.yml file :
language: php
sudo: required
dist: trusty
php:
- 7.1
- 7.2
addons:
chrome: stable
services:
- mysql
install:
- cp .env.travis .env
- mysql -e 'create database homestead_test;'
- travis_retry composer self-update
- travis_retry composer install --no-interaction
- php artisan key:generate
- php artisan migrate:fresh --seed
before_script:
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- php artisan serve &
script:
- php artisan code:analyse --level=7
- php artisan dusk
- vendor/bin/phpunit
notifications:
email: false
However, when I push on Github I obtains errors : show travis errors
I does not understand to make how so that my tests work on travis.
Would anybody know how to help me on this point? Best Regards, Quentin
Update : The exact commit on github
The issue is
SESSION_DRIVER=array
in your.env.travis
file, change it toSESSION_DRIVER=file
.The login tests aren't working because the sessions vanish after each request.