hiptest-publisher 1.10.1 → 1.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a877b09d5680c92090947262c403126a97a83d8
4
- data.tar.gz: cd24230a8f4c7222ab715fa7c39ad39c7043e728
3
+ metadata.gz: 8298bd41394d87d7001e44e9c85fdffd104f927b
4
+ data.tar.gz: 49a13acc066ef854861600ea66ebbbd2a2778d4a
5
5
  SHA512:
6
- metadata.gz: d92b261bc905cd83133a3c5beb70a4d8a79a0af30b2bb6561b71a09370663cbd51bd0055095f689d480c7251acb26976c99afe4d9c593d75ac675d76e4d88faf
7
- data.tar.gz: 9871151e896f7900e13f968495235b21d80cacb9a5d67a9f4ef0181738c48b60f4c54f930c428cbab9252f0136303b911ed45b8140634855d91722e27ec618eb
6
+ metadata.gz: 70123f226704ddf6c4a36e43ef23f847f97e0b49f597674cea525d46ff77aa9a52b8faedfab0775d10eb5ca2059f01c2fd3777d65dadd58ac7eef35f79ba02f6
7
+ data.tar.gz: c6f96de1d29f2206f86d05eb12fafdba929f3188972e7cf9adabdc3f39bd5bf8ed686e2630ff8c36693c819b0459b8c379aa921cd7dd35fc5601f6849217ef36
@@ -21,4 +21,3 @@ template_dirs = behat/actionwords, php, common
21
21
  filename = 'Actionwords.php'
22
22
  naming_convention = 'camel_case'
23
23
  call_prefix = '$this'
24
-
@@ -5,7 +5,7 @@ fallback_template = 'empty'
5
5
  [features]
6
6
  indentation = ' '
7
7
  node_name = folders
8
- template_dirs = gherkin, common
8
+ template_dirs = gherkin/inlined_uids, gherkin, common
9
9
  named_filename = '%s.feature'
10
10
  filename_convention = 'underscore'
11
11
 
@@ -5,7 +5,7 @@ fallback_template = 'empty'
5
5
 
6
6
  [features]
7
7
  node_name = folders
8
- template_dirs = gherkin/java, gherkin, common
8
+ template_dirs = gherkin/inlined_uids, gherkin/java, gherkin, common
9
9
  named_filename = '%s.feature'
10
10
  indentation = ' '
11
11
 
@@ -4,7 +4,7 @@ fallback_template = 'empty'
4
4
 
5
5
  [features]
6
6
  node_name = folders
7
- template_dirs = gherkin, common
7
+ template_dirs = gherkin/inlined_uids, gherkin, common
8
8
  named_filename = '%s.feature'
9
9
  indentation = ' '
10
10
 
@@ -17,8 +17,8 @@ module Hiptest
17
17
  end
18
18
 
19
19
  @indexed[aw_name] = {
20
- :actionword => aw,
21
- :parameters => indexed_parameters
20
+ actionword: aw,
21
+ parameters: indexed_parameters
22
22
  }
23
23
 
24
24
  end
@@ -153,9 +153,7 @@ module Hiptest
153
153
  private
154
154
 
155
155
  def output(lines, add_empty_line: true)
156
- lines = [lines] unless lines.is_a? Array
157
-
158
- puts lines.join("\n")
156
+ puts Array(lines).join("\n")
159
157
  puts "" if add_empty_line
160
158
  end
161
159
 
@@ -16,7 +16,7 @@ module Hiptest
16
16
  end
17
17
  end
18
18
  rescue => err
19
- reporter.dump_error(err)
19
+ @reporter.dump_error(err)
20
20
  end
21
21
 
22
22
  private
@@ -94,7 +94,7 @@ module Hiptest
94
94
  class Literal < Node
95
95
  def initialize(value)
96
96
  super()
97
- @children = {:value => value}
97
+ @children = {value: value}
98
98
  end
99
99
  end
100
100
 
@@ -117,91 +117,91 @@ module Hiptest
117
117
  class Variable < Node
118
118
  def initialize(name)
119
119
  super()
120
- @children = {:name => name}
120
+ @children = {name: name}
121
121
  end
122
122
  end
123
123
 
124
124
  class Symbol < Node
125
125
  def initialize(value, delimiter)
126
126
  super()
127
- @children = {:delimiter => delimiter, :value => value}
127
+ @children = {delimiter: delimiter, value: value}
128
128
  end
129
129
  end
130
130
 
131
131
  class Property < Node
132
132
  def initialize(key, value)
133
133
  super()
134
- @children = {:key => key, :value => value}
134
+ @children = {key: key, value: value}
135
135
  end
136
136
  end
137
137
 
138
138
  class Field < Node
139
139
  def initialize(base, name)
140
140
  super()
141
- @children = {:base => base, :name => name}
141
+ @children = {base: base, name: name}
142
142
  end
143
143
  end
144
144
 
145
145
  class Index < Node
146
146
  def initialize(base, expression)
147
147
  super()
148
- @children = {:base => base, :expression => expression}
148
+ @children = {base: base, expression: expression}
149
149
  end
150
150
  end
151
151
 
152
152
  class BinaryExpression < Node
153
153
  def initialize(left, operator, right)
154
154
  super()
155
- @children = {:operator => operator, :left => left, :right => right}
155
+ @children = {operator: operator, left: left, right: right}
156
156
  end
157
157
  end
158
158
 
159
159
  class UnaryExpression < Node
160
160
  def initialize(operator, expression)
161
161
  super()
162
- @children = {:operator => operator, :expression => expression}
162
+ @children = {operator: operator, expression: expression}
163
163
  end
164
164
  end
165
165
 
166
166
  class Parenthesis < Node
167
167
  def initialize(content)
168
168
  super()
169
- @children = {:content => content}
169
+ @children = {content: content}
170
170
  end
171
171
  end
172
172
 
173
173
  class List < Node
174
174
  def initialize(items)
175
175
  super()
176
- @children = {:items => items}
176
+ @children = {items: items}
177
177
  end
178
178
  end
179
179
 
180
180
  class Dict < Node
181
181
  def initialize(items)
182
182
  super()
183
- @children = {:items => items}
183
+ @children = {items: items}
184
184
  end
185
185
  end
186
186
 
187
187
  class Template < Node
188
188
  def initialize(chunks)
189
189
  super()
190
- @children = {:chunks => chunks}
190
+ @children = {chunks: chunks}
191
191
  end
192
192
  end
193
193
 
194
194
  class Assign < Node
195
195
  def initialize(to, value)
196
196
  super()
197
- @children = {:to => to, :value => value}
197
+ @children = {to: to, value: value}
198
198
  end
199
199
  end
200
200
 
201
201
  class Argument < Node
202
202
  def initialize(name, value)
203
203
  super()
204
- @children = {:name => name, :value => value}
204
+ @children = {name: name, value: value}
205
205
  end
206
206
 
207
207
  def free_text?
@@ -220,7 +220,7 @@ module Hiptest
220
220
  def initialize(actionword, arguments = [], annotation = nil)
221
221
  super()
222
222
  annotation = nil if annotation == ""
223
- @children = {:actionword => actionword, :arguments => arguments, :all_arguments => arguments, :annotation => annotation}
223
+ @children = {actionword: actionword, arguments: arguments, all_arguments: arguments, annotation: annotation}
224
224
 
225
225
  @chunks = []
226
226
  @extra_inlined_arguments = []
@@ -238,28 +238,28 @@ module Hiptest
238
238
  class IfThen < Node
239
239
  def initialize(condition, then_, else_ = [])
240
240
  super()
241
- @children = {:condition => condition, :then => then_, :else => else_}
241
+ @children = {condition: condition, then: then_, else: else_}
242
242
  end
243
243
  end
244
244
 
245
245
  class Step < Node
246
246
  def initialize(key, value)
247
247
  super()
248
- @children = {:key => key, :value => value}
248
+ @children = {key: key, value: value}
249
249
  end
250
250
  end
251
251
 
252
252
  class While < Node
253
253
  def initialize(condition, body)
254
254
  super()
255
- @children = {:condition => condition, :body => body}
255
+ @children = {condition: condition, body: body}
256
256
  end
257
257
  end
258
258
 
259
259
  class Tag < Node
260
260
  def initialize(key, value = nil)
261
261
  super()
262
- @children = {:key => key, :value => value}
262
+ @children = {key: key, value: value}
263
263
  end
264
264
 
265
265
  def to_s
@@ -270,7 +270,7 @@ module Hiptest
270
270
  class Parameter < Node
271
271
  def initialize(name, default = nil)
272
272
  super()
273
- @children = {:name => name, :default => default}
273
+ @children = {name: name, default: default}
274
274
  end
275
275
 
276
276
  def type
@@ -296,11 +296,11 @@ module Hiptest
296
296
  def initialize(name, tags = [], description = '', parameters = [], body = [])
297
297
  super()
298
298
  @children = {
299
- :name => name,
300
- :tags => tags,
301
- :description => description,
302
- :parameters => parameters,
303
- :body => body
299
+ name: name,
300
+ tags: tags,
301
+ description: description,
302
+ parameters: parameters,
303
+ body: body
304
304
  }
305
305
  end
306
306
 
@@ -366,10 +366,10 @@ module Hiptest
366
366
  super()
367
367
 
368
368
  @children = {
369
- :name => name,
370
- :description => description,
371
- :tags => tags,
372
- :body => body
369
+ name: name,
370
+ description: description,
371
+ tags: tags,
372
+ body: body
373
373
  }
374
374
  end
375
375
 
@@ -383,7 +383,7 @@ module Hiptest
383
383
  super()
384
384
 
385
385
  @children = {
386
- :datasets => datasets
386
+ datasets: datasets
387
387
  }
388
388
  end
389
389
  end
@@ -393,8 +393,8 @@ module Hiptest
393
393
  super()
394
394
 
395
395
  @children = {
396
- :name => name,
397
- :arguments => arguments
396
+ name: name,
397
+ arguments: arguments
398
398
  }
399
399
  end
400
400
 
@@ -407,7 +407,7 @@ module Hiptest
407
407
  attr_reader :to_implement, :no_implement
408
408
  def initialize(actionwords = [])
409
409
  super()
410
- @children = {:actionwords => actionwords}
410
+ @children = {actionwords: actionwords}
411
411
  mark_actionwords_for_implementation
412
412
  index_actionwords
413
413
  end
@@ -442,7 +442,7 @@ module Hiptest
442
442
  class Scenarios < Node
443
443
  def initialize(scenarios = [])
444
444
  super()
445
- @children = {:scenarios => scenarios}
445
+ @children = {scenarios: scenarios}
446
446
  scenarios.each {|sc| sc.parent = self}
447
447
  end
448
448
  end
@@ -450,7 +450,7 @@ module Hiptest
450
450
  class Tests < Node
451
451
  def initialize(tests = [])
452
452
  super()
453
- @children = {:tests => tests}
453
+ @children = {tests: tests}
454
454
  tests.each {|test| test.parent = self}
455
455
  end
456
456
  end
@@ -466,12 +466,12 @@ module Hiptest
466
466
  @order_in_parent = order_in_parent
467
467
 
468
468
  @children = {
469
- :name => name,
470
- :description => description,
471
- :subfolders => [],
472
- :scenarios => [],
473
- :tags => tags,
474
- :body => body
469
+ name: name,
470
+ description: description,
471
+ subfolders: [],
472
+ scenarios: [],
473
+ tags: tags,
474
+ body: body
475
475
  }
476
476
  end
477
477
 
@@ -501,8 +501,8 @@ module Hiptest
501
501
  super()
502
502
  @uids_mapping = {}
503
503
  @children = {
504
- :root_folder => nil,
505
- :folders => folders
504
+ root_folder: nil,
505
+ folders: folders
506
506
  }
507
507
  end
508
508
 
@@ -536,12 +536,12 @@ module Hiptest
536
536
  tests.parent = self
537
537
 
538
538
  @children = {
539
- :name => name,
540
- :description => description,
541
- :test_plan => test_plan,
542
- :scenarios => scenarios,
543
- :actionwords => actionwords,
544
- :tests => tests
539
+ name: name,
540
+ description: description,
541
+ test_plan: test_plan,
542
+ scenarios: scenarios,
543
+ actionwords: actionwords,
544
+ tests: tests
545
545
  }
546
546
  end
547
547
 
@@ -704,13 +704,13 @@ class LanguageConfigParser
704
704
  def make_language_group_config group_name
705
705
  # List of options that can be set in the config file but not in command line
706
706
  non_visible_options = {
707
- :package => @cli_options.package,
708
- :namespace => @cli_options.namespace,
709
- :test_export_dir => @cli_options.test_export_dir,
710
- :tests_ouput_dir => @cli_options.tests_ouput_dir,
711
- :features_output_directory => @cli_options.features_output_directory,
712
- :step_definitions_output_directory => @cli_options.step_definitions_output_directory,
713
- :actionwords_output_directory => @cli_options.actionwords_output_directory
707
+ package: @cli_options.package,
708
+ namespace: @cli_options.namespace,
709
+ test_export_dir: @cli_options.test_export_dir,
710
+ tests_ouput_dir: @cli_options.tests_ouput_dir,
711
+ features_output_directory: @cli_options.features_output_directory,
712
+ step_definitions_output_directory: @cli_options.step_definitions_output_directory,
713
+ actionwords_output_directory: @cli_options.actionwords_output_directory
714
714
  }
715
715
 
716
716
  language_group_params = group_config('_common')
@@ -2,14 +2,14 @@ module Hiptest
2
2
  module RenderContextMaker
3
3
  def walk_item(item)
4
4
  {
5
- :has_description? => !item.children[:description].nil? && !item.children[:description].empty?,
6
- :has_parameters? => !item.children[:parameters].empty?,
7
- :has_tags? => !item.children[:tags].empty?,
8
- :has_step? => has_step?(item),
9
- :is_empty? => item.children[:body].empty?,
10
- :declared_variables => item.declared_variables_names,
11
- :raw_parameter_names => item.children[:parameters].map {|p| p.children[:name] },
12
- :self_name => item.children[:name],
5
+ has_description?: !item.children[:description].nil? && !item.children[:description].empty?,
6
+ has_parameters?: !item.children[:parameters].empty?,
7
+ has_tags?: !item.children[:tags].empty?,
8
+ has_step?: has_step?(item),
9
+ is_empty?: item.children[:body].empty?,
10
+ declared_variables: item.declared_variables_names,
11
+ raw_parameter_names: item.children[:parameters].map {|p| p.children[:name] },
12
+ self_name: item.children[:name],
13
13
  }
14
14
  end
15
15
 
@@ -17,117 +17,117 @@ module Hiptest
17
17
  relative_package = @context.relative_path.split('/')[0...-1].join('.')
18
18
  relative_package = ".#{relative_package}" unless relative_package.empty?
19
19
  {
20
- :needs_to_import_actionwords? => @context.relative_path.count('/') > 0,
21
- :relative_package => relative_package,
20
+ needs_to_import_actionwords?: @context.relative_path.count('/') > 0,
21
+ relative_package: relative_package,
22
22
  }
23
23
  end
24
24
 
25
25
  def walk_actionword(aw)
26
26
  walk_item(aw).merge(
27
- :chunks => aw.chunks || [],
28
- :extra_inlined_parameters => aw.extra_inlined_parameters || []
27
+ chunks: aw.chunks || [],
28
+ extra_inlined_parameters: aw.extra_inlined_parameters || []
29
29
  )
30
30
  end
31
31
 
32
32
  def walk_folder(folder)
33
33
  walk_relative_item(folder).merge(
34
- :self_name => folder.children[:name],
35
- :has_tags? => !folder.children[:tags].empty?,
36
- :has_step? => has_step?(folder),
37
- :is_empty? => folder.children[:body].empty?,
38
- :datatables_present? => datatable_present?(folder)
34
+ self_name: folder.children[:name],
35
+ has_tags?: !folder.children[:tags].empty?,
36
+ has_step?: has_step?(folder),
37
+ is_empty?: folder.children[:body].empty?,
38
+ datatables_present?: datatable_present?(folder)
39
39
  )
40
40
  end
41
41
 
42
42
  def walk_scenario(scenario)
43
43
  walk_item(scenario).merge(walk_relative_item(scenario)).merge(
44
- :project_name => scenario.parent.parent.children[:name],
45
- :has_datasets? => has_datasets?(scenario),
46
- :has_annotations? => has_annotations?(scenario)
44
+ project_name: scenario.parent.parent.children[:name],
45
+ has_datasets?: has_datasets?(scenario),
46
+ has_annotations?: has_annotations?(scenario)
47
47
  )
48
48
  end
49
49
 
50
50
  def walk_dataset(dataset)
51
51
  datatable = dataset.parent
52
52
  {
53
- :scenario_name => datatable.parent.children[:name]
53
+ scenario_name: datatable.parent.children[:name]
54
54
  }
55
55
  end
56
56
 
57
57
  def walk_scenarios(scenarios)
58
58
  project = scenarios.parent
59
59
  {
60
- :project_name => project.children[:name],
61
- :self_name => project.children[:name],
62
- :datatables_present? => datatable_present?(scenarios)
60
+ project_name: project.children[:name],
61
+ self_name: project.children[:name],
62
+ datatables_present?: datatable_present?(scenarios)
63
63
  }
64
64
  end
65
65
 
66
66
  def walk_test(test)
67
67
  {
68
- :has_description? => !test.children[:description].nil? && !test.children[:description].empty?,
69
- :has_parameters? => false,
70
- :has_tags? => !test.children[:tags].empty?,
71
- :has_step? => has_step?(test),
72
- :is_empty? => test.children[:body].empty?,
73
- :has_datasets? => false,
74
- :project_name => test.parent.parent.children[:name],
75
- :self_name => test.children[:name],
68
+ has_description?: !test.children[:description].nil? && !test.children[:description].empty?,
69
+ has_parameters?: false,
70
+ has_tags?: !test.children[:tags].empty?,
71
+ has_step?: has_step?(test),
72
+ is_empty?: test.children[:body].empty?,
73
+ has_datasets?: false,
74
+ project_name: test.parent.parent.children[:name],
75
+ self_name: test.children[:name],
76
76
  }
77
77
  end
78
78
 
79
79
  def walk_tests(tests)
80
80
  project = tests.parent
81
81
  {
82
- :project_name => project.children[:name],
83
- :self_name => project.children[:name]
82
+ project_name: project.children[:name],
83
+ self_name: project.children[:name]
84
84
  }
85
85
  end
86
86
 
87
87
  def walk_call(c)
88
88
  {
89
- :has_arguments? => !c.children[:arguments].empty?,
90
- :has_annotation? => !c.children[:annotation].nil?,
91
- :in_actionword? => c.parent.is_a?(Hiptest::Nodes::Actionword),
92
- :in_datatabled_scenario? => c.parent.is_a?(Hiptest::Nodes::Scenario) && has_datasets?(c.parent),
93
- :chunks => c.chunks || [],
94
- :extra_inlined_arguments => c.extra_inlined_arguments || []
89
+ has_arguments?: !c.children[:arguments].empty?,
90
+ has_annotation?: !c.children[:annotation].nil?,
91
+ in_actionword?: c.parent.is_a?(Hiptest::Nodes::Actionword),
92
+ in_datatabled_scenario?: c.parent.is_a?(Hiptest::Nodes::Scenario) && has_datasets?(c.parent),
93
+ chunks: c.chunks || [],
94
+ extra_inlined_arguments: c.extra_inlined_arguments || []
95
95
  }
96
96
  end
97
97
 
98
98
  def walk_ifthen(it)
99
99
  {
100
- :has_else? => !it.children[:else].empty?
100
+ has_else?: !it.children[:else].empty?
101
101
  }
102
102
  end
103
103
 
104
104
  def walk_parameter(p)
105
105
  {
106
- :is_free_text? => p.free_text?,
107
- :is_datatable? => p.datatable?,
108
- :is_bool? => p.children[:type] == :bool,
109
- :has_default_value? => !p.children[:default].nil?
106
+ is_free_text?: p.free_text?,
107
+ is_datatable?: p.datatable?,
108
+ is_bool?: p.children[:type] == :bool,
109
+ has_default_value?: !p.children[:default].nil?
110
110
  }
111
111
  end
112
112
 
113
113
  def walk_tag(t)
114
114
  {
115
- :has_value? => !t.children[:value].nil?
115
+ has_value?: !t.children[:value].nil?
116
116
  }
117
117
  end
118
118
 
119
119
  def walk_template(t)
120
120
  treated = t.children[:chunks].map do |chunk|
121
121
  {
122
- :is_variable? => chunk.is_a?(Hiptest::Nodes::Variable),
123
- :raw => chunk
122
+ is_variable?: chunk.is_a?(Hiptest::Nodes::Variable),
123
+ raw: chunk
124
124
  }
125
125
  end
126
126
  variable_names = treated.map {|item| item[:raw].children[:name] if item[:is_variable?]}.compact
127
127
 
128
128
  {
129
- :treated_chunks => treated,
130
- :variable_names => variable_names
129
+ treated_chunks: treated,
130
+ variable_names: variable_names
131
131
  }
132
132
  end
133
133
 
@@ -1,6 +1,6 @@
1
1
  {{#if has_datasets?}}
2
2
  {{#if has_tags?}}{{join rendered_children.tags ' '}}
3
- {{/if}}Scenario Outline: {{{ rendered_children.name }}}{{#if context.uids}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}{{/if}}{{#indent}}
3
+ {{/if}}{{> scenario_outline_title}}{{#indent}}
4
4
  {{#if has_description?}}{{#comment '#'}}{{rendered_children.description}}{{/comment}}
5
5
  {{/if}}{{#each rendered_children.body}}{{{ this }}}
6
6
  {{/each}}
@@ -0,0 +1 @@
1
+ Scenario Outline: {{{ rendered_children.name }}}{{#if context.uids}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}{{/if}}
@@ -0,0 +1 @@
1
+ Scenario Outline: {{{ rendered_children.name }}}{{#if context.uids}} (<hiptest-uid>){{/if}}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiptest-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiptest R&D
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2017-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -336,11 +336,13 @@ files:
336
336
  - lib/templates/cucumber/parameter.hbs
337
337
  - lib/templates/gherkin/_gherkin_text.hbs
338
338
  - lib/templates/gherkin/_scenario.hbs
339
+ - lib/templates/gherkin/_scenario_outline_title.hbs
339
340
  - lib/templates/gherkin/argument.hbs
340
341
  - lib/templates/gherkin/call.hbs
341
342
  - lib/templates/gherkin/dataset.hbs
342
343
  - lib/templates/gherkin/datatable.hbs
343
344
  - lib/templates/gherkin/folder.hbs
345
+ - lib/templates/gherkin/inlined_uids/_scenario_outline_title.hbs
344
346
  - lib/templates/gherkin/java/single_scenario.hbs
345
347
  - lib/templates/gherkin/parameter.hbs
346
348
  - lib/templates/gherkin/scenarios.hbs
@@ -628,7 +630,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
628
630
  version: '0'
629
631
  requirements: []
630
632
  rubyforge_project:
631
- rubygems_version: 2.6.10
633
+ rubygems_version: 2.5.1
632
634
  signing_key:
633
635
  specification_version: 4
634
636
  summary: Export your tests from Hiptest into executable tests.