cucumber 11.0.0 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -6
- data/VERSION +1 -1
- data/lib/cucumber/cli/main.rb +22 -0
- data/lib/cucumber/configuration.rb +4 -0
- data/lib/cucumber/events/base.rb +25 -0
- data/lib/cucumber/events/envelope.rb +11 -2
- data/lib/cucumber/events/gherkin_source_parsed.rb +12 -3
- data/lib/cucumber/events/gherkin_source_read.rb +11 -3
- data/lib/cucumber/events/hook_test_step_created.rb +12 -2
- data/lib/cucumber/events/step_activated.rb +13 -7
- data/lib/cucumber/events/step_definition_registered.rb +12 -4
- data/lib/cucumber/events/test_case_created.rb +11 -3
- data/lib/cucumber/events/test_case_finished.rb +12 -4
- data/lib/cucumber/events/test_case_ready.rb +10 -4
- data/lib/cucumber/events/test_case_started.rb +11 -2
- data/lib/cucumber/events/test_run_finished.rb +10 -3
- data/lib/cucumber/events/test_run_hook_finished.rb +11 -3
- data/lib/cucumber/events/test_run_hook_started.rb +10 -1
- data/lib/cucumber/events/test_run_started.rb +11 -2
- data/lib/cucumber/events/test_step_created.rb +12 -2
- data/lib/cucumber/events/test_step_finished.rb +12 -2
- data/lib/cucumber/events/test_step_started.rb +11 -2
- data/lib/cucumber/events/undefined_parameter_type.rb +11 -3
- data/lib/cucumber/filters/fire_before_all_hooks.rb +36 -0
- data/lib/cucumber/formatter/console.rb +15 -7
- data/lib/cucumber/formatter/console_issues.rb +5 -5
- data/lib/cucumber/formatter/fail_fast.rb +3 -4
- data/lib/cucumber/formatter/global_hooks_summary.rb +36 -0
- data/lib/cucumber/formatter/json.rb +5 -3
- data/lib/cucumber/formatter/junit.rb +4 -6
- data/lib/cucumber/formatter/message.rb +7 -4
- data/lib/cucumber/formatter/message_builder.rb +207 -205
- data/lib/cucumber/formatter/pretty.rb +2 -5
- data/lib/cucumber/formatter/progress.rb +0 -2
- data/lib/cucumber/formatter/rerun.rb +10 -4
- data/lib/cucumber/formatter/usage.rb +1 -2
- data/lib/cucumber/glue/proto_world.rb +6 -4
- data/lib/cucumber/glue/registry_and_more.rb +98 -9
- data/lib/cucumber/runtime/user_interface.rb +2 -2
- data/lib/cucumber/runtime.rb +28 -9
- metadata +9 -14
- data/lib/cucumber/formatter/errors.rb +0 -9
- data/lib/cucumber/formatter/query/hook_by_test_step.rb +0 -34
- data/lib/cucumber/formatter/query/pickle_by_test.rb +0 -28
- data/lib/cucumber/formatter/query/step_definitions_by_test_step.rb +0 -42
- data/lib/cucumber/formatter/query/test_case_started_by_test_case.rb +0 -45
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41a92bddb6a0e5cdf8a69b28abfc455f4d77516e3f4abd8283cd6a222d1f5bd9
|
|
4
|
+
data.tar.gz: 743067172c8d6e732e86a2417dfa43b809ecff66ad772477460af2b1e217c234
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b26e638126d5f0d7846390ed1ddbf2b38c76d92c19e43aa859ba8432b04a017e509a018e55abb590ad523e31f295daeec9e210506b862a310e996b138cb113ab
|
|
7
|
+
data.tar.gz: 5360ce612562f89839f87cf568f8a0adc3d732e224f99900653e8c58a0b4c51892932c9568b10e58365f2652fe867023d7bd32f05df7a95860583167b52cfd55
|
data/README.md
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
<
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<img src="docs/img/logo.svg" alt="Cucumber logo" width="75">
|
|
3
|
+
<br>
|
|
4
|
+
Cucumber
|
|
5
|
+
</h1>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<div align="center">
|
|
4
8
|
|
|
5
|
-
[](https://badge.fury.io/rb/cucumber)
|
|
10
|
+
[](https://scorecard.dev/viewer/?uri=github.com/cucumber/cucumber-ruby)
|
|
6
11
|
[](https://opencollective.com/cucumber)
|
|
7
12
|
[](https://opencollective.com/cucumber)
|
|
8
|
-
[](https://vshymanskyy.github.io/StandWithUkraine)
|
|
14
|
+
|
|
15
|
+
[](https://github.com/cucumber/cucumber-ruby/actions)
|
|
16
|
+
[](https://github.com/cucumber/cucumber-ruby/actions)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
11
20
|
|
|
12
21
|
Cucumber is a tool for running automated tests written in plain language. Because they're
|
|
13
22
|
written in plain language, they can be read by anyone on your team. Because they can be
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11.
|
|
1
|
+
11.1.0
|
data/lib/cucumber/cli/main.rb
CHANGED
|
@@ -23,6 +23,7 @@ module Cucumber
|
|
|
23
23
|
|
|
24
24
|
def execute!(existing_runtime = nil)
|
|
25
25
|
trap_interrupt
|
|
26
|
+
trap_thread_dump_signal
|
|
26
27
|
|
|
27
28
|
runtime = runtime(existing_runtime)
|
|
28
29
|
|
|
@@ -90,6 +91,27 @@ module Cucumber
|
|
|
90
91
|
end
|
|
91
92
|
end
|
|
92
93
|
|
|
94
|
+
def trap_thread_dump_signal
|
|
95
|
+
signal = %w[INFO PWR].find { |s| Signal.list.key?(s) }
|
|
96
|
+
|
|
97
|
+
return if signal.nil?
|
|
98
|
+
|
|
99
|
+
trap(signal) do
|
|
100
|
+
Thread.list.each do |thread|
|
|
101
|
+
prefix = "Thread TID-#{(thread.object_id ^ Process.pid).to_s(36)} #{thread.name || '<no name>'}"
|
|
102
|
+
backtrace = thread.backtrace
|
|
103
|
+
|
|
104
|
+
if backtrace&.any?
|
|
105
|
+
backtrace.each do |line|
|
|
106
|
+
@err.puts("#{prefix} #{line}")
|
|
107
|
+
end
|
|
108
|
+
else
|
|
109
|
+
@err.puts("#{prefix} <no backtrace available>")
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
93
115
|
def runtime(existing_runtime)
|
|
94
116
|
return Runtime.new(configuration) unless existing_runtime
|
|
95
117
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# TODO: Remove this class and use Cucumber::Core::Event::Base once v17 of core is minimum
|
|
4
|
+
module Cucumber
|
|
5
|
+
module Events
|
|
6
|
+
# An archetype of what each Cucumber Event defined in cucumber-ruby must adhere to
|
|
7
|
+
class Base
|
|
8
|
+
# The "key" name of the class to be used as the key in the event registry (Underscored name symbolized)
|
|
9
|
+
# @return [Symbol]
|
|
10
|
+
def self.event_id
|
|
11
|
+
raise 'Must be implemented in subclass'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The properties of each event. Stored in iVar named format - where the key is the name of the iVar
|
|
15
|
+
# @return [Hash<Symbol>]
|
|
16
|
+
def to_h
|
|
17
|
+
instance_variables.to_h { |variable_name| [variable_name[1..].to_sym, instance_variable_get(variable_name)] }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def event_id
|
|
21
|
+
self.class.event_id
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
|
-
class Envelope <
|
|
7
|
+
class Envelope < Base
|
|
8
8
|
attr_reader :envelope
|
|
9
9
|
|
|
10
|
+
def self.event_id
|
|
11
|
+
:envelope
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def initialize(envelope)
|
|
15
|
+
@envelope = envelope
|
|
16
|
+
super()
|
|
17
|
+
end
|
|
18
|
+
|
|
10
19
|
def inspect
|
|
11
20
|
"Envelope Event -> Message Type: #{type}}"
|
|
12
21
|
end
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Fired after we've parsed the contents of a feature file
|
|
8
|
-
class GherkinSourceParsed <
|
|
9
|
-
# The Gherkin Ast
|
|
8
|
+
class GherkinSourceParsed < Base
|
|
9
|
+
# # The Gherkin Ast
|
|
10
10
|
attr_reader :gherkin_document
|
|
11
|
+
|
|
12
|
+
def self.event_id
|
|
13
|
+
:gherkin_source_parsed
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def initialize(gherkin_document)
|
|
17
|
+
@gherkin_document = gherkin_document
|
|
18
|
+
super()
|
|
19
|
+
end
|
|
11
20
|
end
|
|
12
21
|
end
|
|
13
22
|
end
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
5
|
# Fired after we've read in the contents of a feature file
|
|
8
|
-
class GherkinSourceRead <
|
|
6
|
+
class GherkinSourceRead < Base
|
|
9
7
|
# The path to the file
|
|
10
8
|
attr_reader :path
|
|
11
9
|
|
|
12
10
|
# The raw Gherkin source
|
|
13
11
|
attr_reader :body
|
|
12
|
+
|
|
13
|
+
def self.event_id
|
|
14
|
+
:gherkin_source_read
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def initialize(path, body)
|
|
18
|
+
@path = path
|
|
19
|
+
@body = body
|
|
20
|
+
super()
|
|
21
|
+
end
|
|
14
22
|
end
|
|
15
23
|
end
|
|
16
24
|
end
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Event fired when a step is created from a hook
|
|
8
|
-
class HookTestStepCreated <
|
|
8
|
+
class HookTestStepCreated < Base
|
|
9
9
|
attr_reader :test_step, :hook
|
|
10
|
+
|
|
11
|
+
def self.event_id
|
|
12
|
+
:hook_test_step_created
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def initialize(test_step, hook)
|
|
16
|
+
@test_step = test_step
|
|
17
|
+
@hook = hook
|
|
18
|
+
super()
|
|
19
|
+
end
|
|
10
20
|
end
|
|
11
21
|
end
|
|
12
22
|
end
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
5
|
# Event fired when a step is activated
|
|
8
|
-
class StepActivated <
|
|
6
|
+
class StepActivated < Base
|
|
9
7
|
# The test step that was matched.
|
|
10
|
-
#
|
|
11
|
-
# @return [Cucumber::Core::Test::Step]
|
|
8
|
+
# @return [Cucumber::Core::Test::Step]
|
|
12
9
|
attr_reader :test_step
|
|
13
10
|
|
|
14
11
|
# Information about the matching definition.
|
|
15
|
-
#
|
|
16
|
-
# @return [Cucumber::StepMatch]
|
|
12
|
+
# @return [Cucumber::StepMatch]
|
|
17
13
|
attr_reader :step_match
|
|
14
|
+
|
|
15
|
+
def self.event_id
|
|
16
|
+
:step_activated
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def initialize(test_step, step_match)
|
|
20
|
+
@test_step = test_step
|
|
21
|
+
@step_match = step_match
|
|
22
|
+
super()
|
|
23
|
+
end
|
|
18
24
|
end
|
|
19
25
|
end
|
|
20
26
|
end
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Event fired after each step definition has been registered
|
|
8
|
-
class StepDefinitionRegistered <
|
|
8
|
+
class StepDefinitionRegistered < Base
|
|
9
9
|
# The step definition that was just registered.
|
|
10
|
-
#
|
|
11
|
-
# @return [RbSupport::RbStepDefinition]
|
|
10
|
+
# @return [RbSupport::RbStepDefinition]
|
|
12
11
|
attr_reader :step_definition
|
|
12
|
+
|
|
13
|
+
def self.event_id
|
|
14
|
+
:step_definition_registered
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def initialize(step_definition)
|
|
18
|
+
@step_definition = step_definition
|
|
19
|
+
super()
|
|
20
|
+
end
|
|
13
21
|
end
|
|
14
22
|
end
|
|
15
23
|
end
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
5
|
# Event fired when a Test::Case is created from a Pickle
|
|
8
|
-
class TestCaseCreated <
|
|
6
|
+
class TestCaseCreated < Base
|
|
9
7
|
attr_reader :test_case, :pickle
|
|
8
|
+
|
|
9
|
+
def self.event_id
|
|
10
|
+
:test_case_created
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(test_case, pickle)
|
|
14
|
+
@test_case = test_case
|
|
15
|
+
@pickle = pickle
|
|
16
|
+
super()
|
|
17
|
+
end
|
|
10
18
|
end
|
|
11
19
|
end
|
|
12
20
|
end
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
|
-
#
|
|
8
|
-
class TestCaseFinished <
|
|
5
|
+
# Event fired when a Test::Case is created from a Pickle
|
|
6
|
+
class TestCaseFinished < Base
|
|
9
7
|
# @return [Cucumber::Core::Test::Case] that was executed
|
|
10
8
|
attr_reader :test_case
|
|
11
9
|
|
|
12
10
|
# @return [Cucumber::Core::Test::Result] the result of running the {Cucumber::Core::Test::Case}
|
|
13
11
|
attr_reader :result
|
|
12
|
+
|
|
13
|
+
def self.event_id
|
|
14
|
+
:test_case_finished
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def initialize(test_case, result)
|
|
18
|
+
@test_case = test_case
|
|
19
|
+
@result = result
|
|
20
|
+
super()
|
|
21
|
+
end
|
|
14
22
|
end
|
|
15
23
|
end
|
|
16
24
|
end
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
|
-
|
|
8
|
-
class TestCaseReady < Core::Event.new(:test_case)
|
|
5
|
+
class TestCaseReady < Base
|
|
9
6
|
attr_reader :test_case
|
|
7
|
+
|
|
8
|
+
def self.event_id
|
|
9
|
+
:test_case_ready
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def initialize(test_case)
|
|
13
|
+
@test_case = test_case
|
|
14
|
+
super()
|
|
15
|
+
end
|
|
10
16
|
end
|
|
11
17
|
end
|
|
12
18
|
end
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Signals that a {Cucumber::Core::Test::Case} is about to be executed
|
|
8
|
-
class TestCaseStarted <
|
|
8
|
+
class TestCaseStarted < Base
|
|
9
9
|
# @return [Cucumber::Core::Test::Case] the test case to be executed
|
|
10
10
|
attr_reader :test_case
|
|
11
|
+
|
|
12
|
+
def self.event_id
|
|
13
|
+
:test_case_started
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def initialize(test_case)
|
|
17
|
+
@test_case = test_case
|
|
18
|
+
super()
|
|
19
|
+
end
|
|
11
20
|
end
|
|
12
21
|
end
|
|
13
22
|
end
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
5
|
# Event fired after all test cases have finished executing
|
|
8
|
-
class TestRunFinished <
|
|
6
|
+
class TestRunFinished < Base
|
|
9
7
|
attr_reader :success
|
|
8
|
+
|
|
9
|
+
def self.event_id
|
|
10
|
+
:test_run_finished
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(success = nil)
|
|
14
|
+
@success = success
|
|
15
|
+
super()
|
|
16
|
+
end
|
|
10
17
|
end
|
|
11
18
|
end
|
|
12
19
|
end
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
|
-
class TestRunHookFinished <
|
|
5
|
+
class TestRunHookFinished < Base
|
|
8
6
|
attr_reader :hook, :test_result
|
|
7
|
+
|
|
8
|
+
def self.event_id
|
|
9
|
+
:test_run_hook_finished
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def initialize(hook, test_result)
|
|
13
|
+
@hook = hook
|
|
14
|
+
@test_result = test_result
|
|
15
|
+
super()
|
|
16
|
+
end
|
|
9
17
|
end
|
|
10
18
|
end
|
|
11
19
|
end
|
|
@@ -4,8 +4,17 @@ require 'cucumber/core/events'
|
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
|
-
class TestRunHookStarted <
|
|
7
|
+
class TestRunHookStarted < Base
|
|
8
8
|
attr_reader :hook
|
|
9
|
+
|
|
10
|
+
def self.event_id
|
|
11
|
+
:test_run_hook_started
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def initialize(hook)
|
|
15
|
+
@hook = hook
|
|
16
|
+
super()
|
|
17
|
+
end
|
|
9
18
|
end
|
|
10
19
|
end
|
|
11
20
|
end
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Event fired once all test cases have been filtered before
|
|
8
8
|
# the first one is executed.
|
|
9
|
-
class TestRunStarted <
|
|
9
|
+
class TestRunStarted < Base
|
|
10
10
|
# @return [Array<Cucumber::Core::Test::Case>] the test cases to be executed
|
|
11
11
|
attr_reader :test_cases
|
|
12
|
+
|
|
13
|
+
def self.event_id
|
|
14
|
+
:test_run_started
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def initialize(test_cases)
|
|
18
|
+
@test_cases = test_cases
|
|
19
|
+
super()
|
|
20
|
+
end
|
|
12
21
|
end
|
|
13
22
|
end
|
|
14
23
|
end
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Event fired when a TestStep is created from a PickleStep
|
|
8
|
-
class TestStepCreated <
|
|
8
|
+
class TestStepCreated < Base
|
|
9
9
|
attr_reader :test_step, :pickle_step
|
|
10
|
+
|
|
11
|
+
def self.event_id
|
|
12
|
+
:test_step_created
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def initialize(test_step, pickle_step)
|
|
16
|
+
@test_step = test_step
|
|
17
|
+
@pickle_step = pickle_step
|
|
18
|
+
super()
|
|
19
|
+
end
|
|
10
20
|
end
|
|
11
21
|
end
|
|
12
22
|
end
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Signals that a {Cucumber::Core::Test::Step} has finished executing
|
|
8
|
-
class TestStepFinished <
|
|
8
|
+
class TestStepFinished < Base
|
|
9
9
|
# @return [Cucumber::Core::Test::Step] the test step that was executed
|
|
10
10
|
attr_reader :test_step
|
|
11
11
|
|
|
12
12
|
# @return [Cucumber::Core::Test::Result] the result of running the {Cucumber::Core::Test::Step}
|
|
13
13
|
attr_reader :result
|
|
14
|
+
|
|
15
|
+
def self.event_id
|
|
16
|
+
:test_step_finished
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def initialize(test_step, result)
|
|
20
|
+
@test_step = test_step
|
|
21
|
+
@result = result
|
|
22
|
+
super()
|
|
23
|
+
end
|
|
14
24
|
end
|
|
15
25
|
end
|
|
16
26
|
end
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'base'
|
|
4
4
|
|
|
5
5
|
module Cucumber
|
|
6
6
|
module Events
|
|
7
7
|
# Signals that a {Cucumber::Core::Test::Step} is about to be executed
|
|
8
|
-
class TestStepStarted <
|
|
8
|
+
class TestStepStarted < Base
|
|
9
9
|
# @return [Cucumber::Core::Test::Step] the test step to be executed
|
|
10
10
|
attr_reader :test_step
|
|
11
|
+
|
|
12
|
+
def self.event_id
|
|
13
|
+
:test_step_started
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def initialize(test_step)
|
|
17
|
+
@test_step = test_step
|
|
18
|
+
super()
|
|
19
|
+
end
|
|
11
20
|
end
|
|
12
21
|
end
|
|
13
22
|
end
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'cucumber/core/events'
|
|
4
|
-
|
|
5
3
|
module Cucumber
|
|
6
4
|
module Events
|
|
7
|
-
class UndefinedParameterType <
|
|
5
|
+
class UndefinedParameterType < Base
|
|
8
6
|
attr_reader :type_name, :expression
|
|
7
|
+
|
|
8
|
+
def self.event_id
|
|
9
|
+
:undefined_parameter_type
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def initialize(type_name, expression)
|
|
13
|
+
@type_name = type_name
|
|
14
|
+
@expression = expression
|
|
15
|
+
super()
|
|
16
|
+
end
|
|
9
17
|
end
|
|
10
18
|
end
|
|
11
19
|
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cucumber
|
|
4
|
+
module Filters
|
|
5
|
+
# Executes all BeforeAll hooks and ONLY if they were all
|
|
6
|
+
# successful pass on all the `TestCase` objects down the filter chain
|
|
7
|
+
class FireBeforeAllHooks < Core::Filter.new(:config)
|
|
8
|
+
def initialize(support_code, receiver = nil)
|
|
9
|
+
super
|
|
10
|
+
@support_code = support_code
|
|
11
|
+
@test_cases = []
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def test_case(test_case)
|
|
15
|
+
@test_cases << test_case
|
|
16
|
+
self
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def done
|
|
20
|
+
if fire_before_all_hook
|
|
21
|
+
@test_cases.map do |test_case|
|
|
22
|
+
test_case.describe_to(@receiver)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
receiver.done
|
|
26
|
+
self
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
def fire_before_all_hook
|
|
32
|
+
@support_code.fire_hook(:before_all)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|