dusk: Basic Install Chromedriver Does Not Start (Windows)

Did a fresh install of laravel and the ran composer require laravel/dusk, following the scaffolding and the chrome driver doesn’t work. Am I supposed to be running something outside of running the tests that is meant for dusk to connect to?

` $ ./vendor/bin/phpunit -c phpunit.dusk.xml PHPUnit 5.7.7 by Sebastian Bergmann and contributors.

E                                                                  1 / 1 (100%)

Time: 9.41 seconds, Memory: 8.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"}}

Failed to connect to localhost port 9515: Connection refused

(app_path)\vendor\facebook\webdriver\lib\Remote\HttpCommandExecutor.php:287
(app_path)\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:121
(app_path)\tests\DuskTestCase.php:32
(app_path)\vendor\laravel\dusk\src\TestCase.php:180
(app_path)\vendor\laravel\framework\src\Illuminate\Support\helpers.php:639
(app_path)\vendor\laravel\dusk\src\TestCase.php:181
(app_path)\vendor\laravel\dusk\src\TestCase.php:111
(app_path)\vendor\laravel\dusk\src\TestCase.php:85
(app_path)\tests\Browser\ExampleTest.php:21

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

`

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 18 (4 by maintainers)

Most upvoted comments

This appears to still be an issue.

@mnabialek Nice! Thank you so much. It’s work.

@Sieabah Try dev-master branch in the composer. In vagrant, you need to change localhost to 10.0.2.2 in DuskTestCase.php (function driver). Hope it will help you.

Also from within a vagrant box running debian I get what looks like a shell script,

` vagrant@debian:/srv/web$ php artisan dusk

dir=$(d=${0%[/\\]*}; cd "$d"; cd '../phpunit/phpunit' && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/phpunit" "$@"

`

Can this be closed?

@Sieabah @vuongggggg Try dev-master branch for this (PR with fix was already merged)