Class: Cucumber::Formatter::CucumberZephyr
- Inherits:
-
Object
- Object
- Cucumber::Formatter::CucumberZephyr
- Includes:
- Io
- Defined in:
- lib/cucumber_zephyr.rb
Overview
This class is the formatter for the Zephyr plugin
Instance Method Summary collapse
- #before_feature(feature) ⇒ Object
- #before_scenario(scenario) ⇒ Object
-
#initialize(config) ⇒ CucumberZephyr
constructor
A new instance of CucumberZephyr.
- #upload_results ⇒ Object
Constructor Details
#initialize(config) ⇒ CucumberZephyr
Returns a new instance of CucumberZephyr.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/cucumber_zephyr.rb', line 19 def initialize(config) @io = Cucumber::Formatter::Io.new(config.out_stream, config.default_path, "upload-to-zephyr") @project_id = config.[:project_id] @results_format = config.[:results_format] @path_to_file = config.[:path_to_file] @auto_close_cycle = config.[:auto_close_cycle] ? true : false @auto_create_test_cases = config.[:auto_create_test_cases] ? true : false @name = config.[:name] @description = config.[:description] at_exit { upload_results } end |
Instance Method Details
#before_feature(feature) ⇒ Object
32 33 34 |
# File 'lib/cucumber_zephyr.rb', line 32 def before_feature(feature) @current_feature = feature end |
#before_scenario(scenario) ⇒ Object
36 37 38 |
# File 'lib/cucumber_zephyr.rb', line 36 def before_scenario(scenario) @current_scenario = scenario end |
#upload_results ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/cucumber_zephyr.rb', line 40 def upload_results system("zephyr_cli test_cycles " \ "--#{@results_format} " \ "--project_id=#{@project_id} " \ "--file=#{@path_to_file} " \ "--auto_close_cycle=#{@auto_close_cycle} " \ "--auto_create_test_cases=#{@auto_create_test_cases}" \ "--name=#{@name} " \ "--description=#{@description}") end |