Working on learning Dusk and really excited to get going with it.

But running it in homestead proved to be a bit tricky.

After following the docs and running php artisan dusk not much happened. Sure if I ran it on my Mac and it just worked but my tests needed to do migrations and what not and I want to keep my work in Homestead.

So a few steps later and it worked thanks to this post

Local host file

Make sure to edit sudo vim /etc/hosts and add the APP_URL there as well

Then make sure you can hit it from inside homestead as well.

curl -X GET

All set?

Then run xvfb

This is a virtual frame buffer that Chrome runs in. Pretty cool really

So I like to use screen to start a new session

screen -S running_xvfb

and then in there run

Xvfb :0 -screen 0 1280x8000x24 &

Now we want to swap back to our default session CTRL+A then still holding CTRL let go of A and press D.

You are back at your default terminal


vagrant@homestead:~/Code/webforms$ screen -ls
There is a screen on:
	16315.running_xvfb	(04/24/2017 12:34:09 AM)	(Detached)
1 Socket in /var/run/screen/S-vagrant.

Now it all just worked!