Error: Could not find update-config.json when running Protractor end to end tests

Error: Could not find update-config.json when running Protractor end to end tests

我有一个 Angular 6 项目并尝试 运行 端到端量角器测试。 我在步骤中不断收到此错误:

webdriver-manager update --standalone false --gecko false

于是我全局安装了webdriver-manager,webdriver-manager文件夹在文件夹中: C:\用户...\Roaming\npm\node_modules

然后我使用此命令从文件夹 C:/User/:

更新 webdriver-manager
webdriver-manager update

成功添加了 selenium jar、chromedriver 和 geckodriver。

我尝试运行使用 yarn 进行端到端测试。 当脚本到达此命令时:

webdriver-manager update --standalone false --gecko false

我收到这个错误:

更新-config.json 在文件夹中:

这个 json 文件应该在什么地方,我如何得到它?

更新 这些是当前脚本:

"scripts": {
    "ng": "ng",
    "start": "ng serve --proxy-config local.proxy.config.json",
    "build": "ng build --output-path ../resources/static",
    "test": "ng test",
    "test-local": "ng test --karmaConfig=karma-local.conf.js",
    "lint": "ng lint",
    "wd:update": "npm run e2e-update && protractor ./e2e/protractor-local.conf.js",
    "wd:start": "webdriver-manager start && protractor ./e2e/protractor-local.conf.js",
    "e2e-local": "npm run e2e-update && protractor ./e2e/protractor-local.conf.js",
    "e2e-local-debugger": "npm run e2e-update && node --inspect-brk node_modules/protractor/bin/protractor ./e2e/protractor-local.conf.js",
    "e2e": "npm run e2e-update && npm run e2e-test",
    "e2e-test": "protractor ./e2e/protractor.conf.js",
    "e2e-update": "webdriver-manager update --standalone false --gecko false",
    "e2e-jenkins-staging": "npm run e2e-update && npm run e2e-staging",
    "e2e-jenkins-prod": "npm run e2e-update && npm run e2e-prod",
    "e2e-staging": "protractor ./e2e/protractor-staging.conf.js",
    "e2e-prod": "protractor ./e2e/protractor-prod.conf.js",
    "sonar": "sonar-scanner"
  },

这个问题是因为 webdriver-manager.

的本地和全局安装

在 package.json 中创建一个 npm 脚本来更新 webdriver 管理器,例如

"wd:update": "webdriver-manager update"

这将下载项目 node_modules 中 webdriver-manager 的驱动程序和二进制文件。

运行 这个 npm 脚本来自项目目录 npm 运行 wd:update