javascript - How can I get coverage of protractor with cucumber -
my project build on django , angular.
use protractor cucumber , chai e2e test.
, using "grunt-protractor-coverage" report code coverage. have question here if use jasmine protractor framework, when run "grunt test" it's fine. when use cucumber, error happens.
[launcher] process exited error code 1 /users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/node_modules/q/q.js:126 throw e; ^ error: spec patterns did not match files. @ runner.run (/users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/lib/runner.js:249:11) @ taskrunner.run (/users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/lib/taskrunner.js:123:19) @ createnexttaskrunner (/users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/lib/launcher.js:220:20) @ /users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/lib/launcher.js:243:7 @ _fulfilled (/users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/node_modules/q/q.js:797:54) @ self.promisedispatch.done (/users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/node_modules/q/q.js:826:30) @ promise.promise.promisedispatch (/users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/node_modules/q/q.js:759:13) @ /users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/node_modules/q/q.js:573:44 @ flush (/users/paizanmay/documents/ichef/superadmin2.0/node_modules/protractor/node_modules/q/q.js:108:17) @ process._tickcallback (node.js:355:11)
i don't know how solve it
"specs: ['features/store_id_admin.feature']," useless in "grunt-protractor-coverage" ?
thx
it doesn't grunt-protractor-coverage designed work cucumberjs. whilst managed read spec list (i moved protractor.conf.js root of app , specified full paths) plugin expects specs written javascript can rewritten collect/push coverage data back. when tests run small service runs in background (coverage-collector) collate coverage data each scenario.
in theory cucumberjs provides similar hooks specified along step definitions record data window.__coverage__
object after each feature/step: https://github.com/cucumber/cucumber-js#after-hooks
(you can see template used write coverage data collector here: https://github.com/r3b/grunt-protractor-coverage/blob/master/resources/savecoverage.tmpl)
it might possible add option plugin stop trying parse/alter spec files , coverage data working.
update: i've made tweaks grunt-protractor-coverage on github fork (https://github.com/gazoakley/grunt-protractor-coverage). there's pull request actual grunt-protractor-coverage: https://github.com/r3b/grunt-protractor-coverage/pull/44
Comments
Post a Comment