e2e tests fail on server with selenium

Viewed 1101

I'm about to create an application full js based on . Following https://github.com/vuejs-templates/webpack, I have started a project:

$ vue init webpack my-project && cd my-project && yarn install

When I run unittest yarn run unit everything goes well, but when I run yarn run e2e which runs , I get this error:

> Starting dev server...

Starting to optimize CSS...
> Listening at http://localhost:8889

Starting selenium server... started - PID:  23451
started - PID:  23451

[Test] Test Suite
=====================

Running:  default e2e tests

[client :: capabilities] Test Suite
=======================================


Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ Error: socket hang up
    at createHangUpError (_http_client.js:344:15)
    at Socket.socketOnEnd (_http_client.js:436:23)
    at emitNone (events.js:110:20)
    at Socket.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1047:12)
    at _combinedTickCallback (internal/process/next_tick.js:102:11)
    at process._tickCallback (internal/process/next_tick.js:161:9) code: 'ECONNRESET' }

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The server is started on the fly when the tests start and is shutdown when they finish. I'm sure because when I stop before it fails I see :

$ ps aux | grep -i selenium
java -Dwebdriver.chrome.driver=node_modules/chromedriver/lib/chromedriver/chromedriver -jar node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar -port 4444

So the real error based on the output I get is mostlikely Error retrieving a new session from the selenium server. How do I fix this?

package.json

"chromedriver": "^2.27.2",
"cross-spawn": "^5.0.1",
"nightwatch": "^0.9.12",
"selenium-server": "^2.53.1",

test/e2e/nightwatch.conf.js

require('babel-register')
var config = require('../../config')

// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
  src_folders: ['test/e2e/specs'],
  output_folder: 'test/e2e/reports',
  custom_assertions_path: ['test/e2e/custom-assertions'],

  selenium: {
    start_process: true,
    server_path: require('selenium-server').path,
    host: '127.0.0.1',
    port: 4444,
    cli_args: {
      'webdriver.chrome.driver': require('chromedriver').path
    }
  },
2 Answers
Related