cucumber 10.2.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 +17 -8
- data/VERSION +1 -1
- data/lib/cucumber/cli/configuration.rb +1 -1
- data/lib/cucumber/cli/main.rb +22 -0
- data/lib/cucumber/cli/options.rb +3 -18
- data/lib/cucumber/cli/profile_loader.rb +2 -2
- data/lib/cucumber/cli/rerun_file.rb +1 -1
- data/lib/cucumber/cli.rb +3 -0
- data/lib/cucumber/configuration.rb +33 -24
- data/lib/cucumber/events/base.rb +25 -0
- data/lib/cucumber/events/envelope.rb +29 -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 +19 -0
- data/lib/cucumber/events/test_run_hook_started.rb +20 -0
- 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/events.rb +2 -0
- data/lib/cucumber/filters/fire_before_all_hooks.rb +36 -0
- data/lib/cucumber/filters/randomizer.rb +5 -5
- data/lib/cucumber/filters/reverser.rb +41 -0
- data/lib/cucumber/filters.rb +1 -12
- data/lib/cucumber/formatter/ansicolor.rb +3 -0
- data/lib/cucumber/formatter/console.rb +15 -7
- data/lib/cucumber/formatter/console_issues.rb +5 -5
- data/lib/cucumber/formatter/duration_extractor.rb +2 -0
- data/lib/cucumber/formatter/fail_fast.rb +3 -4
- data/lib/cucumber/formatter/global_hooks_summary.rb +36 -0
- data/lib/cucumber/formatter/html.rb +1 -3
- data/lib/cucumber/formatter/json.rb +5 -3
- data/lib/cucumber/formatter/junit.rb +5 -34
- data/lib/cucumber/formatter/message.rb +8 -4
- data/lib/cucumber/formatter/message_builder.rb +249 -143
- data/lib/cucumber/formatter/pretty.rb +2 -5
- data/lib/cucumber/formatter/progress.rb +1 -2
- data/lib/cucumber/formatter/rerun.rb +80 -30
- data/lib/cucumber/formatter/usage.rb +2 -3
- data/lib/cucumber/formatter.rb +3 -0
- data/lib/cucumber/glue/proto_world.rb +6 -4
- data/lib/cucumber/glue/registry_and_more.rb +122 -20
- data/lib/cucumber/glue.rb +3 -0
- data/lib/cucumber/multiline_argument/data_table.rb +0 -11
- data/lib/cucumber/platform.rb +2 -2
- data/lib/cucumber/query.rb +273 -0
- data/lib/cucumber/rake/forked_cucumber_runner.rb +57 -0
- data/lib/cucumber/rake/in_process_cucumber_runner.rb +27 -0
- data/lib/cucumber/rake/task.rb +36 -106
- data/lib/cucumber/rake.rb +3 -0
- data/lib/cucumber/repository.rb +136 -0
- data/lib/cucumber/rspec/disable_option_parser.rb +3 -3
- data/lib/cucumber/runtime/user_interface.rb +2 -2
- data/lib/cucumber/runtime.rb +29 -9
- data/lib/cucumber/step_match.rb +1 -1
- data/lib/cucumber.rb +2 -13
- metadata +33 -30
- 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/pickle_step_by_test_step.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 -44
- data/lib/cucumber/formatter/query/test_run_started.rb +0 -17
- data/lib/cucumber/step_definition_light.rb +0 -29
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
|
|
@@ -45,12 +54,12 @@ Later in this document, bundler is considered being used so all commands are usi
|
|
|
45
54
|
|
|
46
55
|
### Supported platforms
|
|
47
56
|
|
|
57
|
+
- Ruby 4.0
|
|
48
58
|
- Ruby 3.4
|
|
49
59
|
- Ruby 3.3
|
|
50
60
|
- Ruby 3.2
|
|
51
|
-
- Ruby 3.1
|
|
52
61
|
- TruffleRuby 24.0.0+
|
|
53
|
-
- JRuby
|
|
62
|
+
- JRuby 10.0+ (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/main/docs/jruby-limitations.md))
|
|
54
63
|
|
|
55
64
|
### Ruby on Rails
|
|
56
65
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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
|
|
data/lib/cucumber/cli/options.rb
CHANGED
|
@@ -63,7 +63,7 @@ module Cucumber
|
|
|
63
63
|
PROFILE_SHORT_FLAG, PROFILE_LONG_FLAG, RETRY_FLAG, RETRY_TOTAL_FLAG,
|
|
64
64
|
'-l', '--lines', '--port', '-I', '--snippet-type'
|
|
65
65
|
].freeze
|
|
66
|
-
ORDER_TYPES = %w[defined random].freeze
|
|
66
|
+
ORDER_TYPES = %w[defined random reverse].freeze
|
|
67
67
|
TAG_LIMIT_MATCHER = /(?<tag_name>@\w+):(?<limit>\d+)/x.freeze
|
|
68
68
|
|
|
69
69
|
def self.parse(args, out_stream, error_stream, options = {})
|
|
@@ -146,6 +146,7 @@ module Cucumber
|
|
|
146
146
|
*<<~TEXT.split("\n")) do |order|
|
|
147
147
|
[defined] Run scenarios in the order they were defined (default).
|
|
148
148
|
[random] Shuffle scenarios before running.
|
|
149
|
+
[reverse] Run scenarios in the opposite order to which they were defined.
|
|
149
150
|
Specify SEED to reproduce the shuffling from a previous run.
|
|
150
151
|
e.g. --order random:5738
|
|
151
152
|
TEXT
|
|
@@ -601,23 +602,7 @@ module Cucumber
|
|
|
601
602
|
end
|
|
602
603
|
|
|
603
604
|
def default_options
|
|
604
|
-
|
|
605
|
-
strict: Cucumber::Core::Test::Result::StrictConfiguration.new,
|
|
606
|
-
require: [],
|
|
607
|
-
dry_run: false,
|
|
608
|
-
formats: [],
|
|
609
|
-
excludes: [],
|
|
610
|
-
tag_expressions: [],
|
|
611
|
-
tag_limits: {},
|
|
612
|
-
name_regexps: [],
|
|
613
|
-
env_vars: {},
|
|
614
|
-
diff_enabled: true,
|
|
615
|
-
snippets: true,
|
|
616
|
-
source: true,
|
|
617
|
-
duration: true,
|
|
618
|
-
retry: 0,
|
|
619
|
-
retry_total: Float::INFINITY
|
|
620
|
-
}
|
|
605
|
+
Cucumber::Configuration.default_options
|
|
621
606
|
end
|
|
622
607
|
end
|
|
623
608
|
end
|
|
@@ -80,9 +80,9 @@ module Cucumber
|
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
def process_configuration_file_with_erb
|
|
83
|
-
@cucumber_erb = ERB.new(
|
|
83
|
+
@cucumber_erb = ERB.new(File.read(cucumber_file), trim_mode: '%').result(binding)
|
|
84
84
|
rescue StandardError
|
|
85
|
-
raise(YmlLoadError, "cucumber.yml was found, but could not be parsed with ERB.
|
|
85
|
+
raise(YmlLoadError, "cucumber.yml was found, but could not be parsed with ERB. Please refer to cucumber's documentation on correct profile usage.\n#{$ERROR_INFO.inspect}")
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def load_configuration
|
data/lib/cucumber/cli.rb
ADDED
|
@@ -19,6 +19,30 @@ module Cucumber
|
|
|
19
19
|
new
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def self.default_options
|
|
23
|
+
{
|
|
24
|
+
autoload_code_paths: %w[features/support features/step_definitions],
|
|
25
|
+
filters: [],
|
|
26
|
+
strict: Cucumber::Core::Test::Result::StrictConfiguration.new,
|
|
27
|
+
require: [],
|
|
28
|
+
dry_run: false,
|
|
29
|
+
fail_fast: false,
|
|
30
|
+
formats: [],
|
|
31
|
+
excludes: [],
|
|
32
|
+
tag_expressions: [],
|
|
33
|
+
name_regexps: [],
|
|
34
|
+
env_vars: {},
|
|
35
|
+
diff_enabled: true,
|
|
36
|
+
snippets: true,
|
|
37
|
+
source: true,
|
|
38
|
+
duration: true,
|
|
39
|
+
event_bus: Cucumber::Events.make_event_bus,
|
|
40
|
+
retry_total: Float::INFINITY,
|
|
41
|
+
tag_limits: {},
|
|
42
|
+
retry: 0
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
22
46
|
# Subscribe to an event.
|
|
23
47
|
#
|
|
24
48
|
# See {Cucumber::Events} for the list of possible events.
|
|
@@ -35,7 +59,7 @@ module Cucumber
|
|
|
35
59
|
end
|
|
36
60
|
|
|
37
61
|
def initialize(user_options = {})
|
|
38
|
-
@options = default_options.merge(Hash(user_options))
|
|
62
|
+
@options = self.class.default_options.merge(Hash(user_options))
|
|
39
63
|
end
|
|
40
64
|
|
|
41
65
|
def with_options(new_options)
|
|
@@ -54,6 +78,10 @@ module Cucumber
|
|
|
54
78
|
@options[:order] == 'random'
|
|
55
79
|
end
|
|
56
80
|
|
|
81
|
+
def reverse_order?
|
|
82
|
+
@options[:order] == 'reverse'
|
|
83
|
+
end
|
|
84
|
+
|
|
57
85
|
def seed
|
|
58
86
|
@options[:seed]
|
|
59
87
|
end
|
|
@@ -257,31 +285,12 @@ module Cucumber
|
|
|
257
285
|
@id_generator ||= Cucumber::Messages::Helpers::IdGenerator::UUID.new
|
|
258
286
|
end
|
|
259
287
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
def default_options
|
|
263
|
-
{
|
|
264
|
-
autoload_code_paths: ['features/support', 'features/step_definitions'],
|
|
265
|
-
filters: [],
|
|
266
|
-
strict: Cucumber::Core::Test::Result::StrictConfiguration.new,
|
|
267
|
-
require: [],
|
|
268
|
-
dry_run: false,
|
|
269
|
-
publish_quiet: false,
|
|
270
|
-
fail_fast: false,
|
|
271
|
-
formats: [],
|
|
272
|
-
excludes: [],
|
|
273
|
-
tag_expressions: [],
|
|
274
|
-
name_regexps: [],
|
|
275
|
-
env_vars: {},
|
|
276
|
-
diff_enabled: true,
|
|
277
|
-
snippets: true,
|
|
278
|
-
source: true,
|
|
279
|
-
duration: true,
|
|
280
|
-
event_bus: Cucumber::Events.make_event_bus,
|
|
281
|
-
retry_total: Float::INFINITY
|
|
282
|
-
}
|
|
288
|
+
def test_run_started_id
|
|
289
|
+
@test_run_started_id ||= id_generator.new_id
|
|
283
290
|
end
|
|
284
291
|
|
|
292
|
+
private
|
|
293
|
+
|
|
285
294
|
def default_features_paths
|
|
286
295
|
['features']
|
|
287
296
|
end
|
|
@@ -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,11 +1,38 @@
|
|
|
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
|
+
|
|
10
|
+
def self.event_id
|
|
11
|
+
:envelope
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def initialize(envelope)
|
|
15
|
+
@envelope = envelope
|
|
16
|
+
super()
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def inspect
|
|
20
|
+
"Envelope Event -> Message Type: #{type}}"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def to_s
|
|
24
|
+
inspect
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
private
|
|
28
|
+
|
|
29
|
+
def type
|
|
30
|
+
envelope.instance_variables.detect { |message| !envelope.send(name_of(message)).nil? }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def name_of(message)
|
|
34
|
+
message.to_s.delete('@')
|
|
35
|
+
end
|
|
9
36
|
end
|
|
10
37
|
end
|
|
11
38
|
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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cucumber
|
|
4
|
+
module Events
|
|
5
|
+
class TestRunHookFinished < Base
|
|
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
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'cucumber/core/events'
|
|
4
|
+
|
|
5
|
+
module Cucumber
|
|
6
|
+
module Events
|
|
7
|
+
class TestRunHookStarted < Base
|
|
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
|
|
18
|
+
end
|
|
19
|
+
end
|
|
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
|