Rajesh Yarlagadda
Rajesh Yarlagadda

Reputation: 223

Protractor plugins - accessibility - AssertionError: path must be a string

I am trying to use plugins available for Protractor. eg(Accessibility,console etc..). however when i try to run E2E tests failing with following error message.

**[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)**

Plugin configuration in Config.js is as listed below.

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

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

}

]

package.json, has "accessibility-developer-tools": "^2.6.0" as Dev Dependencies.

Would you please advise if any workaround to resolve this issue and perform accessibility validation as well, along with E2E Test execution.

Thanks in advance.

Upvotes: 1

Views: 526

Answers (1)

alecxe
alecxe

Reputation: 473933

The path should point to the index.js file of the appropriate plugin, e.g. in my case it is:

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

Upvotes: 1

Related Questions