Reason why I want to run them individually, is because I need to have them individually set up in my Rake file, because, My Java Heap Space fills up when I run them all together
Press Ctrl+Shift+A and start typing edit configurations. Select Edit Configurations and press Enter . In the opened Run/Debug Configurations dialog, select the required configuration, and specify its settings. Choose whether to run all features in a directory or file.
Let's create an empty directory cucumber-app for our application. cd cucumber-app In the directory we initiate bundler by calling bundle init . This will create a Gemfile for us. Let's add the Cucumber gem gem "cucumber" and install it by running bundle .
The correct way is to run it using the cucumber
executable if you're using Rails 2, or bundle exec cucumber
if you're using Rails 3 (and thus Bundler).
To run a specific feature:
[command] features/signing_in.feature
To run a specific scenario from that feature:
[command] features/signing_in.feature:6
The line number can be any line inside that feature, but is usually the first line.
If you run rake cucumber:ok
and some scenarios fail, at the bottom of the output you will see something like this:
cucumber features/sigining_in.feature:6 # Signing in via form
You can triple-click this line and paste it into your terminal to just run that scenario.
To answer the Rake question directly, you can use:
rake FEATURE=features/adding_products.feature cucumber
but the Using Rake wiki page advises against using rake for anything but on a CI server because it's slower to start. Just use the cucumber command line instead, i.e.:
cucumber features/adding_products.feature
or, if you must:
bundle exec cucumber features/adding_products.feature
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With