Hi everyone, I'm using a vagrant box (not homestead) to host our laravel project. I'm trying to use Laravel Dusk to do some automated browser testing using the chromium browser but it isn't working right.
When I run php artisan dusk
the command just hangs for a while and eventually dies with this output:
There was 1 error:
1) Tests\Browser\FreeAdvertTest::testAuctionUpsellPageTextAreCorrect
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"binary":"/usr/bin/chromium-browser","args":["--disable-gpu","--headless","--allow-insecure-localhost","--no-sandbox","--disable-dev-shm-usage","--window-size=1920,2080","--profile-directory=Default","--user-data-dir=dusk"]},"acceptInsecureCerts":true}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"/usr/bin/chromium-browser","args":["--disable-gpu","--headless","--allow-insecure-localhost","--no-sandbox","--disable-dev-shm-usage","--window-size=1920,2080","--profile-directory=Default","--user-data-dir=dusk"]},"acceptInsecureCerts":true}}
Operation timed out after 10001 milliseconds with 0 bytes received
Here is my DuskTestCase.php driver setup:
protected function driver(): RemoteWebDriver
{
$options = (new ChromeOptions())
->setBinary('/usr/bin/chromium-browser')
->addArguments([
'--disable-gpu',
'--headless',
'--allow-insecure-localhost',
'--no-sandbox',
'--disable-dev-shm-usage',
'--window-size=1920,2080',
'--profile-directory=Default',
'--user-data-dir=dusk',
]);
return RemoteWebDriver::create(
'http://localhost:9515',
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY,
$options
)->setCapability('acceptInsecureCerts', true),
10000,
10000
);
}
I've done a fair bit of research and I'm still lost. Here's what I've tried:
php artisan dusk:chrome-driver --detect
I briefly installed google chrome and that worked great, but other members of my team require chromium instead of chrome, so I'm back where I started. Is someone able to provide any pointers on where to look?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community