It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I am trying to setup a Laravel 5.4 project in BitBucket Pipelines, with Laravel Dusk test scripts. However, I can't seem to get a successful build. After fixing several issues and finally getting my build to run my test scripts, I am not stuck at :
How do I get the Chrome Wed Driver to launch and run the test?
There are a couple of issue to address. I faced the same but finally got it working.
The main issue are the chrome drivers and the options to use to fire chrome.
The linux driver is a binary, so it may not be compatible with all the distros. And chrome has to be run in headless mode without gpu.
Have a look at the documentation of this docker image:
https://hub.docker.com/r/angelomaragna/networld-dusk/
I built it from Alpine, and with it (395MB unfortunately) I can finally run dusk tests in pipelines.
Angelo
Hi @Angelo Maragna, I tried to create a new container for testing using the container link you gave but it was returning me the following error:
Unable to find image 'networld-dusk:latest' locally
docker: Error response from daemon: repository networld-dusk not found: does not exist or no pull access.
So instead, I tried by using the steps described in the link with my existing container that is set up with php7-fpm and is still unable to get my test to run successfully.
Error in my documentation. "networld-dusk" is available on my local becasue I compiled it.
Please use "angelomaragna/networld-dusk" like in
docker run --privileged --name dusk -ti angelomaragna/networld-dusk /bin/sh
This is my bitbucket-pipelines.yml file (you can check that file also inside the docker container)
image: angelomaragna/networld-dusk
pipelines:
default:
- step:
script:
- rm vendor/laravel/dusk/bin/chromedriver-linux
# Laravel Dusk driver is not compatible so we replace it with the Alpine one
- ln -s /usr/lib/chromium/chromedriver vendor/laravel/dusk/bin/chromedriver-linux
- vendor/laravel/dusk/bin/chromedriver-linux &
- cp .env.example .env
- php artisan dusk
I finally had the time to give this another try and after many rounds of trial and error, I finally got my first successful build!
Using your image and bitbucket-pipelines.yml as a guide, I had to install a few additional packages in order for things to fully work. Here's the final version of my bitbucket-pipelines.yml file:
image: angelomaragna/networld-dusk
pipelines:
branches:
develop:
- step:
caches:
- composer
script:
- apk update && apk add php7-xmlwriter php7-pdo_mysql php7-session php7-ctype
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- cp .env.example .env
- composer install
- rm vendor/laravel/dusk/bin/chromedriver-linux
# Replace Laravel Dusk driver Alpine's
- ln -s /usr/lib/chromium/chromedriver vendor/laravel/dusk/bin/chromedriver-linux
- vendor/laravel/dusk/bin/chromedriver-linux &
- export DB_CONNECTION=mysql
- php artisan key:generate
- php artisan migrate
- php artisan dusk
- vendor/bin/phpunit
services:
- mysq
Thanks for the help!
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreBitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.