r3b / grunt-protractor-coverage

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

pattern not found error #8

Closed ghost closed 10 years ago

ghost commented 10 years ago

Background: I'm trying to use the grunt-protractor-coverage in my grunt script to get code coverage for protractor functional e2e tests. To get started, I utilized this tutorial, with some minor modifications and it works perfectly. Using this (http://java.dzone.com/articles/measuring-code-coverage) as a guide, I created a new gruntfile, substituting the "express" app with a rails app backend.

The Problem:

When running my gruntfile, I get the following stack trace:

../dummy/node_modules/grunt-protractor-coverage/node_modules/protractor/node_modules/glob/glob.js:130 throw new Error("must provide pattern") ^ Error: must provide pattern at new Glob (../dummy/node_modules/grunt-protractor-coverage/node_modules/protractor/node_modules/glob/glob.js:130:11) at glob ../dummy/node_modules/grunt-protractor-coverage/node_modules/protractor/node_modules/glob/glob.js:57:11) at Function.globSync as sync at Function.ConfigParser.resolveFilePatterns (../dummy/node_modules/grunt-protractor-coverage/node_modules/protractor/lib/configParser.js:89:26) at Runner.run (../dummy/node_modules/grunt-protractor-coverage/node_modules/protractor/lib/runner.js:323:24) at process. (../dummy/node_modules/grunt-protractor-coverage/node_modules/protractor/lib/runFromLauncher.js:32:14) at process.EventEmitter.emit (events.js:98:17) at handleMessage (child_process.js:318:10) at Pipe.channel.onread (child_process.js:345:11) [launcher] Runner Process Exited With Error Code: 8 Tracing through the code in grunt's task.js file via node-inspector, it seems there are two possible issues:

1) I'm missing some parameter from my config file which would correctly retrieve the files needed 2) There is a syntax issue Any idea why it's throwing this error?

My Config File:

protractor_coverage: { options: { configFile: '/usr/local/lib/node_modules/protractor/referenceConf.js', // Default config file keepAlive: true, // If false, the grunt process stops when the test fails. noColor: false, // If true, protractor will not use colors in its output. coverageDir: '<%= dirs.instrumentedE2E %>', args: {} }, phantom: { options: { args: { baseUrl: 'http://localhost:3000/', // Arguments passed to the command 'browser': 'phantomjs' } } }, chrome: { options: { args: { baseUrl: 'http://localhost:3000/', // Arguments passed to the command 'browser': 'chrome' } } } },

nvhoang56123 commented 10 years ago

Hello Shellzie,

As my understanding, protractor cannot get specs pattern. Do you use relative path in your configuration file?

May be you met the same issue like me https://github.com/r3b/grunt-protractor-coverage/issues/7

ghost commented 10 years ago

Hi,

I've tried both relative and absolute paths to my config file and my spec files but I get the same error as above:

......./node_modules/grunt-protractor-coverage/node_modules/protractor/node_modules/glob/glob.js:130 throw new Error("must provide pattern") ^ Error: must provide pattern at new Glob (........node_modules/grunt-protractor-coverage/node_modules/protractor/node_modules/glob/glob.js:130:11) at glob

Is this similar to the error you had too?

ghost commented 10 years ago

The new version (0.2.8) seems to have fixed the error above. Thanks for your quick turnaround with the new release!