To begin working with Cucumber we started of looking at examples online and found a someone had asked a similar question on Stackoverflow :-).
This is one of the samples
This example was obtained from Github https://github.com/diaspora/diaspora/tree/master/features/mobile, we were able to learn how to write cucumber test by exploring this tests.
Working with cucumber tests in RapidFTR
- To be able to begin testing in RapidFTR follow the link below Running Tests in RapidFTR
- Cucumber – Use these for testing User Flows – end to end scenarios that touch upon multiple functionality. Don’t use these for trivial tests, try using the Unit tests instead.
- API Tests – These test the public JSON API
- Related gems: Cucumber, Capybara, json_spec
- Related folders:
features/This folder is where the cucumber tests are located and created and where we are required to add the cucumber tests.
To run all the cucumber tests in Rapid FTR
# Run all cucumber tests bundle exec rake cucumber:all # Run headless tests bundle exec rake cucumber:headless # Run browser tests bundle exec rake cucumber:browser
To be able to run a test for a specific feature in RapidFTR
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:
To run a specific scenario from that feature:
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.
At the moment we are now working on the code for the cucumber test to be do our first cucumber test hurray!!!