我用的量角器的端對端測試我的角度的應用程序,但得到:量角器無法解析conf.js
TypeError: Object # has no method 'parse' when calling "protractor conf.js"
這裏是conf文件內容:
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
}
};
這裏是例外我收到上運行此命令:
E:\eCOIGit\sidhome\SidHome\SidHome.Tests\ng-test-e2e>protractor Conf.js
錯誤:
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)
感謝..它工作:) – rrahul963
我不能升級到0.12版本還沒有,我可以使用什麼版本量角器現在讓我不要現在不需要升級? – user1007983
@ user1007983我認爲你應該使用量角器2.4.0來保存。 – alecxe