Class: Gurke::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/gurke/reporter.rb

Overview

A Reporter provides callbacks that will be executed whenever a specific execution step starts or ends.

Direct Known Subclasses

Gurke::Reporters::NullReporter

Constant Summary collapse

CALLBACKS =

List of all callback methods as symbols.

[
  :before_features,
  :before_feature,
  :before_scenario,
  :before_step,
  :start_features,
  :start_feature,
  :start_scenario,
  :start_background,
  :start_step,
  :end_features,
  :end_feature,
  :end_scenario,
  :end_background,
  :end_step,
  :after_features,
  :after_feature,
  :after_scenario,
  :after_step
]

Instance Method Summary collapse

Instance Method Details

#after_feature(feature) ⇒ Object

Called after each feature and after all hooks.

Parameters:

  • feature (Feature)

    Current feature.



225
226
227
228
# File 'lib/gurke/reporter.rb', line 225

def after_feature(feature)
  raise NotImplementedError.new \
    "#{self.class.name}#after_feature must be implemented in subclass."
end

#after_features(features) ⇒ Object

Called after all features and after all hooks.

Parameters:

  • features (Array<Feature>)

    List of all features.



247
248
249
250
# File 'lib/gurke/reporter.rb', line 247

def after_features(features)
  raise NotImplementedError.new \
    "#{self.class.name}#after_features must be implemented in subclass."
end

#after_scenario(scenario) ⇒ Object

Called after each scenario and after all hooks.

Parameters:

  • scenario (Scenario)

    Current scenario.

  • feature (Feature)

    Current feature.



203
204
205
206
# File 'lib/gurke/reporter.rb', line 203

def after_scenario(scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#after_scenario must be implemented in subclass."
end

#after_step(step_result, scenario) ⇒ Object

Called after each step, after all step hook.

Parameters:

  • step_result (StepResult)

    Result of current Step.

  • scenario (Scenario)

    Current scenario.

  • feature (Feature)

    Current feature.



179
180
181
182
# File 'lib/gurke/reporter.rb', line 179

def after_step(step_result, scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#after_step must be implemented in subclass."
end

#before_feature(feature) ⇒ Object

Called for each feature before it starts, but before any before-feature hook is run.

Parameters:

  • feature (Feature)

    The feature that is going to be executed now.



68
69
70
71
# File 'lib/gurke/reporter.rb', line 68

def before_feature(feature)
  raise NotImplementedError.new \
    "#{self.class.name}#start_feature must be implemented in subclass."
end

#before_features(features) ⇒ Object

Called before the execution of any feature and before any before-features hook is invoked.

Parameters:

  • features (Array<Feature>)

    List of all features that are going to be executed.



42
43
44
45
# File 'lib/gurke/reporter.rb', line 42

def before_features(features)
  raise NotImplementedError.new \
    "#{self.class.name}#before_features must be implemented in subclass."
end

#before_scenario(scenario) ⇒ Object

Called for each each scenario before it starts. Will be called before any hooks for the given scenario is executed.

Parameters:

  • scenario (Scenario)

    Current scenario.



93
94
95
96
# File 'lib/gurke/reporter.rb', line 93

def before_scenario(scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#before_scenario must be implemented in subclass."
end

#before_step(step, scenario) ⇒ Object

Called before each step and before any before-step hook.

Parameters:

  • step (Step)

    Current Step.

  • scenario (Scenario)

    Current scenario.



141
142
143
144
# File 'lib/gurke/reporter.rb', line 141

def before_step(step, scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#before_step must be implemented in subclass."
end

#end_background(background, scenario) ⇒ Object

Called after each background.

Parameters:

  • background (Background)

    Current background.

  • scenario (Scenario)

    Current scenario.



129
130
131
132
# File 'lib/gurke/reporter.rb', line 129

def end_background(background, scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#end_background must be implemented in subclass."
end

#end_feature(feature) ⇒ Object

Called after each feature but before any after hook.

Parameters:

  • feature (Feature)

    Current feature.



214
215
216
217
# File 'lib/gurke/reporter.rb', line 214

def end_feature(feature)
  raise NotImplementedError.new \
    "#{self.class.name}#end_feature must be implemented in subclass."
end

#end_features(features) ⇒ Object

Called after all features but before any after-features hook.

Parameters:

  • features (Array<Feature>)

    List of all features.



236
237
238
239
# File 'lib/gurke/reporter.rb', line 236

def end_features(features)
  raise NotImplementedError.new \
    "#{self.class.name}#end_features must be implemented in subclass."
end

#end_scenario(scenario) ⇒ Object

Called after each scenario but before any after hook.

Parameters:

  • scenario (Scenario)

    Current scenario.

  • feature (Feature)

    Current feature.



191
192
193
194
# File 'lib/gurke/reporter.rb', line 191

def end_scenario(scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#end_scenario must be implemented in subclass."
end

#end_step(step_result, scenario) ⇒ Object

Called after each step but before any after-step hook.

Parameters:

  • step_result (StepResult)

    Result of current Step.

  • scenario (Scenario)

    Current scenario.

  • feature (Feature)

    Current feature.



166
167
168
169
# File 'lib/gurke/reporter.rb', line 166

def end_step(step_result, scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#end_step must be implemented in subclass."
end

#start_background(background, scenario) ⇒ Object

Called before each background.

Parameters:

  • background (Background)

    Current background.

  • scenario (Scenario)

    Current scenario.



117
118
119
120
# File 'lib/gurke/reporter.rb', line 117

def start_background(background, scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#start_background must be implemented in subclass."
end

#start_feature(feature) ⇒ Object

Called for each feature before it starts, but after all before-feature hooks.

Parameters:

  • feature (Feature)

    The feature that is going to be executed now.



81
82
83
84
# File 'lib/gurke/reporter.rb', line 81

def start_feature(feature)
  raise NotImplementedError.new \
    "#{self.class.name}#start_feature must be implemented in subclass."
end

#start_features(features) ⇒ Object

Called before the execute of any feature, but after all before-features hooks.

Parameters:

  • features (Array<Feature>)

    List of all features that are going to be executed.



55
56
57
58
# File 'lib/gurke/reporter.rb', line 55

def start_features(features)
  raise NotImplementedError.new \
    "#{self.class.name}#before_features must be implemented in subclass."
end

#start_scenario(scenario) ⇒ Object

Called for each each scenario before it starts, but after all before hooks for given scenario.

Parameters:

  • scenario (Scenario)

    Current scenario.



105
106
107
108
# File 'lib/gurke/reporter.rb', line 105

def start_scenario(scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#start_scenario must be implemented in subclass."
end

#start_step(step, scenario) ⇒ Object

Called before each step and after all before-step hooks.

Parameters:

  • step (Step)

    Current Step.

  • scenario (Scenario)

    Current scenario.



153
154
155
156
# File 'lib/gurke/reporter.rb', line 153

def start_step(step, scenario)
  raise NotImplementedError.new \
    "#{self.class.name}#start_step must be implemented in subclass."
end