Someone was able to get Laravel Dusk working on CircleCI .
I can get my build to work and test with PHPUnit, but it does not work for Laravel Dusk.
I have a basic Laravel installation with Dusk installed. When I get the command php artisan dusk
, I get the following error.
Mistake
1) Tests\Browser\ExampleTest::testBasicExample
Did not see expected text [Laravel] within element [body].
Failed asserting that false is true.
So, it launches a chrome browser, but doesn’t get to the site.
I tried working with Dusk chromedriver-linux, chromcriver circleci, without using php service and a lot of various tricks. So far, I’m out of luck.
Here is a link to repo and related files are located below.
Here is my file circle.yml
.
machine:
hosts:
dusk.dev: 127.0.0.1
timezone: America/Los_Angeles
services:
- mysql
environment:
APP_ENV: testing
APP_KEY: randomq2VjceHV2t1Usdskeksa9yUI6a
post:
- chromedriver:
background: true
dependencies:
override:
- composer install --prefer-dist --no-interaction
post:
- mv .env.example .env
test:
override:
- vendor/bin/phpunit
- sudo php artisan serve --host=localhost --port=80:
background: true
- php artisan dusk
.env.example
which I copy to .env
APP_ENV=local
APP_KEY=base64:BaGXvpvUWnUbGA1RiOapw45K2UCK8AeYM3o62IDV9Qw=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
( ).
, .