CucumberZephyr
This is the custom cucumber formatter.
Installation
Add this line to your application's Gemfile:
gem 'cucumber-zephyr'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install cucumber-zephyr
Important Note:
You will need to set your zephyr API access token in your environment i.e.
$ $ZEPHYR_API_KEY='YOUR-API-KEY'
Usage
To use this customer cucumber formatter you will either need to register this formatter in either your cucumber.yml file or via command line.
To register via your formatter simple add this line to your default settings:
default: --format zephyr
To register via command line:
cucumber --format zephyr
Example
Assuming our example cucumber framework has the following structure:
my_cucumber_project/
├── features/
│ ├── step_definitions/
│ │ └── guess_the_word_steps.rb
│ ├── support/
│ │ └── env.rb
│ └── guess_the_word.feature
├── Gemfile
└── Gemfile.lock
Here is an example implementation of the zephyr custom formatter. We start with an example feature file with zephyr test fase tags added to the scenario we want:
# my_cucumber_project/features/guess_the_word.feature
Feature: Guess the word
@SBX-1234 # @{zephyr_project_id}-1234
Scenario: Maker starts a game
When the Maker starts a game
Then the Maker waits for a Breaker to join
Important Note: Make sure to import this gem into your env.rb
file.
Then, run the example feature file:
$ cucumber features/guess_the_word.feature --format zephyr --results_format junit --project_id SBX --file path/to/results/file --auto_close_cycle --auto_create_test_cases --name 'New Automated Test Cycle' --description 'This is the description of my new automated test cycle'
Development
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cucumber-zephyr.