量角器插件 - 可访问性 - AssertionError:path必须是一个字符串

时间:2015-04-15 17:41:39

标签: node.js accessibility protractor angularjs-e2e e2e-testing

我正在尝试使用Protractor可用的插件。例如(辅助功能,控制台等......)。但是当我尝试运行E2E测试失败时出现以下错误消息。

**[launcher] Error: AssertionError: path must be a string
    at Module.require (module.js:362:3)
    at require (module.js:380:17)
    at new Plugins (/home/protractor-git/beta-    e2e/node_modules/protractor/lib/plugins.js:39:29)
    at driverprovider_.setupEnv.then.then.then.then.frameworkPath (/home/protractor-git/beta-e2e/node_modules/protractor/lib/runner.js:257:15)
    at _fulfilled (/home/protractor-git/beta-e2e/node_modules/protractor/node_modules/q/q.js:797:54)
    at self.promiseDispatch.done (/home/protractor-git/beta-e2e/node_modules/protractor/node_modules/q/q.js:826:30)**

Config.js中的插件配置如下所示。

plugins: [
{
 chromeA11YDevTools: {
 treatWarningsAsFailures: true
},
 path: 'node_modules/protractor.plugins/accessiblity'
},

{
 path: 'node_modules/protractor/plugins/console',
 failOnWarning: false               ,
 failOnError: true                  

}

package.json,有" accessibility-developer-tools":" ^ 2.6.0"作为Dev Dependencies。

请问您是否有任何解决方法可以解决此问题并执行辅助功能验证以及E2E测试执行。

提前致谢。

1 个答案:

答案 0 :(得分:1)

路径应指向相应插件的index.js文件,例如就我而言,它是:

{
    path: '../../../node_modules/protractor/plugins/console/index.js',
    failOnWarning: true,
    failOnError: true
},