hiptest-publisher 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiptest-publisher.rb +6 -2
- data/lib/hiptest-publisher/cli_options_checker.rb +1 -1
- data/lib/hiptest-publisher/client.rb +14 -0
- data/lib/hiptest-publisher/gherkin_adder.rb +68 -13
- data/lib/hiptest-publisher/handlebars_helper.rb +31 -18
- data/lib/hiptest-publisher/nodes.rb +12 -0
- data/lib/hiptest-publisher/options_parser.rb +14 -0
- data/lib/hiptest-publisher/render_context_maker.rb +9 -2
- data/lib/templates/behat/actionword.hbs +1 -1
- data/lib/templates/behave/actionword.hbs +1 -1
- data/lib/templates/common/_gherkin_pattern.hbs +1 -0
- data/lib/templates/cucumber/actionword.hbs +1 -1
- data/lib/templates/cucumber/java/actionword.hbs +1 -1
- data/lib/templates/cucumber/javascript/actionword.hbs +1 -1
- data/lib/templates/gherkin/_gherkin_text.hbs +1 -0
- data/lib/templates/gherkin/call.hbs +1 -1
- data/lib/templates/groovy/_scenario.hbs +9 -7
- data/lib/templates/groovy/call.hbs +2 -2
- data/lib/templates/groovy/dataset.hbs +1 -5
- data/lib/templates/groovy/datatable.hbs +0 -1
- data/lib/templates/specflow/actionword.hbs +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f221c5fe7f059f527efc75a7eebe310cd806ecf
|
4
|
+
data.tar.gz: c1b06d4ac7d4eaa9ac56c34e497a2faee4e779f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e7d4bf2491d2ca08d2f934beec9ae6d28d8cf27807e74702fc40c93319f79251225abd66761708c7e0e9234701538191e3f59c32e36958b781d177268ee66b4
|
7
|
+
data.tar.gz: 60a549bd9b47a88ee8d29e374db846537d8517b920d1c111791cc360b61a9e717802f8007ea823b3ca9dd50153d68077552cb729f6afa996de1d8b466d4625e8
|
data/lib/hiptest-publisher.rb
CHANGED
@@ -330,10 +330,14 @@ module Hiptest
|
|
330
330
|
reporter.with_status_message "Posting #{@cli_options.push} to #{@cli_options.site}" do
|
331
331
|
response = @client.push_results
|
332
332
|
end
|
333
|
-
|
333
|
+
json = JSON.parse(response.body)
|
334
|
+
|
335
|
+
reported_tests = json.has_key?('test_import') ? json['test_import'] : []
|
336
|
+
passed_count = reported_tests.size
|
337
|
+
|
334
338
|
reporter.with_status_message "#{pluralize(passed_count, "test")} imported" do
|
335
339
|
if @cli_options.verbose
|
336
|
-
|
340
|
+
reported_tests.each do |imported_test|
|
337
341
|
puts " Test '#{imported_test['name']}' imported"
|
338
342
|
end
|
339
343
|
end
|
@@ -27,6 +27,10 @@ module Hiptest
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
def global_failure_url
|
31
|
+
"#{cli_options.site}/report_global_failure/#{cli_options.token}/#{cli_options.test_run_id}/"
|
32
|
+
end
|
33
|
+
|
30
34
|
def project_export_filters
|
31
35
|
mapping = {
|
32
36
|
filter_on_scenario_ids: 'filter_scenario_ids',
|
@@ -90,6 +94,10 @@ module Hiptest
|
|
90
94
|
uploaded["file-#{filename.normalize}"] = UploadIO.new(File.new(filename), "text", filename)
|
91
95
|
end
|
92
96
|
|
97
|
+
if cli_options.global_failure_on_missing_reports && uploaded.empty?
|
98
|
+
return send_post_request(global_failure_url)
|
99
|
+
end
|
100
|
+
|
93
101
|
uri = URI.parse(url)
|
94
102
|
send_request(Net::HTTP::Post::Multipart.new(uri, uploaded))
|
95
103
|
end
|
@@ -151,6 +159,12 @@ module Hiptest
|
|
151
159
|
response
|
152
160
|
end
|
153
161
|
|
162
|
+
def send_post_request(url)
|
163
|
+
uri = URI.parse(url)
|
164
|
+
response = send_request(Net::HTTP::Post.new(uri))
|
165
|
+
response
|
166
|
+
end
|
167
|
+
|
154
168
|
def send_request(request)
|
155
169
|
request["User-Agent"] = "Ruby/hiptest-publisher"
|
156
170
|
use_ssl = request.uri.scheme == "https"
|
@@ -19,9 +19,13 @@ module Hiptest
|
|
19
19
|
@project.each_sub_nodes(Hiptest::Nodes::Scenario, Hiptest::Nodes::Actionword, Hiptest::Nodes::Test, Hiptest::Nodes::Folder) do |item|
|
20
20
|
@last_annotation = nil
|
21
21
|
item.each_sub_nodes(Hiptest::Nodes::Call) do |call|
|
22
|
+
set_call_chunks(call)
|
22
23
|
call.children[:gherkin_text] ||= "#{text_annotation(call)} #{prettified(call)}"
|
24
|
+
|
23
25
|
if actionword = get_actionword(call)
|
24
26
|
@annotations_counter.increment(actionword, code_annotation(call))
|
27
|
+
set_actionwords_chunks(actionword)
|
28
|
+
|
25
29
|
actionword.children[:gherkin_pattern] ||= pattern(actionword)
|
26
30
|
actionword.children[:parameters_ordered_by_pattern] ||= order_parameters_by_pattern(actionword)
|
27
31
|
end
|
@@ -53,50 +57,101 @@ module Hiptest
|
|
53
57
|
end
|
54
58
|
|
55
59
|
def prettified(call)
|
60
|
+
base = call.chunks.map {|chunk| chunk[:value]}.join("\"").strip
|
61
|
+
call.extra_inlined_arguments.each do |chunk|
|
62
|
+
base += " \"#{chunk[:value]}\""
|
63
|
+
end
|
64
|
+
|
65
|
+
base
|
66
|
+
end
|
67
|
+
|
68
|
+
def set_call_chunks(call)
|
56
69
|
all_arguments = all_valued_arguments_for(call)
|
57
70
|
inline_parameter_names = []
|
71
|
+
extra_inlined_arguments = []
|
72
|
+
|
73
|
+
call.chunks = []
|
74
|
+
call.extra_inlined_arguments = []
|
58
75
|
|
59
76
|
call_chunks = call.children[:actionword].split("\"", -1)
|
60
77
|
call_chunks.each_slice(2) do |text, inline_parameter_name|
|
78
|
+
call.chunks << {
|
79
|
+
value: text,
|
80
|
+
is_argument: false
|
81
|
+
}
|
82
|
+
|
61
83
|
if all_arguments.has_key?(inline_parameter_name)
|
62
84
|
inline_parameter_names << inline_parameter_name.clone
|
63
85
|
value = all_arguments[inline_parameter_name]
|
64
86
|
inline_parameter_name.replace(value)
|
87
|
+
|
88
|
+
call.chunks << {
|
89
|
+
value: inline_parameter_name,
|
90
|
+
is_argument: true
|
91
|
+
}
|
92
|
+
else
|
93
|
+
call.chunks << {
|
94
|
+
value: inline_parameter_name,
|
95
|
+
is_argument: false
|
96
|
+
} unless inline_parameter_name.nil?
|
65
97
|
end
|
66
98
|
end
|
67
99
|
|
68
|
-
missing_parameter_names = all_arguments.keys - inline_parameter_names - @special_params
|
69
100
|
|
70
|
-
|
71
|
-
missing_parameter_names.
|
72
|
-
|
73
|
-
|
101
|
+
missing_parameter_names = all_arguments.keys - inline_parameter_names - @special_params
|
102
|
+
call.extra_inlined_arguments = missing_parameter_names.map do |missing_parameter_name|
|
103
|
+
{
|
104
|
+
value: all_arguments[missing_parameter_name],
|
105
|
+
is_argument: true
|
106
|
+
}
|
74
107
|
end
|
75
|
-
prettified.strip
|
76
108
|
end
|
77
109
|
|
78
110
|
def pattern(actionword)
|
111
|
+
patterned = actionword.chunks.map {|chunk| chunk[:value]}.join("\"")
|
112
|
+
actionword.extra_inlined_parameters.each do |param|
|
113
|
+
patterned += " \"#{param[:value]}\""
|
114
|
+
end
|
115
|
+
|
116
|
+
"^#{patterned.strip}$"
|
117
|
+
end
|
118
|
+
|
119
|
+
def set_actionwords_chunks(actionword)
|
79
120
|
name = actionword.children[:name]
|
80
121
|
actionword_parameters = evaluated_map(actionword.children[:parameters])
|
81
122
|
name_chunks = name.split("\"", -1)
|
82
|
-
result = []
|
83
123
|
inline_parameter_names = []
|
124
|
+
|
125
|
+
actionword.chunks = []
|
126
|
+
actionword.extra_inlined_parameters = []
|
127
|
+
|
84
128
|
name_chunks.each_slice(2) do |text, inline_parameter_name|
|
85
|
-
|
129
|
+
actionword.chunks << {
|
130
|
+
value: text.gsub(/[.|()\\.+*?\[\]{}^$]/) { |c| "\\#{c}" },
|
131
|
+
is_parameter: false
|
132
|
+
}
|
133
|
+
|
86
134
|
inline_parameter_names << inline_parameter_name if inline_parameter_name
|
87
135
|
if actionword_parameters.has_key?(inline_parameter_name)
|
88
|
-
|
136
|
+
actionword.chunks << {
|
137
|
+
value: "(.*)",
|
138
|
+
is_parameter: true
|
139
|
+
}
|
89
140
|
else
|
90
|
-
|
141
|
+
actionword.chunks << {
|
142
|
+
value: inline_parameter_name,
|
143
|
+
is_parameter: false
|
144
|
+
} if inline_parameter_name
|
91
145
|
end
|
92
146
|
end
|
93
147
|
missing_parameter_names = actionword_parameters.keys - inline_parameter_names - @special_params
|
94
148
|
|
95
|
-
patterned = result.join("\"")
|
96
149
|
missing_parameter_names.each do |missing_parameter_name|
|
97
|
-
|
150
|
+
actionword.extra_inlined_parameters << {
|
151
|
+
value: "(.*)",
|
152
|
+
is_parameter: true
|
153
|
+
}
|
98
154
|
end
|
99
|
-
"^#{patterned.strip}$"
|
100
155
|
end
|
101
156
|
|
102
157
|
def order_parameters_by_pattern(actionword)
|
@@ -24,11 +24,17 @@ module Hiptest
|
|
24
24
|
:camelize_lower,
|
25
25
|
:camelize_upper,
|
26
26
|
:clear_extension,
|
27
|
-
:downcase
|
27
|
+
:downcase,
|
28
|
+
:strip
|
28
29
|
]
|
29
30
|
|
30
31
|
string_helpers.each do |helper|
|
31
|
-
@handlebars.register_helper(helper) do |context,
|
32
|
+
@handlebars.register_helper(helper) do |context, block|
|
33
|
+
if block.is_a? Handlebars::Tree::Block
|
34
|
+
value = block.fn(context)
|
35
|
+
else
|
36
|
+
value = block
|
37
|
+
end
|
32
38
|
"#{value.to_s.send(helper)}"
|
33
39
|
end
|
34
40
|
end
|
@@ -43,7 +49,12 @@ module Hiptest
|
|
43
49
|
end
|
44
50
|
end
|
45
51
|
|
46
|
-
def
|
52
|
+
def compute_block_value(context, value, block)
|
53
|
+
value.is_a?(Handlebars::Tree::Block) ? value.fn(context) : value
|
54
|
+
end
|
55
|
+
|
56
|
+
def hh_to_string(context, value, block=nil)
|
57
|
+
value = compute_block_value(context, value, block)
|
47
58
|
"#{value.to_s}"
|
48
59
|
end
|
49
60
|
|
@@ -131,33 +142,39 @@ module Hiptest
|
|
131
142
|
end
|
132
143
|
|
133
144
|
# kept for backward compatibility of customized templates
|
134
|
-
def hh_remove_quotes (context, s, block)
|
145
|
+
def hh_remove_quotes (context, s, block = nil)
|
135
146
|
hh_remove_double_quotes(context, s, block)
|
136
147
|
end
|
137
148
|
|
138
|
-
def hh_remove_double_quotes (context, s, block)
|
149
|
+
def hh_remove_double_quotes (context, s, block = nil)
|
150
|
+
s = compute_block_value(context,s, block)
|
139
151
|
s ? s.gsub('"', '') : ""
|
140
152
|
end
|
141
153
|
|
142
|
-
def hh_remove_single_quotes (context, s, block)
|
154
|
+
def hh_remove_single_quotes (context, s, block = nil)
|
155
|
+
s = compute_block_value(context,s, block)
|
143
156
|
s ? s.gsub('\'', '') : ""
|
144
157
|
end
|
145
158
|
|
146
159
|
# kept for backward compatibility of customized templates
|
147
|
-
def hh_escape_quotes (context, s, block)
|
160
|
+
def hh_escape_quotes (context, s, block=nil)
|
148
161
|
hh_escape_double_quotes(context, s, block)
|
149
162
|
end
|
150
163
|
|
151
|
-
def hh_escape_double_quotes (context, s, block)
|
164
|
+
def hh_escape_double_quotes (context, s, block=nil)
|
165
|
+
s = compute_block_value(context, s, block)
|
152
166
|
s ? s.gsub('"', '\\"') : ""
|
153
167
|
end
|
154
168
|
|
155
|
-
def hh_escape_single_quotes (context, s, block)
|
169
|
+
def hh_escape_single_quotes (context, s, block=nil)
|
156
170
|
# weird \\\\, see http://stackoverflow.com/questions/7074337/why-does-stringgsub-double-content
|
171
|
+
s = compute_block_value(context, s, block)
|
157
172
|
s ? s.gsub('\'', "\\\\'") : ""
|
158
173
|
end
|
159
174
|
|
160
|
-
def hh_escape_backslashes_and_double_quotes (context, s, block)
|
175
|
+
def hh_escape_backslashes_and_double_quotes (context, s, block=nil)
|
176
|
+
s = compute_block_value(context, s, block)
|
177
|
+
|
161
178
|
if s
|
162
179
|
s.gsub('\\') { |c| c*2 }.
|
163
180
|
gsub('"', '\\"')
|
@@ -167,17 +184,12 @@ module Hiptest
|
|
167
184
|
end
|
168
185
|
|
169
186
|
def hh_escape_new_line(context, s, block = nil)
|
170
|
-
|
171
|
-
s = s.fn(context)
|
172
|
-
end
|
173
|
-
|
187
|
+
s = compute_block_value(context, s, block)
|
174
188
|
s ? s.gsub("\n", '\\n') : ""
|
175
189
|
end
|
176
190
|
|
177
191
|
def hh_remove_surrounding_quotes(context, s, block = nil)
|
178
|
-
|
179
|
-
s = s.fn(context)
|
180
|
-
end
|
192
|
+
s = compute_block_value(context, s, block)
|
181
193
|
|
182
194
|
if s.nil?
|
183
195
|
""
|
@@ -227,7 +239,8 @@ module Hiptest
|
|
227
239
|
name
|
228
240
|
end
|
229
241
|
|
230
|
-
def hh_strip_regexp_delimiters(context, regexp, block)
|
242
|
+
def hh_strip_regexp_delimiters(context, regexp, block=nil)
|
243
|
+
regexp = compute_block_value(context, regexp, block)
|
231
244
|
return regexp.gsub(/(^\^)|(\$$)/, '')
|
232
245
|
end
|
233
246
|
|
@@ -214,10 +214,16 @@ module Hiptest
|
|
214
214
|
end
|
215
215
|
|
216
216
|
class Call < Node
|
217
|
+
attr_reader :chunks, :extra_inlined_arguments
|
218
|
+
attr_writer :chunks, :extra_inlined_arguments
|
219
|
+
|
217
220
|
def initialize(actionword, arguments = [], annotation = nil)
|
218
221
|
super()
|
219
222
|
annotation = nil if annotation == ""
|
220
223
|
@children = {:actionword => actionword, :arguments => arguments, :all_arguments => arguments, :annotation => annotation}
|
224
|
+
|
225
|
+
@chunks = []
|
226
|
+
@extra_inlined_arguments = []
|
221
227
|
end
|
222
228
|
|
223
229
|
def free_text_arg
|
@@ -319,9 +325,15 @@ module Hiptest
|
|
319
325
|
end
|
320
326
|
|
321
327
|
class Actionword < Item
|
328
|
+
attr_reader :chunks, :extra_inlined_parameters
|
329
|
+
attr_writer :chunks, :extra_inlined_parameters
|
330
|
+
|
322
331
|
def initialize(name, tags = [], parameters = [], body = [], uid = nil, description = '')
|
323
332
|
super(name, tags, description, parameters, body)
|
324
333
|
@children[:uid] = uid
|
334
|
+
|
335
|
+
@chunks = []
|
336
|
+
@extra_inlined_parameters = []
|
325
337
|
end
|
326
338
|
|
327
339
|
def must_be_implemented?
|
@@ -2,6 +2,7 @@ require 'optparse'
|
|
2
2
|
require 'parseconfig'
|
3
3
|
require 'ostruct'
|
4
4
|
require 'digest/md5'
|
5
|
+
require 'pathname'
|
5
6
|
|
6
7
|
require 'hiptest-publisher/formatters/console_formatter'
|
7
8
|
require 'hiptest-publisher/utils'
|
@@ -24,6 +25,9 @@ class FileConfigParser
|
|
24
25
|
else
|
25
26
|
options[param] = value
|
26
27
|
end
|
28
|
+
if %w(overriden_templates output_directory).include?(param)
|
29
|
+
update_path!(param, config, options)
|
30
|
+
end
|
27
31
|
options.__config_args << param.to_sym if options.__config_args
|
28
32
|
end
|
29
33
|
rescue => err
|
@@ -33,6 +37,15 @@ class FileConfigParser
|
|
33
37
|
def self.falsy?(value)
|
34
38
|
FALSY_VALUE_PATTERN.match(value)
|
35
39
|
end
|
40
|
+
|
41
|
+
def self.update_path!(param, config, options)
|
42
|
+
path = Pathname.new(config[param])
|
43
|
+
return unless path.relative?
|
44
|
+
config_path = Pathname.new(options.config)
|
45
|
+
config_absolute_path = config_path.relative? ? Pathname.pwd + config_path : config_path
|
46
|
+
resolved_path = config_absolute_path.cleanpath.dirname + path
|
47
|
+
options[param] = resolved_path.cleanpath.to_path
|
48
|
+
end
|
36
49
|
end
|
37
50
|
|
38
51
|
class Option
|
@@ -215,6 +228,7 @@ class OptionsParser
|
|
215
228
|
Option.new(nil, 'leafless-export', false, nil, "Use only last level action word", :leafless_export),
|
216
229
|
Option.new('s', 'site=SITE', 'https://hiptest.net', String, "Site to fetch from", :site),
|
217
230
|
Option.new('p', 'push=FILE.TAP', '', String, "Push a results file to the server", :push),
|
231
|
+
Option.new(nil, 'global-failure-on-missing-reports', false, nil, "When there is no results file to push, report a global failure", :global_failure_on_missing_reports),
|
218
232
|
Option.new(nil, 'push-format=tap', 'tap', String, "Format of the test results (junit, nunit, tap, robot)", :push_format),
|
219
233
|
Option.new(nil, 'sort=[id,order,alpha]', 'order', String, "Sorting of tests in output: id will sort them by age, order will keep the same order than in hiptest (only with --with-folders option, will fallback to id otherwise), alpha will sort them by name", :sort),
|
220
234
|
Option.new(nil, '[no-]uids', true, nil, 'Export UIDs (note: can be disabled only for Gherkin-based exports, may cause issue when pushing results back)', :uids),
|
@@ -22,7 +22,12 @@ module Hiptest
|
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
def walk_actionword(aw)
|
26
|
+
walk_item(aw).merge(
|
27
|
+
:chunks => aw.chunks || [],
|
28
|
+
:extra_inlined_parameters => aw.extra_inlined_parameters || []
|
29
|
+
)
|
30
|
+
end
|
26
31
|
|
27
32
|
def walk_folder(folder)
|
28
33
|
walk_relative_item(folder).merge(
|
@@ -85,7 +90,9 @@ module Hiptest
|
|
85
90
|
:has_annotation? => !c.children[:annotation].nil?,
|
86
91
|
:use_main_annotation? => !(c.children[:annotation].nil? || ['and', 'but'].include?(c.children[:annotation])),
|
87
92
|
:in_actionword? => c.parent.is_a?(Hiptest::Nodes::Actionword),
|
88
|
-
:in_datatabled_scenario? => c.parent.is_a?(Hiptest::Nodes::Scenario) && has_datasets?(c.parent)
|
93
|
+
:in_datatabled_scenario? => c.parent.is_a?(Hiptest::Nodes::Scenario) && has_datasets?(c.parent),
|
94
|
+
:chunks => c.chunks || [],
|
95
|
+
:extra_inlined_arguments => c.extra_inlined_arguments || []
|
89
96
|
}
|
90
97
|
end
|
91
98
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation }}
|
2
2
|
/**
|
3
|
-
* @{{{ rendered_children.gherkin_annotation }}} /{{
|
3
|
+
* @{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/
|
4
4
|
*/
|
5
5
|
public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}){{#curly}}{{#indent}}
|
6
6
|
$this->actionwords->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}${{{underscore this}}}{{/join}}{{/if}});
|
@@ -1,4 +1,4 @@
|
|
1
1
|
{{#if rendered_children.gherkin_used_annotations}}
|
2
|
-
{{#each rendered_children.gherkin_used_annotations}}@{{{downcase this }}}(r'{{#remove_last_character ':'}}{{{
|
2
|
+
{{#each rendered_children.gherkin_used_annotations}}@{{{downcase this }}}(r'{{#remove_last_character ':'}}{{#strip_regexp_delimiters}}{{> gherkin_pattern}}{{/strip_regexp_delimiters}}{{/remove_last_character}}')
|
3
3
|
{{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}):{{#indent}}
|
4
4
|
context.actionwords.{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{#replace "__datatable" "context.table"}}{{#replace "__free_text" "context.text"}}{{{underscore this}}}{{/replace}}{{/replace}}{{/join}}{{/if}}){{/indent}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
^{{#strip}}{{#join chunks '"'}}{{this.value}}{{/join}}{{#each extra_inlined_parameters}} "{{this.value}}"{{/each}}{{/strip}}$
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation }}
|
2
|
-
{{{ rendered_children.gherkin_annotation }}} /{{
|
2
|
+
{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/ do{{#if has_parameters?}} |{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}|{{/if}}
|
3
3
|
{{#indent}}{{ underscore rendered_children.name }}{{#if has_parameters?}}({{{ join rendered_children.parameters ', '}}}){{/if}}{{/indent}}
|
4
4
|
end
|
5
5
|
{{/if}}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
{{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{{
|
1
|
+
{{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{#escape_backslashes_and_double_quotes}}{{> gherkin_pattern}}{{/escape_backslashes_and_double_quotes}}")
|
2
2
|
public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.parameters_ordered_by_pattern ', '}}}) {{#curly}}{{#indent}}
|
3
3
|
{{{ context.call_prefix }}}.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation }}
|
2
|
-
this.{{{ rendered_children.gherkin_annotation }}}(/{{
|
2
|
+
this.{{{ rendered_children.gherkin_annotation }}}(/{{> gherkin_pattern}}/, function ({{#if rendered_children.parameters}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}, {{/if}}callback) {{#curly}}{{#indent}}
|
3
3
|
this.actionwords.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{underscore this}}}{{/join}}{{/if}});
|
4
4
|
callback();
|
5
5
|
{{/indent}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#if rendered_children.annotation}}{{{capitalize rendered_children.annotation }}}{{else}}*{{/if}} {{#strip}}{{#join chunks '"'}}{{this.value}}{{/join}}{{#each extra_inlined_parameters}} "{{this.value}}"{{/each}}{{/strip}}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
{{
|
1
|
+
{{> gherkin_text}}{{#if rendered_children.free_text_arg}}{{#indent}}
|
2
2
|
"""
|
3
3
|
{{remove_surrounding_quotes rendered_children.free_text_arg }}
|
4
4
|
"""{{/indent}}{{/if}}{{#if rendered_children.datatable_arg}}{{#indent}}
|
@@ -1,8 +1,10 @@
|
|
1
|
-
{{#if has_datasets?}}
|
2
|
-
{{
|
3
|
-
{{/curly}}
|
4
|
-
|
5
|
-
{{rendered_children.datatable}}{{else}}def "{{{ escape_double_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{ rendered_children.uid}}}){{/if}}"() {{#curly}}{{#indent}}{{> desc}}{{#unless has_annotations?}}{{#unless is_empty?}}
|
1
|
+
{{#if has_datasets?}}
|
2
|
+
@Unroll("{{{ escape_double_quotes rendered_children.name }}} #hiptestUid")
|
3
|
+
{{/if}}def "{{{ escape_double_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{ rendered_children.uid}}}){{/if}}"() {{#curly}}{{#indent}}{{> desc}}{{#unless has_annotations?}}{{#unless is_empty?}}
|
6
4
|
expect:{{/unless}}{{/unless}}
|
7
|
-
{{> steps}}{{
|
8
|
-
|
5
|
+
{{> steps}}{{#if has_datasets?}}
|
6
|
+
where:
|
7
|
+
{{ join rendered_children.parameters ' | ' }}{{#if context.uids}} | hiptestUid{{/if}}
|
8
|
+
{{rendered_children.datatable}}
|
9
|
+
{{/if}}{{/indent}}
|
10
|
+
{{/curly}}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
{{#unless in_actionword?}}{{#
|
2
|
-
{{/if}}{{/unless}}{{
|
1
|
+
{{#unless in_actionword?}}{{#if use_main_annotation?}}{{rendered_children.annotation}}:
|
2
|
+
{{/if}}{{/unless}}{{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{{ camelize_lower rendered_children.actionword }}}({{{ join rendered_children.all_arguments ', '}}})
|
@@ -1,5 +1 @@
|
|
1
|
-
|
2
|
-
expect:
|
3
|
-
{{{ camelize_lower scenario_name }}}({{{ join rendered_children.arguments ', '}}})
|
4
|
-
{{/indent}}
|
5
|
-
{{/curly}}
|
1
|
+
{{{ join rendered_children.arguments ' | ' }}}{{#if context.uids}} | "uid:{{{rendered_children.uid}}}"{{/if}}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
{{#if rendered_children.gherkin_annotation }}[Given("{{{
|
1
|
+
{{#if rendered_children.gherkin_annotation }}[Given("{{#escape_double_quotes}}{{> gherkin_pattern}}{{/escape_double_quotes}}"), When("{{#escape_double_quotes}}{{> gherkin_pattern}}{{/escape_double_quotes}}"), Then("{{#escape_double_quotes}}{{> gherkin_pattern}}{{/escape_double_quotes}}")]
|
2
2
|
public void {{{ camelize_upper rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}) {{#curly}}{{#indent}}
|
3
3
|
{{{ context.call_prefix }}}.{{ camelize_upper rendered_children.name }}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
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.
|
4
|
+
version: 1.7.0
|
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-
|
11
|
+
date: 2017-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -276,6 +276,7 @@ files:
|
|
276
276
|
- lib/templates/behat/parameter.hbs
|
277
277
|
- lib/templates/behave/actionword.hbs
|
278
278
|
- lib/templates/behave/actionwords.hbs
|
279
|
+
- lib/templates/common/_gherkin_pattern.hbs
|
279
280
|
- lib/templates/common/booleanliteral.hbs
|
280
281
|
- lib/templates/common/dataset.hbs
|
281
282
|
- lib/templates/common/datatable.hbs
|
@@ -329,6 +330,7 @@ files:
|
|
329
330
|
- lib/templates/cucumber/javascript/actionword.hbs
|
330
331
|
- lib/templates/cucumber/javascript/actionwords.hbs
|
331
332
|
- lib/templates/cucumber/parameter.hbs
|
333
|
+
- lib/templates/gherkin/_gherkin_text.hbs
|
332
334
|
- lib/templates/gherkin/_scenario.hbs
|
333
335
|
- lib/templates/gherkin/argument.hbs
|
334
336
|
- lib/templates/gherkin/call.hbs
|
@@ -622,7 +624,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
622
624
|
version: '0'
|
623
625
|
requirements: []
|
624
626
|
rubyforge_project:
|
625
|
-
rubygems_version: 2.
|
627
|
+
rubygems_version: 2.6.10
|
626
628
|
signing_key:
|
627
629
|
specification_version: 4
|
628
630
|
summary: Export your tests from Hiptest into executable tests.
|