我正在尝试添加一些脚本package.json
来运行量角器测试:
"scripts": {
"webdriver-update": "./node_modules/.bin/webdriver-manager update",
"webdriver-start": "./node_modules/.bin/webdriver-manager start --versions.chrome=84.0.4147.30",
"protractor": "./node_modules/.bin/protractor configuration.js",
"start": "npm run webdriver-update &&npm run webdriver-start"
}
如果我打开 2 个命令提示符并运行npm run start
& npm run protractor
,我的测试运行良好。
在我正在关注的教程中,他们可以运行npm run protractor
并且测试也可以运行。
但是,当我尝试这样做时,我会收到以下错误消息:
protractor configuration.js
[21:01:19] I/launcher - Running 1 instances of WebDriver
[21:01:19] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[21:01:21] E/launcher - Error code: 135
[21:01:21] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
[21:01:21] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
有人可以告诉我为什么这对我不起作用吗?