Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide noInject option to prevent altering Cucumber .feature files #44

Merged
merged 2 commits into from Jul 21, 2015

Conversation

gazoakley
Copy link
Contributor

I've recently started using grunt-protractor-coverage with Cucumber style tests. Cucumber .feature files aren't written as JavaScript (they're plain text), so GPC fails when trying to rewrite them to call runCoverageGlobal.

To get around this, I've created a noInject option. When enabled GPC no longer tries to create these temporary rewritten features. I've also added a JS file that can be required from within the step definitions JS file and called to save coverage data - an example of it's use is provided in README.md

I'd welcome any comments/suggestions - thanks

@gazoakley
Copy link
Contributor Author

@r3b
Copy link
Owner

r3b commented Jul 7, 2015

Thanks, Gareth! I will take a look!

On Fri, Jul 3, 2015 at 8:57 AM Gareth Oakley notifications@github.com
wrote:

Also mentioned here:
http://stackoverflow.com/questions/30233257/how-can-i-get-coverage-of-protractor-with-cucumber/31118222#31118222


Reply to this email directly or view it on GitHub
#44 (comment)
.

@r3b
Copy link
Owner

r3b commented Jul 7, 2015

Can you give an example of how to run the cucumber tests against the test project and collect coverage from them? I'm not that familiar with Cucumber and I'd like to see it work.

@gazoakley
Copy link
Contributor Author

Hi Ryan - I'll try and get an example sorted shortly

@gazoakley
Copy link
Contributor Author

I've added a Cucumber version of the existing test spec - just run grunt test-cucumber to give it a try

r3b added a commit that referenced this pull request Jul 21, 2015
Provide noInject option to prevent altering Cucumber .feature files
@r3b r3b merged commit baf3909 into r3b:master Jul 21, 2015
@r3b
Copy link
Owner

r3b commented Jul 21, 2015

Works for me. Thanks for the contribution, @gazoakley!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants