Class: Gurke::Reporters::TeamCityReporter

Inherits:
DefaultReporter show all
Defined in:
lib/gurke/reporters/team_city_reporter.rb

Overview

The TeamCityReporter prints features, scenarios and steps in a format parseable by TeamCity CI.

Constant Summary

Constants inherited from Gurke::Reporter

Gurke::Reporter::CALLBACKS

Instance Attribute Summary

Attributes inherited from DefaultReporter

#io

Instance Method Summary collapse

Methods inherited from DefaultReporter

#after_features, #after_step, #before_step, #end_background, #initialize, #retry_scenario, #start_background

Methods inherited from Gurke::Reporter

#after_features, #after_step, #before_features, #before_step, #end_background, #end_feature, #end_features, #end_scenario, #end_step, #retry_scenario, #start_background, #start_feature, #start_features, #start_scenario, #start_step

Constructor Details

This class inherits a constructor from Gurke::Reporters::DefaultReporter

Instance Method Details

#after_feature(feature) ⇒ Object



42
43
44
45
46
# File 'lib/gurke/reporters/team_city_reporter.rb', line 42

def after_feature(feature)
  publish :testSuiteFinished, name: feature.name

  super
end

#after_scenario(scenario) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gurke/reporters/team_city_reporter.rb', line 21

def after_scenario(scenario)
  if scenario.failed?
    publish :testFailed,
      name: scenario.name,
      message: scenario.exception.inspect,
      backtrace: scenario.exception.backtrace.join('\n')
  elsif scenario.pending?
    publish :testIgnored,
      name: scenario.name,
      message: 'Step definition missing'
  elsif scenario.aborted?
    publish :testIgnored,
      name: scenario.name,
      message: 'Aborted.'
  end

  publish :testFinished, name: scenario.name

  super
end

#before_feature(feature) ⇒ Object



9
10
11
12
13
# File 'lib/gurke/reporters/team_city_reporter.rb', line 9

def before_feature(feature)
  publish :testSuiteStarted, name: feature.name

  super
end

#before_scenario(scenario) ⇒ Object



15
16
17
18
19
# File 'lib/gurke/reporters/team_city_reporter.rb', line 15

def before_scenario(scenario)
  publish :testStarted, name: scenario.name

  super
end