Nightwatch.js ECONREFUNCE使用夜视辅助功能库
我正在尝试使用库,但不断出错Nightwatch.js ECONREFUNCE使用夜视辅助功能库,nightwatch.js,Nightwatch.js,我正在尝试使用库,但不断出错 POST /session/b4e18278544c74b9213c030b8119ee7e/timeouts/async_script - ECONNREFUSED Error: connect ECONNREFUSED 127.0.0.1:9515 Error while running .setTimeoutsAsyncScript() protocol action: An unknown error has occurred. POS
POST /session/b4e18278544c74b9213c030b8119ee7e/timeouts/async_script - ECONNREFUSED
Error: connect ECONNREFUSED 127.0.0.1:9515
Error while running .setTimeoutsAsyncScript() protocol action: An unknown error has occurred.
POST /session/b4e18278544c74b9213c030b8119ee7e/execute_async - ECONNREFUSED
Error: connect ECONNREFUSED 127.0.0.1:9515
Error while running .executeScriptAsync() protocol action: An unknown error has occurred.
正常测试工作正常。据我所知,我正确地遵循了这个例子。测试断言工作正常—它仅出现在测试运行的末尾
nightwatch.json
{
"src_folders": ["test"],
"page_objects_path": "page-objects",
"globals_path": "./globals.js",
"custom_commands_path": ["./node_modules/nightwatch-accessibility/commands"],
"custom_assertions_path": ["./node_modules/nightwatch-accessibility/assertions"],
"end_session_on_fail": false,
"skip_testcases_on_fail": false,
"selenium": {
"start_process": false
},
"webdriver": {
"start_process": true,
"server_path": "node_modules/chromedriver/lib/chromedriver/chromedriver.exe",
"port": 9515
},
"test_settings": {
"default": {
"webdriver.port": 9515,
"desiredCapabilities": {
"browserName": "chrome"
}
}
}
}
globals.js
const chromedriver = require('chromedriver');
module.exports = {
before: function (done) {
chromedriver.start();
done();
},
after: function (done) {
chromedriver.stop();
done();
}
};
第一次测试
module.exports = {
'@tags': ['accessibility'],
'First test': function (browser) {
browser
.url(`http://www.google.com`)
.pause(3000)
.initAccessibility()
.assert.accessibility('html', {
verbose: true
})
.end()
}
}
通过从终端键入nightwatch执行,就像我在其他测试中一样。有什么想法吗?这是NightwatchJS的最佳可访问性断言库吗?我最终使用了它。此博客文章中包含的使用详细信息