I'm trying to create a grunt task to run cucumber.js tests. The tests are organized in feature "areas" within my project eg:
project_root
--test
--spec-e2e
--home_Page
--features
--step_definitions
From my project's node_modules dir I can run cucumber.js manually and all is well:
$ node cucumber.js ../../../test/spec-e2e/home_Page/features/
Output:
1 scenario (1 passed)
3 steps (3 passed)
I cannot seem to get the grunt-cucumber task configured properly to recreate the same result. In my Gruntfile.js I have the following configuration:
// Cucumber test runner
cucumberjs: {
src: 'test/spec-e2e/home_Page/features',
options: {
steps: 'test/spec-e2e/home_Page/features/step_definitions',
format: 'pretty'
}
}
...
//Register task
grunt.registerTask('cucumber', ['cucumberjs']);
Running $ grunt cucumber
allows just outputs:
$ Running "cucumberjs:src" (cucumberjs) task
$ Done, without errors.
So I'm not receiving any errors or cucumber summary output. If I purposely edit one of my step_definitions to fail the result is always the same. Can someone tell me how to configure this correctly?
Thanks!
Try this one:
Please go through the below doc :
Grunt cucumber js docs
This code works for me :