0

I'm trying to run e2e tests from a Vue.js application in a docker container.

The nightwatch configuration file looks like this:

nightwatch.json

{
  "test_settings": {
    "default": {
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "chromeOptions" : {
          "args" : ["disable-web-security", "ignore-certificate-errors", "headless"]
        }
      }
    }
  }
}

I am using this image in the container: pijzl/vuejs-docker-unit-e2e

When running at the physical machine prompt the tests pass, however when running in docker I encounter the following error:

Error retrieving a new session from the selenium server

Connection refused! Is selenium server started? { value: { message: 'unknown error: Chrome failed to start: exited abnormally\n (unknown error: DevToolsActivePort file doesn\'t exist)\n (The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\n (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.9.125-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 597 milliseconds\nBuild info: version: \'3.141.59\', revision: \'e82be7d358\', time: \'2018-11-14T08:25:53\'\nSystem info: host: \'df8c8d010486\', ip: \'172.17.0.2\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'4.9.125-linuxkit\', java.version: \'1.8.0_171\'\nDriver info: driver.version: unknown', error: 'unknown error' }, status: 13 }

Anyone have any ideas how to solve the problem?

  • what docker command do you run to start the tests? from which docker image? – Thomasleveil Mar 07 '19 at 18:43
  • @Thomasleveil I updated the question with the image url, and I am using the standard command to run ```yarn test:e2e``` (vue-cli-service test:e2e) with docker ```docker run -it --rm -p 8081:8080 -v "$PWD":"$PWD" -w "$PWD" --name "vuejs-docker-unit-e2e" -it pijzl/vuejs-docker-unit-e2e:latest yarn test:e2e``` – Felipe Paetzold Mar 07 '19 at 18:46

0 Answers0