简体   繁体   English

无法解析依赖项 - webdriverIO

[英]Unable to resolve dependencies - webdriverIO

I am trying to run my WebdriverIo Specs using ( npm run test-local ) and I am getting the following error even thou I am having all the dependencies in my package.json as mentioned below我正在尝试使用 ( npm run test-local ) 运行我的 WebdriverIo 规范,即使我在 package.json 中拥有所有依赖项,我也会收到以下错误,如下所述

[0-2] Error: Failed to create a session. [0-2] 错误:无法创建会话。 Error forwarding the new session Empty pool of VM for setup Capabilities {browserName: chrome, goog:chromeOptions: {}}*错误转发新会话 Empty pool of VM for setup Capabilities {browserName: chrome, goog:chromeOptions: {}}*

npm WARN grunt-webdriver@3.0.0 requires a peer of @wdio/cli@^5.1.0 but none is installed. npm WARN grunt-webdriver@3.0.0 需要@wdio/cli@^5.1.0 的同级,但没有安装。 You must install peer dependencies yourself.您必须自己安装对等依赖项。 npm WARN grunt-webdriver@3.0.0 requires a peer of webdriverio@^5.1.0 but none is installed. npm WARN grunt-webdriver@3.0.0 需要 webdriverio@^5.1.0 的同级,但没有安装。 You must install peer dependencies yourself.您必须自己安装对等依赖项。 npm WARN wdio-chromedriver-service@6.0.4 requires a peer of chromedriver@ but none is installed. npm WARN wdio-chromedriver-service@6.0.4 需要 chromedriver@ 的同级,但没有安装。 You must install peer dependencies yourself .您必须自己安装对等依赖项 * *


"scripts": {
    "allure:history": "mkdir -p allure-report/history ./test/reports/allure-results/history && cp -a allure-report/history ./test/reports/allure-results/",
    "allure-report": "node_modules/.bin/allure generate --clean ./test/reports/allure-results && allure open",
    "junit-report": "node_modules/.bin/junit-viewer --results=./test/reports/junit-results --save=junit-results.html && open junit-results.html",
    "test-sauce": "wdio ./test/config/wdio.sauce.conf.js",
    "test-browserstack": "wdio ./test/config/wdio.browserstack.conf.js",
    "test-local": "npm run allure:history && wdio ./test/config/wdio.local.conf.js",
    "test-mobile": "wdio ./test/config/wdio.appium.conf.js"
  },
"dependencies": {},
  "devDependencies": {
    "@babel/cli": "^7.8.4",
    "@babel/core": "^7.9.0",
    "@babel/plugin-syntax-export-default-from": "^7.8.3",
    "@babel/preset-env": "^7.9.0",
    "@babel/register": "^7.9.0",
    "@wdio/allure-reporter": "^6.4.7",
    "@wdio/appium-service": "^6.4.7",
    "@wdio/browserstack-service": "^6.4.7",
    "@wdio/cli": "^6.0.5",
    "@wdio/junit-reporter": "^6.4.7",
    "@wdio/local-runner": "^6.0.5",
    "@wdio/mocha-framework": "^6.4.7",
    "@wdio/sauce-service": "^6.0.4",
    "@wdio/selenium-standalone-service": "^6.1.4",
    "@wdio/spec-reporter": "^6.0.4",
    "@wdio/sync": "^6.0.1",
    "allure-commandline": "^2.13.0",
    "babel-plugin-source-map-support": "^2.1.3",
    "eslint": "^7.2.0",
    "eslint-config-standard": "^14.1.1",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",
    "grunt": "^1.3.0",
    "grunt-cli": "^1.3.2",
    "grunt-mocha": "^1.2.0",
    "grunt-webdriver": "^3.0.0",
    "junit-viewer": "^4.11.1",
    "node-excel-to-json": "0.0.3",
    "selenium-standalone": "^6.20.0",
    "underscore": "^1.11.0",
    "wdio-chromedriver-service": "^6.0.2",
    "wdio-json-reporter": "^2.0.0"
  }

Make sure selenium standalone server is up and running确保 selenium 独立服务器已启动并正在运行

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -browser "browserName=chrome,maxinstance=1

The above command did the trick for me!上面的命令对我有用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM