hiptest-publisher 2.4.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +325 -0
- data/LICENSE +1 -2
- data/README.md +41 -23
- data/bin/hiptest-publisher +13 -17
- data/config/locales/en.yml +21 -17
- data/lib/config/cucumber-typescript.conf +41 -41
- data/lib/config/cucumber_legacy-groovy.conf +40 -0
- data/lib/config/cucumber_legacy-java.conf +24 -0
- data/lib/config/{cucumber_expressions-typescript.conf → cucumber_legacy-typescript.conf} +41 -41
- data/lib/hiptest-publisher/cli_options_checker.rb +7 -0
- data/lib/hiptest-publisher/client.rb +15 -4
- data/lib/hiptest-publisher/formatters/console_formatter.rb +1 -0
- data/lib/hiptest-publisher/handlebars_helper.rb +1 -1
- data/lib/hiptest-publisher/options_parser.rb +24 -5
- data/lib/hiptest-publisher/renderer.rb +5 -1
- data/lib/templates/cucumber/groovy/step-definitions/actionword.hbs +1 -1
- data/lib/templates/cucumber/groovy/step-definitions/actionwords.hbs +3 -2
- data/lib/templates/cucumber/groovy/step-definitions/library.hbs +3 -2
- data/lib/templates/cucumber/groovy/step-definitions/libraryactionword.hbs +1 -1
- data/lib/templates/cucumber/java/actionword.hbs +1 -1
- data/lib/templates/cucumber/java/actionwords.hbs +2 -2
- data/lib/templates/cucumber/typescript/actionword.hbs +1 -1
- data/lib/templates/cucumber/typescript/libraryactionword.hbs +1 -1
- data/lib/templates/cucumber_legacy/groovy/step-definitions/actionword.hbs +5 -0
- data/lib/templates/cucumber_legacy/groovy/step-definitions/actionwords.hbs +10 -0
- data/lib/templates/cucumber_legacy/groovy/step-definitions/library.hbs +10 -0
- data/lib/templates/cucumber_legacy/groovy/step-definitions/libraryactionword.hbs +5 -0
- data/lib/templates/cucumber_legacy/java/actionword.hbs +6 -0
- data/lib/templates/cucumber_legacy/java/actionwords.hbs +12 -0
- data/lib/templates/cucumber_legacy/typescript/actionword.hbs +5 -0
- data/lib/templates/{cucumber_expressions → cucumber_legacy}/typescript/libraryactionword.hbs +1 -1
- data/lib/templates/gherkin/scenarios.hbs +1 -1
- metadata +87 -64
- data/lib/templates/cucumber_expressions/typescript/actionword.hbs +0 -5
data/config/locales/en.yml
CHANGED
@@ -57,6 +57,7 @@ en:
|
|
57
57
|
Unable to build:
|
58
58
|
%{node}
|
59
59
|
title: Extracting data
|
60
|
+
caching_data: Caching data
|
60
61
|
check_version:
|
61
62
|
error: Unable to connect to Rubygem
|
62
63
|
outdated: |
|
@@ -66,7 +67,7 @@ en:
|
|
66
67
|
up_to_date: Your current install of hiptest-publisher (%{current}) is up-to-date.
|
67
68
|
default: default
|
68
69
|
errors:
|
69
|
-
api_error:
|
70
|
+
api_error: CucumberStudio API returned error %{code}
|
70
71
|
cli_options:
|
71
72
|
actionwords_signature_directory: 'Bad Action Words signature file: the file "%{path}" is a directory'
|
72
73
|
filter_status_without_test_run: |
|
@@ -86,7 +87,7 @@ en:
|
|
86
87
|
|
87
88
|
Found: %{incorrect_value}
|
88
89
|
invalid_tag_value_list: |
|
89
|
-
%{option} should be a list of comma separated tags
|
90
|
+
%{option} should be a list of comma separated tags from CucumberStudio
|
90
91
|
|
91
92
|
Found: %{incorrect_value}
|
92
93
|
invalid_test_run_id: 'Invalid format --test-run-id="%{test_run_id}": the test run id must be numeric'
|
@@ -100,11 +101,12 @@ en:
|
|
100
101
|
missing_token: |
|
101
102
|
Missing argument --token: you must specify project secret token with --token=<project-token>
|
102
103
|
|
103
|
-
The project secret token can be found on
|
104
|
+
The project secret token can be found on CucumberStudio in the settings section, under
|
104
105
|
'Test code generation'. It is a sequence of numbers uniquely identifying your
|
105
106
|
project.
|
106
107
|
|
107
108
|
Note that settings section is available only to administrators of the project.
|
109
|
+
multiple_build_options: 'Error with --push: you can not specify both --build-id and --build-name options'
|
108
110
|
multiple_filters: |
|
109
111
|
You specified multiple filters for the export.
|
110
112
|
|
@@ -128,12 +130,9 @@ en:
|
|
128
130
|
no_test_runs: 'No matching test run found: this project does not have any test runs.'
|
129
131
|
project_not_found: No project found with this secret token.
|
130
132
|
template_not_found: no template with name %{template_name} in dirs %{dirs}
|
131
|
-
test_run_list_unavailable: Cannot get the list of available test runs from
|
133
|
+
test_run_list_unavailable: Cannot get the list of available test runs from CucumberStudio. Try using --test-run-id instead of --test-run-name
|
132
134
|
exporting_file: Exporting %{name}
|
133
|
-
fetching_data: Fetching data from
|
134
|
-
using_cached_data: Using cached data from previous export
|
135
|
-
caching_data: Caching data
|
136
|
-
using_cache: "Using cache: %{full_path}"
|
135
|
+
fetching_data: Fetching data from CucumberStudio
|
137
136
|
help:
|
138
137
|
categories:
|
139
138
|
title: For language %{language}, available file groups are
|
@@ -148,7 +147,7 @@ en:
|
|
148
147
|
hiptest-publisher --language=%{language} --only=%{first},%{second}
|
149
148
|
description: |2
|
150
149
|
|
151
|
-
Exports tests from
|
150
|
+
Exports tests from CucumberStudio for automation.
|
152
151
|
|
153
152
|
Specific options:
|
154
153
|
header: 'Usage: hiptest-publisher [options]'
|
@@ -167,6 +166,10 @@ en:
|
|
167
166
|
aw_deleted: Output signature of deleted action words
|
168
167
|
aw_renamed: Output signatures of renamed action words
|
169
168
|
aw_signature_changed: Output signatures of action words for which signature changed
|
169
|
+
build_id: ID of an existing build the results will be added to
|
170
|
+
build_name: Name for the build that will be created in CucumberStudio (build names are not unique)
|
171
|
+
cache_dir: Path to the directory to store cache of CucumberStudio data
|
172
|
+
cache_duration: Validity of the CucumberStudio data cache in seconds
|
170
173
|
check_version: Check if a new release of hiptest-publisher is available
|
171
174
|
color: Force [un]use of ANSI color in text output
|
172
175
|
config: Configuration file
|
@@ -183,9 +186,10 @@ en:
|
|
183
186
|
framework: Test framework to use
|
184
187
|
global_failure_on_missing_reports: When there is no results file to push, report a global failure
|
185
188
|
help: Show this message
|
186
|
-
http_proxy:
|
187
|
-
|
188
|
-
|
189
|
+
http_proxy: Specify your http proxy to access CucumberStudio
|
190
|
+
indentation: Customize indentation
|
191
|
+
keep_filenames: 'Keep the same name as in CucumberStudio for the test files (note: may cause encoding issues)'
|
192
|
+
keep_foldernames: 'Keep the same name as in CucumberStudio for the folders (note: may cause encoding issues)'
|
189
193
|
language: Target language
|
190
194
|
languages_help: Show languages and framework options
|
191
195
|
leafless_export: Use only last level action word
|
@@ -194,13 +198,14 @@ en:
|
|
194
198
|
not_recursive: 'Used in conjunction with filter-on-folder-ids or filter-on-folder-name: only exports those folders, not their children'
|
195
199
|
only: Restrict export to given file categories (--only=list to list them)
|
196
200
|
output_directory: Output directory
|
201
|
+
overriden_language_configs: Folder for overriden language configs
|
197
202
|
overriden_templates: Folder for overriden templates
|
198
203
|
parameter_delimiter: Parameter delimiter (for Gherkin based export only)
|
199
204
|
parent_folder_tags: 'Export tags from parent folders (note: if set to false, those tags are never rendered. Only available for Gherkin base exports)'
|
200
205
|
push: Push a results file to the server
|
201
206
|
push_format: Format of the test results (cucumber-json, junit, nunit, robot, tap)
|
202
207
|
site: Site to fetch from
|
203
|
-
sort: 'Sorting of tests in output: id will sort them by age, order will keep the same order
|
208
|
+
sort: 'Sorting of tests in output: id will sort them by age, order will keep the same order as in CucumberStudio (only with --with-folders option, will fallback to id otherwise), alpha will sort them by name'
|
204
209
|
split_scenarios: Export each scenario in a single file (except for Gherkin based languages)
|
205
210
|
test_run_id: Export data from a test run identified by its id
|
206
211
|
test_run_name: Export data from a test run identified by its name
|
@@ -211,10 +216,7 @@ en:
|
|
211
216
|
with_dataset_names: 'Export dataset name when creating feature files (note: available only for Gherkin-based exports)'
|
212
217
|
with_folders: Use folders hierarchy to export files in respective directories
|
213
218
|
without: Exclude file categories from import (--only=list to list them)
|
214
|
-
xml_file: XML file to use instead of fetching it from
|
215
|
-
cache_dir: "Path to the directory to store cache of Hiptest data"
|
216
|
-
cache_duration: "Validity of the Hiptest data cache in seconds"
|
217
|
-
indentation: Customize indentation
|
219
|
+
xml_file: XML file to use instead of fetching it from CucumberStudio
|
218
220
|
overwrite:
|
219
221
|
ask_confirmation: 'File %{path} exists, do you want to overwrite it? [y/N] '
|
220
222
|
warning_message: File %{path} already exists, skipping. Use --force to overwrite it.
|
@@ -243,4 +245,6 @@ en:
|
|
243
245
|
required_version: hiptest-publisher requires Ruby version >= %{version}.
|
244
246
|
support_ended: Official support for Ruby %{version} ended on %{year}-%{month}-%{day}
|
245
247
|
use_more_recent: Please use a more recent ruby release to run hiptest-publisher.
|
248
|
+
using_cache: 'Using cache: %{full_path}'
|
249
|
+
using_cached_data: Using cached data from previous export
|
246
250
|
verbose_header: 'Running hiptest-publisher %{version} with:'
|
@@ -1,41 +1,41 @@
|
|
1
|
-
[_common]
|
2
|
-
indentation = ' '
|
3
|
-
fallback_template = 'empty'
|
4
|
-
|
5
|
-
[features]
|
6
|
-
node_name = folders
|
7
|
-
template_dirs = gherkin/inlined_uids, gherkin, common
|
8
|
-
named_filename = '%s.feature'
|
9
|
-
indentation = ' '
|
10
|
-
renderer_addons = 'GherkinAddon'
|
11
|
-
|
12
|
-
[step_definitions]
|
13
|
-
node_name = actionwords
|
14
|
-
template_dirs = cucumber/typescript, javascript, common
|
15
|
-
filename = 'step_definitions.ts'
|
16
|
-
naming_convention = 'camelize_lower'
|
17
|
-
call_prefix = 'actionwords'
|
18
|
-
renderer_addons = 'GherkinAddon'
|
19
|
-
|
20
|
-
[step_definitions_library]
|
21
|
-
node_name = libraries
|
22
|
-
template_dirs = cucumber/typescript, javascript, common
|
23
|
-
named_filename = 'steps_%s.ts'
|
24
|
-
naming_convention = 'camelize_lower'
|
25
|
-
call_prefix = 'actionwords'
|
26
|
-
renderer_addons = 'GherkinAddon'
|
27
|
-
|
28
|
-
[actionwords]
|
29
|
-
template_dirs = typescript, javascript, common
|
30
|
-
filename = 'actionwords.ts'
|
31
|
-
naming_convention = 'camelize_lower'
|
32
|
-
|
33
|
-
|
34
|
-
[library]
|
35
|
-
template_dirs = typescript, javascript, common
|
36
|
-
filename = 'actionword_library.ts'
|
37
|
-
|
38
|
-
[libraries]
|
39
|
-
template_dirs = typescript, javascript, common
|
40
|
-
named_filename = '%s_library.ts'
|
41
|
-
filename_convention = 'underscore'
|
1
|
+
[_common]
|
2
|
+
indentation = ' '
|
3
|
+
fallback_template = 'empty'
|
4
|
+
|
5
|
+
[features]
|
6
|
+
node_name = folders
|
7
|
+
template_dirs = gherkin/inlined_uids, gherkin, common
|
8
|
+
named_filename = '%s.feature'
|
9
|
+
indentation = ' '
|
10
|
+
renderer_addons = 'GherkinAddon'
|
11
|
+
|
12
|
+
[step_definitions]
|
13
|
+
node_name = actionwords
|
14
|
+
template_dirs = cucumber/typescript, javascript, common
|
15
|
+
filename = 'step_definitions.ts'
|
16
|
+
naming_convention = 'camelize_lower'
|
17
|
+
call_prefix = 'actionwords'
|
18
|
+
renderer_addons = 'GherkinAddon'
|
19
|
+
|
20
|
+
[step_definitions_library]
|
21
|
+
node_name = libraries
|
22
|
+
template_dirs = cucumber/typescript, javascript, common
|
23
|
+
named_filename = 'steps_%s.ts'
|
24
|
+
naming_convention = 'camelize_lower'
|
25
|
+
call_prefix = 'actionwords'
|
26
|
+
renderer_addons = 'GherkinAddon'
|
27
|
+
|
28
|
+
[actionwords]
|
29
|
+
template_dirs = typescript, javascript, common
|
30
|
+
filename = 'actionwords.ts'
|
31
|
+
naming_convention = 'camelize_lower'
|
32
|
+
|
33
|
+
|
34
|
+
[library]
|
35
|
+
template_dirs = typescript, javascript, common
|
36
|
+
filename = 'actionword_library.ts'
|
37
|
+
|
38
|
+
[libraries]
|
39
|
+
template_dirs = typescript, javascript, common
|
40
|
+
named_filename = '%s_library.ts'
|
41
|
+
filename_convention = 'underscore'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
[_common]
|
2
|
+
package = 'com.example'
|
3
|
+
fallback_template = 'empty'
|
4
|
+
indentation = ' '
|
5
|
+
dirname_convention = 'underscore'
|
6
|
+
filename_convention = 'camelize'
|
7
|
+
naming_convention = 'camelize_lower'
|
8
|
+
|
9
|
+
[features]
|
10
|
+
node_name = folders
|
11
|
+
template_dirs = gherkin/inlined_uids, gherkin/java, gherkin, common
|
12
|
+
named_filename = '%s.feature'
|
13
|
+
indentation = ' '
|
14
|
+
renderer_addons = 'GherkinAddon'
|
15
|
+
|
16
|
+
[step_definitions]
|
17
|
+
node_name = actionwords
|
18
|
+
template_dirs = cucumber_legacy/groovy/step-definitions, cucumber/groovy/step-definitions, groovy, java, common
|
19
|
+
filename = 'StepDefinitions.groovy'
|
20
|
+
call_prefix = 'actionwords'
|
21
|
+
renderer_addons = 'GherkinAddon'
|
22
|
+
|
23
|
+
[step_definitions_library]
|
24
|
+
node_name = libraries
|
25
|
+
call_prefix = 'actionwords'
|
26
|
+
template_dirs = cucumber_legacy/groovy/step-definitions, cucumber/groovy/step-definitions, groovy, java, common
|
27
|
+
named_filename = 'StepDefinitions%s.groovy'
|
28
|
+
renderer_addons = 'GherkinAddon'
|
29
|
+
|
30
|
+
[actionwords]
|
31
|
+
template_dirs = groovy, java, common
|
32
|
+
filename = 'Actionwords.groovy'
|
33
|
+
|
34
|
+
[library]
|
35
|
+
template_dirs = groovy, java, common
|
36
|
+
filename = 'ActionwordLibrary.groovy'
|
37
|
+
|
38
|
+
[libraries]
|
39
|
+
template_dirs = groovy, java, common
|
40
|
+
named_filename = '%sLibrary.groovy'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
[_common]
|
2
|
+
package = 'com.example'
|
3
|
+
indentation = ' '
|
4
|
+
fallback_template = 'empty'
|
5
|
+
|
6
|
+
[features]
|
7
|
+
node_name = folders
|
8
|
+
template_dirs = gherkin/inlined_uids, gherkin/java, gherkin, common
|
9
|
+
named_filename = '%s.feature'
|
10
|
+
indentation = ' '
|
11
|
+
renderer_addons = 'GherkinAddon'
|
12
|
+
|
13
|
+
[step_definitions]
|
14
|
+
node_name = actionwords
|
15
|
+
template_dirs = cucumber_legacy/java, cucumber/java, java, common
|
16
|
+
filename = 'StepDefinitions.java'
|
17
|
+
naming_convention = 'camelize_lower'
|
18
|
+
call_prefix = 'actionwords'
|
19
|
+
renderer_addons = 'GherkinAddon'
|
20
|
+
|
21
|
+
[actionwords]
|
22
|
+
template_dirs = cucumber_legacy/java/actionwords, cucumber/java/actionwords, java, common
|
23
|
+
filename = 'Actionwords.java'
|
24
|
+
naming_convention = 'camelize_lower'
|
@@ -1,41 +1,41 @@
|
|
1
|
-
[_common]
|
2
|
-
indentation = ' '
|
3
|
-
fallback_template = 'empty'
|
4
|
-
|
5
|
-
[features]
|
6
|
-
node_name = folders
|
7
|
-
template_dirs = gherkin/inlined_uids, gherkin, common
|
8
|
-
named_filename = '%s.feature'
|
9
|
-
indentation = ' '
|
10
|
-
renderer_addons = 'GherkinAddon'
|
11
|
-
|
12
|
-
[step_definitions]
|
13
|
-
node_name = actionwords
|
14
|
-
template_dirs =
|
15
|
-
filename = 'step_definitions.ts'
|
16
|
-
naming_convention = 'camelize_lower'
|
17
|
-
call_prefix = 'actionwords'
|
18
|
-
renderer_addons = 'GherkinAddon'
|
19
|
-
|
20
|
-
[step_definitions_library]
|
21
|
-
node_name = libraries
|
22
|
-
template_dirs =
|
23
|
-
named_filename = 'steps_%s.ts'
|
24
|
-
naming_convention = 'camelize_lower'
|
25
|
-
call_prefix = 'actionwords'
|
26
|
-
renderer_addons = 'GherkinAddon'
|
27
|
-
|
28
|
-
[actionwords]
|
29
|
-
template_dirs = typescript, javascript, common
|
30
|
-
filename = 'actionwords.ts'
|
31
|
-
naming_convention = 'camelize_lower'
|
32
|
-
|
33
|
-
|
34
|
-
[library]
|
35
|
-
template_dirs = typescript, javascript, common
|
36
|
-
filename = 'actionword_library.ts'
|
37
|
-
|
38
|
-
[libraries]
|
39
|
-
template_dirs = typescript, javascript, common
|
40
|
-
named_filename = '%s_library.ts'
|
41
|
-
filename_convention = 'underscore'
|
1
|
+
[_common]
|
2
|
+
indentation = ' '
|
3
|
+
fallback_template = 'empty'
|
4
|
+
|
5
|
+
[features]
|
6
|
+
node_name = folders
|
7
|
+
template_dirs = gherkin/inlined_uids, gherkin, common
|
8
|
+
named_filename = '%s.feature'
|
9
|
+
indentation = ' '
|
10
|
+
renderer_addons = 'GherkinAddon'
|
11
|
+
|
12
|
+
[step_definitions]
|
13
|
+
node_name = actionwords
|
14
|
+
template_dirs = cucumber_legacy/typescript, cucumber/typescript, javascript, common
|
15
|
+
filename = 'step_definitions.ts'
|
16
|
+
naming_convention = 'camelize_lower'
|
17
|
+
call_prefix = 'actionwords'
|
18
|
+
renderer_addons = 'GherkinAddon'
|
19
|
+
|
20
|
+
[step_definitions_library]
|
21
|
+
node_name = libraries
|
22
|
+
template_dirs = cucumber_legacy/typescript, cucumber/typescript, javascript, common
|
23
|
+
named_filename = 'steps_%s.ts'
|
24
|
+
naming_convention = 'camelize_lower'
|
25
|
+
call_prefix = 'actionwords'
|
26
|
+
renderer_addons = 'GherkinAddon'
|
27
|
+
|
28
|
+
[actionwords]
|
29
|
+
template_dirs = typescript, javascript, common
|
30
|
+
filename = 'actionwords.ts'
|
31
|
+
naming_convention = 'camelize_lower'
|
32
|
+
|
33
|
+
|
34
|
+
[library]
|
35
|
+
template_dirs = typescript, javascript, common
|
36
|
+
filename = 'actionword_library.ts'
|
37
|
+
|
38
|
+
[libraries]
|
39
|
+
template_dirs = typescript, javascript, common
|
40
|
+
named_filename = '%s_library.ts'
|
41
|
+
filename_convention = 'underscore'
|
@@ -29,6 +29,7 @@ module Hiptest
|
|
29
29
|
if cli_options.push?
|
30
30
|
check_execution_environment
|
31
31
|
check_push_file
|
32
|
+
check_build_options
|
32
33
|
else
|
33
34
|
check_output_directory
|
34
35
|
check_actionwords_signature_file
|
@@ -213,6 +214,12 @@ module Hiptest
|
|
213
214
|
end
|
214
215
|
end
|
215
216
|
|
217
|
+
def check_build_options
|
218
|
+
if present?(cli_options.build_id) && present?(cli_options.build_name)
|
219
|
+
raise CliOptionError, I18n.t('errors.cli_options.multiple_build_options')
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
216
223
|
private
|
217
224
|
|
218
225
|
def numeric?(arg)
|
@@ -41,7 +41,7 @@ module Hiptest
|
|
41
41
|
|
42
42
|
def url
|
43
43
|
if cli_options.push?
|
44
|
-
"#{cli_options.site}/import_test_results/#{cli_options.token}/#{cli_options.push_format}#{
|
44
|
+
"#{cli_options.site}/import_test_results/#{cli_options.token}/#{cli_options.push_format}#{push_query_parameters}"
|
45
45
|
elsif test_run_id
|
46
46
|
"#{base_publication_path}/test_run/#{test_run_id}#{test_run_export_filter}"
|
47
47
|
else
|
@@ -306,10 +306,21 @@ module Hiptest
|
|
306
306
|
).find_proxy
|
307
307
|
end
|
308
308
|
|
309
|
-
def
|
310
|
-
|
309
|
+
def push_query_parameters
|
310
|
+
parameters = {}
|
311
|
+
unless cli_options.execution_environment.strip.empty?
|
312
|
+
parameters['execution_environment'] = cli_options.execution_environment
|
313
|
+
end
|
314
|
+
|
315
|
+
unless cli_options.build_id.strip.empty?
|
316
|
+
parameters['build_id'] = cli_options.build_id
|
317
|
+
end
|
318
|
+
|
319
|
+
unless cli_options.build_name.strip.empty?
|
320
|
+
parameters['build_name'] = cli_options.build_name
|
321
|
+
end
|
311
322
|
|
312
|
-
""
|
323
|
+
parameters.empty? ? "" : "?#{parameters.map {|key, value| "#{key}=#{ERB::Util.url_encode(value)}"}.join("&")}"
|
313
324
|
end
|
314
325
|
end
|
315
326
|
end
|
@@ -88,7 +88,7 @@ module Hiptest
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def hh_join_gherkin_dataset(context, items, block, else_block = nil)
|
91
|
-
items.map! {|item| item.gsub(/\|/, "\\|")}
|
91
|
+
items.map! { |item| item.gsub(/\|/, "\\|").gsub("\n", "\\n") }
|
92
92
|
|
93
93
|
hh_join(context, items, ' | ', block, else_block)
|
94
94
|
end
|
@@ -203,14 +203,14 @@ class OptionsParser
|
|
203
203
|
{
|
204
204
|
'Ruby' => ['Rspec', 'MiniTest'],
|
205
205
|
'Cucumber' => ['Ruby', 'Java', 'Javascript', 'Groovy', 'TypeScript'],
|
206
|
-
'
|
206
|
+
'Cucumber_Legacy' => ['Java', 'Groovy', 'TypeScript'],
|
207
207
|
'Java' => ['JUnit', 'Test NG', 'Espresso'],
|
208
208
|
'Python' => ['Unittest'],
|
209
209
|
'Robot Framework' => [''],
|
210
210
|
'Selenium IDE' => [''],
|
211
211
|
'Javascript' => ['qUnit', 'Jasmine', 'Mocha', 'Protractor', 'CodeceptJS'],
|
212
212
|
'CSharp' => ['NUnit'],
|
213
|
-
'PHP' => ['PHPUnit'
|
213
|
+
'PHP' => ['PHPUnit'],
|
214
214
|
'SpecFlow' => [''],
|
215
215
|
'Behave' => [''],
|
216
216
|
'Behat' => [''],
|
@@ -229,6 +229,7 @@ class OptionsParser
|
|
229
229
|
Option.new(nil, 'filename-pattern=PATTERN', nil, String, I18n.t('options.filename_pattern'), :filename_pattern),
|
230
230
|
Option.new('c', 'config-file=PATH', nil, String, I18n.t('options.config'), :config),
|
231
231
|
Option.new(nil, 'overriden-templates=PATH', '', String, I18n.t('options.overriden_templates'), :overriden_templates),
|
232
|
+
Option.new(nil, 'overriden-language-configs=PATH', '', String, I18n.t('options.overriden_language_configs'), :overriden_language_configs),
|
232
233
|
Option.new(nil, 'test-run-id=ID', '', String, I18n.t('options.test_run_id'), :test_run_id),
|
233
234
|
Option.new(nil, 'test-run-name=NAME', '', String, I18n.t('options.test_run_name'), :test_run_name),
|
234
235
|
Option.new(nil, 'only=CATEGORIES', nil, String, I18n.t('options.only'), :only),
|
@@ -251,12 +252,14 @@ class OptionsParser
|
|
251
252
|
Option.new(nil, 'empty-folders', false, nil, I18n.t('options.empty_folders'), :empty_folders),
|
252
253
|
Option.new(nil, 'split-scenarios', false, nil, I18n.t('options.split_scenarios'), :split_scenarios),
|
253
254
|
Option.new(nil, 'leafless-export', false, nil, I18n.t('options.leafless_export'), :leafless_export),
|
254
|
-
Option.new('s', 'site=SITE', 'https://
|
255
|
+
Option.new('s', 'site=SITE', 'https://studio.cucumber.io', String, I18n.t('options.site'), :site),
|
255
256
|
Option.new(nil, 'http-proxy=PROXY_URL', nil, String, I18n.t('options.http_proxy'), :http_proxy),
|
256
257
|
Option.new('p', 'push=FILE.TAP', '', String, I18n.t('options.push'), :push),
|
257
258
|
Option.new(nil, 'global-failure-on-missing-reports', false, nil, I18n.t('options.global_failure_on_missing_reports'), :global_failure_on_missing_reports),
|
258
259
|
Option.new(nil, 'push-format=tap', 'tap', String, I18n.t('options.push_format'), :push_format),
|
259
260
|
Option.new(nil, 'execution-environment=NAME', '', String, I18n.t('options.execution_environment'), :execution_environment),
|
261
|
+
Option.new(nil, 'build-id=ID', '', String, I18n.t('options.build_id'), :build_id),
|
262
|
+
Option.new(nil, 'build-name=NAME', '', String, I18n.t('options.build_name'), :build_name),
|
260
263
|
Option.new(nil, 'sort=[id,order,alpha]', 'order', String, I18n.t('options.sort'), :sort),
|
261
264
|
Option.new(nil, '[no-]uids', false, nil, I18n.t('options.uids'), :uids),
|
262
265
|
Option.new(nil, '[no-]parent-folder-tags', true, nil, I18n.t('options.parent_folder_tags'), :parent_folder_tags),
|
@@ -383,6 +386,7 @@ class NodeRenderingContext
|
|
383
386
|
|
384
387
|
def renderer_addons
|
385
388
|
addons = @properties.renderer_addons || ""
|
389
|
+
|
386
390
|
addons.split.map do |addon_name|
|
387
391
|
Hiptest.const_get(addon_name)
|
388
392
|
end
|
@@ -390,11 +394,12 @@ class NodeRenderingContext
|
|
390
394
|
end
|
391
395
|
|
392
396
|
class TemplateFinder
|
393
|
-
attr_reader :template_dirs, :overriden_templates, :forced_templates, :fallback_template
|
397
|
+
attr_reader :template_dirs, :overriden_templates, :overriden_language_configs, :forced_templates, :fallback_template
|
394
398
|
|
395
399
|
def initialize(
|
396
400
|
template_dirs: nil,
|
397
401
|
overriden_templates: nil,
|
402
|
+
overriden_language_configs: nil,
|
398
403
|
indentation: ' ',
|
399
404
|
forced_templates: nil,
|
400
405
|
fallback_template: nil,
|
@@ -696,7 +701,21 @@ class LanguageConfigParser
|
|
696
701
|
else
|
697
702
|
"#{cli_options.language}-#{cli_options.framework}.conf"
|
698
703
|
end
|
699
|
-
config_path =
|
704
|
+
config_path = "/lib/config/#{config_name.downcase}"
|
705
|
+
config_prefix = if !cli_options.overriden_language_configs.to_s.empty?
|
706
|
+
# If the user has specified a overiden language config path, check it first. If the config
|
707
|
+
# exists there, return that, otherwise fall back to the default setup and look for a config there.
|
708
|
+
expanded = File.expand_path("#{cli_options.overriden_language_configs}/#{config_name.downcase}")
|
709
|
+
|
710
|
+
# If the file exists in the path the user specified, set the config path to blank so we will be
|
711
|
+
# looking in the exact path that the user requested.
|
712
|
+
if File.file?(expanded)
|
713
|
+
config_path = ''
|
714
|
+
expanded
|
715
|
+
end
|
716
|
+
end
|
717
|
+
|
718
|
+
config_path = File.expand_path("#{config_prefix || hiptest_publisher_path}#{config_path}")
|
700
719
|
|
701
720
|
if !File.file?(config_path)
|
702
721
|
if cli_options.framework.to_s.empty?
|
@@ -27,7 +27,11 @@ module Hiptest
|
|
27
27
|
if node.is_a? Hiptest::Nodes::Node
|
28
28
|
@rendered_children = {}
|
29
29
|
|
30
|
-
node.children.each
|
30
|
+
node.children.each do |name, child|
|
31
|
+
@rendered_children[name] = @rendered[child]
|
32
|
+
|
33
|
+
@rendered_children[name].uniq! if name == :actionwords && @rendered_children[name].is_a?(Array)
|
34
|
+
end
|
31
35
|
@rendered[node] = render_node(node, super(node))
|
32
36
|
elsif node.is_a? Array
|
33
37
|
@rendered[node] = node.map {|item| @rendered[item]}
|
@@ -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_typed_pattern}}{{/escape_backslashes_and_double_quotes}}") { {{{ join rendered_children.parameters_ordered_by_pattern ', '}}} ->{{#indent}}
|
2
2
|
{{{ context.call_prefix }}}.{{{camelize_lower uniq_name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{{camelize_lower param}}}{{/join}}{{/if}})
|
3
3
|
{{/indent}}
|
4
4
|
}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
package {{{ context.package }}}
|
2
2
|
|
3
|
-
import cucumber.
|
3
|
+
import io.cucumber.datatable.DataTable
|
4
|
+
import io.cucumber.groovy.EN
|
4
5
|
|
5
|
-
this.metaClass.mixin(
|
6
|
+
this.metaClass.mixin(EN)
|
6
7
|
|
7
8
|
Actionwords {{{ context.call_prefix }}} = new Actionwords()
|
8
9
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
package {{{ context.package }}}
|
2
2
|
|
3
|
-
import cucumber.
|
3
|
+
import io.cucumber.datatable.DataTable
|
4
|
+
import io.cucumber.groovy.EN
|
4
5
|
|
5
|
-
this.metaClass.mixin(
|
6
|
+
this.metaClass.mixin(EN)
|
6
7
|
|
7
8
|
Actionwords {{{ context.call_prefix }}} = new Actionwords()
|
8
9
|
|
@@ -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_typed_pattern}}{{/escape_backslashes_and_double_quotes}}") { {{{ join rendered_children.parameters_ordered_by_pattern ', '}}} ->{{#indent}}
|
2
2
|
{{{ context.call_prefix }}}.get{{{camelize library_name}}}Library().{{{camelize_lower uniq_name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{{camelize_lower param}}}{{/join}}{{/if}})
|
3
3
|
{{/indent}}
|
4
4
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
{{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{#escape_backslashes_and_double_quotes}}{{>
|
1
|
+
{{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{#escape_backslashes_and_double_quotes}}{{> gherkin_typed_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 ', ' as |param|}}{{{camelize_lower param}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
package {{{ context.package }}};
|
2
2
|
|
3
|
-
import cucumber.
|
4
|
-
import cucumber.
|
3
|
+
import io.cucumber.datatable.DataTable;
|
4
|
+
import io.cucumber.java.en.*;
|
5
5
|
|
6
6
|
public class StepDefinitions {{#curly}}{{#indent}}
|
7
7
|
public Actionwords {{{ context.call_prefix }}} = new Actionwords();
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation }}
|
2
|
-
{{{ rendered_children.gherkin_annotation }}}(
|
2
|
+
{{{ rendered_children.gherkin_annotation }}}('{{> gherkin_typed_pattern}}', async ({{#if rendered_children.parameters}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}) => {{#curly}}{{#indent}}
|
3
3
|
actionWords.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{{underscore param}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
5
5
|
{{/curly}});{{/if}}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation}}
|
2
|
-
{{{ rendered_children.gherkin_annotation }}}(
|
2
|
+
{{{ rendered_children.gherkin_annotation }}}('{{> gherkin_typed_pattern}}', async ({{#if rendered_children.parameters}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}) => {{#curly}}{{#indent}}
|
3
3
|
libraryActionWord.getDefaultLibrary().{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{{underscore param}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
5
5
|
{{/curly}});{{/if}}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{{#if rendered_children.gherkin_annotation }}{{{ rendered_children.gherkin_annotation }}}(~"^{{#escape_backslashes_and_double_quotes}}{{> gherkin_pattern}}{{/escape_backslashes_and_double_quotes}}\$") { {{{ join rendered_children.parameters_ordered_by_pattern ', '}}} ->{{#indent}}
|
2
|
+
{{{ context.call_prefix }}}.{{{camelize_lower uniq_name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{{camelize_lower param}}}{{/join}}{{/if}})
|
3
|
+
{{/indent}}
|
4
|
+
}
|
5
|
+
{{/if}}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
package {{{ context.package }}}
|
2
|
+
|
3
|
+
import cucumber.api.DataTable
|
4
|
+
|
5
|
+
this.metaClass.mixin(cucumber.api.groovy.EN)
|
6
|
+
|
7
|
+
Actionwords {{{ context.call_prefix }}} = new Actionwords()
|
8
|
+
|
9
|
+
{{#each rendered_children.actionwords as |actionword|}}{{{actionword}}}
|
10
|
+
{{/each}}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
package {{{ context.package }}}
|
2
|
+
|
3
|
+
import cucumber.api.DataTable
|
4
|
+
|
5
|
+
this.metaClass.mixin(cucumber.api.groovy.EN)
|
6
|
+
|
7
|
+
Actionwords {{{ context.call_prefix }}} = new Actionwords()
|
8
|
+
|
9
|
+
{{#each rendered_children.library_actionwords as |actionword|}}{{{actionword}}}
|
10
|
+
{{/each}}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{{#if rendered_children.gherkin_annotation }}{{{ rendered_children.gherkin_annotation }}}(~"^{{#escape_backslashes_and_double_quotes}}{{> gherkin_pattern}}{{/escape_backslashes_and_double_quotes}}\$") { {{{ join rendered_children.parameters_ordered_by_pattern ', '}}} ->{{#indent}}
|
2
|
+
{{{ context.call_prefix }}}.get{{{camelize library_name}}}Library().{{{camelize_lower uniq_name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{{camelize_lower param}}}{{/join}}{{/if}})
|
3
|
+
{{/indent}}
|
4
|
+
}
|
5
|
+
{{/if}}
|