cucumber 11.1.1 → 12.0.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/VERSION +1 -1
- data/lib/cucumber/cli/configuration.rb +0 -6
- data/lib/cucumber/cli/options.rb +0 -16
- data/lib/cucumber/configuration.rb +5 -5
- data/lib/cucumber/errors.rb +43 -23
- data/lib/cucumber/events/attach_called.rb +12 -3
- data/lib/cucumber/events/envelope.rb +2 -2
- data/lib/cucumber/events/gherkin_source_parsed.rb +1 -3
- data/lib/cucumber/events/gherkin_source_read.rb +1 -1
- data/lib/cucumber/events/hook_test_step_created.rb +1 -3
- data/lib/cucumber/events/step_activated.rb +1 -1
- data/lib/cucumber/events/step_definition_registered.rb +1 -3
- data/lib/cucumber/events/test_case_created.rb +1 -1
- data/lib/cucumber/events/test_case_finished.rb +1 -1
- data/lib/cucumber/events/test_case_ready.rb +1 -1
- data/lib/cucumber/events/test_case_started.rb +1 -3
- data/lib/cucumber/events/test_run_finished.rb +1 -1
- data/lib/cucumber/events/test_run_hook_finished.rb +1 -1
- data/lib/cucumber/events/test_run_hook_started.rb +1 -3
- data/lib/cucumber/events/test_run_started.rb +1 -3
- data/lib/cucumber/events/test_step_created.rb +1 -3
- data/lib/cucumber/events/test_step_finished.rb +1 -3
- data/lib/cucumber/events/test_step_started.rb +1 -3
- data/lib/cucumber/events/undefined_parameter_type.rb +1 -1
- data/lib/cucumber/events.rb +6 -2
- data/lib/cucumber/filters/retry.rb +7 -22
- data/lib/cucumber/formatter/console_counts.rb +5 -3
- data/lib/cucumber/formatter/console_issues.rb +3 -3
- data/lib/cucumber/formatter/fail_fast.rb +2 -2
- data/lib/cucumber/formatter/html.rb +6 -4
- data/lib/cucumber/formatter/junit.rb +3 -3
- data/lib/cucumber/formatter/message_builder.rb +25 -139
- data/lib/cucumber/formatter/pretty.rb +1 -1
- data/lib/cucumber/formatter/rerun.rb +13 -41
- data/lib/cucumber/glue/hook.rb +0 -1
- data/lib/cucumber/glue/multiple_world.rb +26 -0
- data/lib/cucumber/glue/nil_world.rb +12 -0
- data/lib/cucumber/glue/registry_and_more.rb +15 -32
- data/lib/cucumber/multiline_argument/data_table.rb +5 -7
- data/lib/cucumber/retry_policy.rb +27 -0
- data/lib/cucumber/rspec/doubles.rb +1 -7
- data/lib/cucumber/runtime/meta_message_builder.rb +1 -1
- data/lib/cucumber/runtime/user_interface.rb +13 -0
- data/lib/cucumber/runtime.rb +26 -47
- metadata +51 -25
- data/lib/cucumber/events/base.rb +0 -25
- data/lib/cucumber/query.rb +0 -273
- data/lib/cucumber/repository.rb +0 -136
data/lib/cucumber/repository.rb
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Cucumber
|
|
4
|
-
# In memory repository i.e. a thread based link to cucumber-query
|
|
5
|
-
class Repository
|
|
6
|
-
attr_accessor :meta, :test_run_started, :test_run_finished
|
|
7
|
-
attr_reader :attachments_by_test_case_started_id, :attachments_by_test_run_hook_started_id,
|
|
8
|
-
:hook_by_id,
|
|
9
|
-
:pickle_by_id, :pickle_step_by_id,
|
|
10
|
-
:step_by_id, :step_definition_by_id,
|
|
11
|
-
:test_case_by_id, :test_case_started_by_id, :test_case_finished_by_test_case_started_id,
|
|
12
|
-
:test_run_hook_started_by_id, :test_run_hook_finished_by_test_run_hook_started_id,
|
|
13
|
-
:test_step_by_id, :test_steps_started_by_test_case_started_id, :test_steps_finished_by_test_case_started_id
|
|
14
|
-
|
|
15
|
-
# TODO: Missing structs (2)
|
|
16
|
-
# final Map<String, List<Suggestion>> suggestionsByPickleStepId = new LinkedHashMap<>();
|
|
17
|
-
# final List<UndefinedParameterType> undefinedParameterTypes = new ArrayList<>();
|
|
18
|
-
|
|
19
|
-
# TODO: Missing handlers
|
|
20
|
-
# Source
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
def initialize
|
|
24
|
-
@attachments_by_test_case_started_id = Hash.new { |hash, key| hash[key] = [] }
|
|
25
|
-
@attachments_by_test_run_hook_started_id = Hash.new { |hash, key| hash[key] = [] }
|
|
26
|
-
@hook_by_id = {}
|
|
27
|
-
@pickle_by_id = {}
|
|
28
|
-
@pickle_step_by_id = {}
|
|
29
|
-
@step_by_id = {}
|
|
30
|
-
@step_definition_by_id = {}
|
|
31
|
-
@test_case_by_id = {}
|
|
32
|
-
@test_case_started_by_id = {}
|
|
33
|
-
@test_case_finished_by_test_case_started_id = {}
|
|
34
|
-
@test_run_hook_started_by_id = {}
|
|
35
|
-
@test_run_hook_finished_by_test_run_hook_started_id = {}
|
|
36
|
-
@test_step_by_id = {}
|
|
37
|
-
@test_steps_started_by_test_case_started_id = Hash.new { |hash, key| hash[key] = [] }
|
|
38
|
-
@test_steps_finished_by_test_case_started_id = Hash.new { |hash, key| hash[key] = [] }
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def update(envelope)
|
|
42
|
-
return self.meta = envelope.meta if envelope.meta
|
|
43
|
-
return self.test_run_started = envelope.test_run_started if envelope.test_run_started
|
|
44
|
-
return self.test_run_finished = envelope.test_run_finished if envelope.test_run_finished
|
|
45
|
-
return update_attachment(envelope.attachment) if envelope.attachment
|
|
46
|
-
return update_gherkin_document(envelope.gherkin_document) if envelope.gherkin_document
|
|
47
|
-
return update_hook(envelope.hook) if envelope.hook
|
|
48
|
-
return update_pickle(envelope.pickle) if envelope.pickle
|
|
49
|
-
return update_step_definition(envelope.step_definition) if envelope.step_definition
|
|
50
|
-
return update_test_run_hook_started(envelope.test_run_hook_started) if envelope.test_run_hook_started
|
|
51
|
-
return update_test_run_hook_finished(envelope.test_run_hook_finished) if envelope.test_run_hook_finished
|
|
52
|
-
return update_test_case_started(envelope.test_case_started) if envelope.test_case_started
|
|
53
|
-
return update_test_case_finished(envelope.test_case_finished) if envelope.test_case_finished
|
|
54
|
-
return update_test_step_started(envelope.test_step_started) if envelope.test_step_started
|
|
55
|
-
return update_test_step_finished(envelope.test_step_finished) if envelope.test_step_finished
|
|
56
|
-
return update_test_case(envelope.test_case) if envelope.test_case
|
|
57
|
-
|
|
58
|
-
nil
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
private
|
|
62
|
-
|
|
63
|
-
def update_attachment(attachment)
|
|
64
|
-
attachments_by_test_case_started_id[attachment.test_case_started_id] << attachment if attachment.test_case_started_id
|
|
65
|
-
attachments_by_test_run_hook_started_id[attachment.test_run_hook_started_id] << attachment if attachment.test_run_hook_started_id
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def update_feature(feature)
|
|
69
|
-
feature.children.each do |feature_child|
|
|
70
|
-
update_steps(feature_child.background.steps) if feature_child.background
|
|
71
|
-
update_scenario(feature_child.scenario) if feature_child.scenario
|
|
72
|
-
next unless feature_child.rule
|
|
73
|
-
|
|
74
|
-
feature_child.rule.children.each do |rule_child|
|
|
75
|
-
update_steps(rule_child.background.steps) if rule_child.background
|
|
76
|
-
update_scenario(rule_child.scenario) if rule_child.scenario
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
def update_gherkin_document(gherkin_document)
|
|
82
|
-
# TODO: Update lineage at a later date. Java Impl -> lineageById.putAll(Lineages.of(document));
|
|
83
|
-
update_feature(gherkin_document.feature) if gherkin_document.feature
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def update_hook(hook)
|
|
87
|
-
hook_by_id[hook.id] = hook
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def update_pickle(pickle)
|
|
91
|
-
pickle_by_id[pickle.id] = pickle
|
|
92
|
-
pickle.steps.each { |pickle_step| pickle_step_by_id[pickle_step.id] = pickle_step }
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def update_scenario(scenario)
|
|
96
|
-
update_steps(scenario.steps)
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
def update_steps(steps)
|
|
100
|
-
steps.each { |step| step_by_id[step.id] = step }
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
def update_step_definition(step_definition)
|
|
104
|
-
step_definition_by_id[step_definition.id] = step_definition
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
def update_test_case(test_case)
|
|
108
|
-
test_case_by_id[test_case.id] = test_case
|
|
109
|
-
test_case.test_steps.each { |test_step| test_step_by_id[test_step.id] = test_step }
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def update_test_case_started(test_case_started)
|
|
113
|
-
test_case_started_by_id[test_case_started.id] = test_case_started
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
def update_test_case_finished(test_case_finished)
|
|
117
|
-
test_case_finished_by_test_case_started_id[test_case_finished.test_case_started_id] = test_case_finished
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
def update_test_run_hook_started(test_run_hook_started)
|
|
121
|
-
test_run_hook_started_by_id[test_run_hook_started.id] = test_run_hook_started
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
def update_test_run_hook_finished(test_run_hook_finished)
|
|
125
|
-
test_run_hook_finished_by_test_run_hook_started_id[test_run_hook_finished.test_run_hook_started_id] = test_run_hook_finished
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
def update_test_step_started(test_step_started)
|
|
129
|
-
test_steps_started_by_test_case_started_id[test_step_started.test_case_started_id] << test_step_started
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
def update_test_step_finished(test_step_finished)
|
|
133
|
-
test_steps_finished_by_test_case_started_id[test_step_finished.test_case_started_id] << test_step_finished
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
end
|