Protractor 错误:在config.yml文件上ng e2e--gradurator config=./e2e/gradurator-ci.conf.js时生成chromedriver

Protractor 错误:在config.yml文件上ng e2e--gradurator config=./e2e/gradurator-ci.conf.js时生成chromedriver,protractor,continuous-integration,Protractor,Continuous Integration,我正在尝试将circleCi上的量角器e2e测试与以下设置集成: config.yml - run: name: NPM test command: | cd frontend npm install apk update apk add chromium export CHROME_BIN=$(which chromium-browse

我正在尝试将circleCi上的量角器e2e测试与以下设置集成:

config.yml

- run:
          name: NPM test
          command: |
            cd frontend
            npm install
            apk update
            apk add chromium
            export CHROME_BIN=$(which chromium-browser)
            npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI --code-coverage || exit 0
      - run:
          name: Protractor e2e tests
          command: |
            cd frontend
            npm run e2e -- --protractor-config=./e2e/protractor-ci.conf.js
量角器配置:

const config = require('./protractor.conf').config;

config.capabilities = {
    browserName: 'chrome',
    chromeOptions: {
        args: ['--headless', '--no-sandbox']
    }
};

exports.config=config; 单元测试运行成功,但e2e测试未运行:

[10:12:58] I/file_manager - creating folder /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium
[10:12:58] I/config_source - curl -o/root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
ℹ 「wdm」: Compiled successfully.
[10:12:58] I/downloader - curl -o/root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69.zip https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_linux64.zip
[10:12:59] I/update - chromedriver: unzipping chromedriver_81.0.4044.69.zip
[10:12:59] I/update - chromedriver: setting permissions to 0755 for /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69
[10:12:59] I/launcher - Running 1 instances of WebDriver
[10:12:59] I/direct - Using ChromeDriver directly...
[10:12:59] E/launcher - spawn /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69 ENOENT
[10:12:59] E/launcher - Error: spawn /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69 ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
    at onErrorNT (internal/child_process.js:421:16)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
[10:12:59] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
设置:

const config = require('./protractor.conf').config;

config.capabilities = {
    browserName: 'chrome',
    chromeOptions: {
        args: ['--headless', '--no-sandbox']
    }
};

  • 角度CLI:7.3.9
  • 节点:10.19.0
  • 量角器:5.4.3
已尝试: -在测试开始之前更新webdriver。
-已检查错误文件夹中是否有C hromedriver_81.0.4044.69文件

您是否能够解决此问题?我经历了完全相同的错误。