I installed Laravel Dusk for website testing. I tried every solution on Stackoverflow regarding this problem but nothing worked.
I need to run browser headless because I'm running tests on my Linux server.
Current version of chromedriver-linux is:
./vendor/laravel/dusk/bin/chromedriver-linux --v
ChromeDriver 90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430@{#429})
Current version of Chromium is:
chromium-browser --version --no-sandbox
Chromium 90.0.4430.93 snap
When I run Dusk I get error:
Operation timed out after 30001 milliseconds with 0 bytes received
Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","platformName":"linux","goog:chromeOptions":{"args":["--headless","--disable-gpu","--no-sandbox"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"linux","chromeOptions":{"args":["--headless","--disable-gpu","--no-sandbox"]}}}
Is there any way to resolve this? I tried by adding arguments "--headless","--disable-gpu","--no-sandbox"
but unfortunately it is not working.
friend!
I assume you are on Windows host with Homestead (Windows 10, Homestead 10 and Laravel 8). If not, I am not sure this answer will help. But this just helped me, literally, a few minutes ago, so I feel obliged.
Dusk
appears not likeChromium
and desires a full Chrome. So lets install it:This will download the latest stable google chrome and install it.
vendor/laravel/dusk/bin/
folder is executable, as the docs suggest. So, in the root of your project:3.1. If it will give you hard time (cannot rename, cannot move files, yada-yada) - it is probably because you have the driver already running, so exit Homestead and just
return back to homestead and repeat 3 above.
APP_URL
. Let's say it islaravel.app
:If not, check
/etc/hosts
, you expect to see something like127.0.0.1 laravel.app
- following our assumption about the URL. This is normally set by Homestead itself, when you provision a new site.Voila.
was successful.
That fixed it for me.
I have spent exorbitant amount of time which could have been saved by a single line in docs "If you are running Homestead on Windows, make sure to install Google Chrome"
Happy coding!