неизвестная ошибка: файл DevToolsActivePort не существует при использовании nightwatch в Vuejs в vagrant - PullRequest
0 голосов
/ 20 марта 2020

У меня есть приложение Vue. js, в котором я хочу использовать ночные часы для проведения испытаний e2e. Мое приложение работает в Homestead. Я уже установил google chrome в homestead, но когда я запускаю команду nightwatch --verbose, я получаю следующую ошибку в

 Starting ChromeDriver on port 9515...
 ChromeDriver up and running on port `enter code here`9515 with pid: 5397 (142ms).

[First Test] Test Suite
=======================
⠋ Connecting to localhost on port 9515...
   Request POST  /session  
   {
     desiredCapabilities: { browserName: 'chrome', platform: 'ANY', name: 'First Test' }
⠙ Connecting to localhost on port 9515...
   Response 200 POST /session (122ms)
   {
     sessionId: '1c8180e5fd29dc1d8afb3ed9b6d4bc9b',
     status: 13,
     value: {
       message: 'unknown error: Chrome failed to start: exited abnormally.',
       error: [
         "  (unknown error: DevToolsActivePort file doesn't exist)",
         '  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)',
         '  (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux 4.15.0-74-generic x86_64)'
       ]
     }
⚠ Error connecting to localhost on port 9515.
_________________________________________________

TEST FAILURE: 1 error during execution; 0 tests failed, 0 passed (380ms)

 ✖ firstTest

  Error: An error occurred while retrieving a new session: "unknown error: Chrome failed to start: exited abnormally."
       at endReadableNT (_stream_readable.js:1185:12)
       at processTicksAndRejections (internal/process/task_queues.js:81:21)

   SKIPPED:
   - Demo test

 Wrote report file to: tests_output/firstTest.xml.
 Wrote log file to: /home/vagrant/code/application/chromedriver.log.
 ChromeDriver process closed.

Мой файл конфигурации nightwatch.conf.js

const chrome = require('chromedriver');

module.exports = {
    src_folders: ['tests/e2e'],
    webdriver: {
        start_process: true,
        server_path: chrome.path,
        port: 9515,
        cli_args: [
            '--no-sandbox',
            '--headless',
            '--port=9515'
        ]
    },
    test_settings: {
        default: {
            desiredCapabilities: {
                browserName: 'chrome',
            },
        },
    },
}

Я использую Ubuntu 18.04 и nodejs 12.14.1

...