How can I run one particular CucumberJS feature using GruntJS?
I finally figured out a solution that seems to work well enough, based on tags.
So for each of my feature files, I've added a tag.
For example, for Favourite.feature:
@favourite
Feature: Favourite
As a user of the system
I would like to favourite items
Then I've used a GruntJS option to specify the tags I want to run via a command-line argument.
I do this through a grunt.option()
call in my gruntfile:
cucumberjs: {
src: 'features',
options: {
steps: 'features/step_definitions',
format: 'pretty',
tags: grunt.option('cucumbertags')
}
}
So now I can run GruntJS from the command-line like this:
grunt cucumberjs --cucumbertags=@favourite
And it will only run the feature with the @favourite tag. Yay!