r3b / grunt-protractor-coverage

Coverage analysis for Protractor tests
Apache License 2.0
38 stars 29 forks source link

TypeError: callback is not a function #62

Open schmitzhermes opened 8 years ago

schmitzhermes commented 8 years ago

Hey guys,

I am trying to make protractor-coverage work in my webapp. I am using the cucumber feature (with noInject : true). According to your documentation this requires the following line in my feature-definition (inside the steps) (in order to actually collect the coverage).

this.After(coverage.getCoverage);

However I am facing the following issue: I do have the following problem:

Users/schmitzhermes/Development/Code/Projects/Commercial/fami/fami-webapp/node_modules/selenium-webdriver/lib/promise.js:1329
      return callbackFn(this.value_);
             ^
TypeError: callback is not a function
    at /Users/schmitzhermes/Development/Code/Projects/Commercial/fami/fami-webapp/node_modules/grunt-protractor-coverage/cucumber/index.js:30:5
    at Promise.invokeCallback_ (/Users/schmitzhermes/Development/Code/Projects/Commercial/fami/fami-webapp/node_modules/selenium-webdriver/lib/promise.js:1329:14)
    at TaskQueue.execute_ (/Users/schmitzhermes/Development/Code/Projects/Commercial/fami/fami-webapp/node_modules/selenium-webdriver/lib/promise.js:2790:14)
    at TaskQueue.executeNext_ (/Users/schmitzhermes/Development/Code/Projects/Commercial/fami/fami-webapp/node_modules/selenium-webdriver/lib/promise.js:2773:21)
    at /Users/schmitzhermes/Development/Code/Projects/Commercial/fami/fami-webapp/node_modules/selenium-webdriver/lib/promise.js:2652:27
    at /Users/schmitzhermes/Development/Code/Projects/Commercial/fami/fami-webapp/node_modules/selenium-webdriver/lib/promise.js:639:7
    at process._tickCallback (node.js:412:9)

If I do delete the "callback()" call, everything works as expected (I do have only one scenario right now).

Can anyone explain this to me? What is the purpose of the callback() and why does it throw a "callback is not a function"?

kibertoad commented 8 years ago

67 this fixes the issue reported, hopefully it gets merged at some point and a new version gets released.