7
votes

I am using protractor for e2e test my angular app, but getting:

TypeError: Object # has no method 'parse' when calling "protractor conf.js"

Here is the conf file content:

exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',

capabilities: {
    'browserName': 'chrome'
},
specs: ['HomePageCtrl_spec.js'],
chromeOnly: true,
jasmineNodeOpts: {
    onComplete: null,
    isVerbose: false,
    showColors: true,
    includeStackTrace: true
}
};

And here is the exception i am getting on running this command:

E:\eCOIGit\sidhome\SidHome\SidHome.Tests\ng-test-e2e>protractor Conf.js

Error:

C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:12 6 throw e; TypeError: Object # has no method 'parse' at Function.ConfigParser.resolveFilePatterns (C:\Users\xqwt\AppData\Roaming\ npm\node_modules\protractor\lib\configParser.js:102:29) at new TaskScheduler (C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\lib\taskScheduler.js:31:31) at C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\lib\launcher.js :180:21 at _fulfilled (C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\nod e_modules\q\q.js:797:54) at self.promiseDispatch.done (C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30) at Promise.promise.promiseDispatch (C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13) at C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:573:44 at flush (C:\Users\xqwt\AppData\Roaming\npm\node_modules\protractor\node_mod ules\q\q.js:108:17)at process._tickCallback (node.js:419:13) at Function.Module.runMain (module.js:499:11)

1

1 Answers

4
votes

It was a bug in protractor, the issue is now fixed.

Currently you can get the version containing the fix by installing it directly from the master branch:

npm install git+https://github.com/angular/protractor.git

As a workaround, instead you can update node to >=0.12.


Here are the related issues from the protractor issue tracker:


Also see: