Can anyone help, I am unable to get Laravel dusk to run the default sample test in my current Laravel 5.6 project on mac high sierra.
Error message
Time: 2.5 minutes, Memory: 14.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":"/Users/keith/Desktop/dusk/vendor/laravel/dusk/bin/chromedriver-mac","args":["--disable-gpu"]}}}
Operation timed out after 30002 milliseconds with 0 bytes received
/Users/keith/Desktop/dusk/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:286 /Users/keith/Desktop/dusk/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:126 /Users/keith/Desktop/dusk/tests/DuskTestCase.php:40 /Users/keith/Desktop/dusk/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:189 /Users/keith/Desktop/dusk/vendor/laravel/framework/src/Illuminate/Support/helpers.php:770 /Users/keith/Desktop/dusk/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:190 /Users/keith/Desktop/dusk/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:92 /Users/keith/Desktop/dusk/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:64 /Users/keith/Desktop/dusk/tests/Browser/ExampleTest.php:21
I have already done the following :
use Laravel\Dusk\DuskServiceProvider;
...
public function register()
{
if ($this->app->environment('local', 'testing')) {
$this->app->register(DuskServiceProvider::class);
}
}
Repository : https://github.com/KKOA/dusk
If your function extends from DuskTestCase.php, then you need to increase connection_timeout_in_ms.
Do this by changing driver method to the following:
DuskTestCase.php
protected function driver()
{
$options = (new ChromeOptions)->addArguments([
'--disable-gpu',
'--headless',
'--window-size=1920,1080',
]);
return RemoteWebDriver::create(
'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY, $options
), 90000, 90000
);
}
If that dosen't work for some reason then try to set_time_limit
before $this->browse
set_time_limit(0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With