I use Homestead Version 1.0.1 and Laravel version 5.4.16. I setup the Laravel dusk by reading the documentation.
But, when I run php artisan dusk
by ssh to my homestead. I got an error like the following
PHPUnit 5.7.17 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 2.52 minutes, Memory: 10.00MB
There was 1 error:
1) Tests\Browser\ExampleTest::testBasicExample Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["no-first-run"]}}}
Operation timed out after 30001 milliseconds with 0 bytes received
Is there anyway to fix this
Yes, it can be found on the github pages of Dusk. It is a known issue and they are working to update the next homestead box.
But for now this worked for me: https://github.com/laravel/dusk/issues/50#issuecomment-275155974
Not included in that post but necessary for me: make sure you have following permission set
cd vendor/laravel/dusk/bin; chmod 775 *
Steps from the github post: First of all, google-chrome is requried to be installed in guest OS:
Next thing is xvfb:
Try to start
./vendor/laravel/dusk/bin/chromedriver-linux --port=8888.
If you have some errors about loading libraries (libnss3.so, libgconf-2.so.4), try this:When you see
Run
Also you may want to add your dev domain in guest's /etc/hosts file: 127.0.0.1 domain.dev.