hiptest-publisher 1.1.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/groovy-spock.conf +14 -0
- data/lib/hiptest-publisher/render_context_maker.rb +12 -3
- data/lib/templates/groovy/_body.hbs +8 -0
- data/lib/templates/groovy/_desc.hbs +5 -0
- data/lib/templates/groovy/_scenario.hbs +8 -0
- data/lib/templates/groovy/_steps.hbs +4 -0
- data/lib/templates/groovy/_test.hbs +4 -0
- data/lib/templates/groovy/actionword.hbs +2 -0
- data/lib/templates/groovy/actionwords.hbs +5 -0
- data/lib/templates/groovy/assign.hbs +1 -0
- data/lib/templates/groovy/call.hbs +2 -0
- data/lib/templates/groovy/dataset.hbs +1 -0
- data/lib/templates/groovy/datatable.hbs +2 -0
- data/lib/templates/groovy/dict.hbs +1 -0
- data/lib/templates/groovy/folder.hbs +16 -0
- data/lib/templates/groovy/index.hbs +1 -0
- data/lib/templates/groovy/list.hbs +1 -0
- data/lib/templates/groovy/nullliteral.hbs +1 -0
- data/lib/templates/groovy/parameter.hbs +1 -0
- data/lib/templates/groovy/property.hbs +1 -0
- data/lib/templates/groovy/scenario.hbs +1 -0
- data/lib/templates/groovy/scenarios.hbs +8 -0
- data/lib/templates/groovy/single_scenario.hbs +7 -0
- data/lib/templates/groovy/single_test.hbs +8 -0
- data/lib/templates/groovy/template.hbs +1 -0
- data/lib/templates/groovy/test.hbs +1 -0
- data/lib/templates/groovy/tests.hbs +8 -0
- metadata +28 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86c8c27179d12415472ec3f8523b649f5b651285
|
4
|
+
data.tar.gz: 22e1f2a6a6a1e0ef087db9038773733b06280c36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 743652e8af822db1ffac029194bd5659ec33b7f3d9c2a3c894c4d086cc803fcc229e58b2f9ef36f0d8ce9e0ffce73c28b4d3cff49bfd4fb45e5a5d4fb321bab0
|
7
|
+
data.tar.gz: b4ad9cfc1f6193ec303adaad01e10892c62e7ef906b4557106a41a12e04872847ed7f6ed2e0414849213ae824ecd9b2e9face90729a9a736880b47209ecd86a5
|
@@ -0,0 +1,14 @@
|
|
1
|
+
[_common]
|
2
|
+
template_dirs = groovy, java, common
|
3
|
+
indentation = ' '
|
4
|
+
dirname_convention = 'underscore'
|
5
|
+
filename_convention = 'camelize'
|
6
|
+
naming_convention = 'camelize_lower'
|
7
|
+
|
8
|
+
[tests]
|
9
|
+
filename = 'ProjectSpec.groovy'
|
10
|
+
named_filename = '%sSpec.groovy'
|
11
|
+
call_prefix = 'actionwords'
|
12
|
+
|
13
|
+
[actionwords]
|
14
|
+
filename = 'Actionwords.groovy'
|
@@ -30,14 +30,15 @@ module Hiptest
|
|
30
30
|
:has_tags? => !folder.children[:tags].empty?,
|
31
31
|
:has_step? => has_step?(folder),
|
32
32
|
:is_empty? => folder.children[:body].empty?,
|
33
|
-
:datatables_present? => datatable_present?(folder)
|
33
|
+
:datatables_present? => datatable_present?(folder)
|
34
34
|
)
|
35
35
|
end
|
36
36
|
|
37
37
|
def walk_scenario(scenario)
|
38
38
|
walk_item(scenario).merge(walk_relative_item(scenario)).merge(
|
39
39
|
:project_name => scenario.parent.parent.children[:name],
|
40
|
-
:has_datasets? => has_datasets?(scenario)
|
40
|
+
:has_datasets? => has_datasets?(scenario),
|
41
|
+
:has_annotations? => has_annotations?(scenario)
|
41
42
|
)
|
42
43
|
end
|
43
44
|
|
@@ -81,7 +82,8 @@ module Hiptest
|
|
81
82
|
def walk_call(c)
|
82
83
|
{
|
83
84
|
:has_arguments? => !c.children[:arguments].empty?,
|
84
|
-
:has_annotation? => !c.children[:annotation].nil
|
85
|
+
:has_annotation? => !c.children[:annotation].nil?,
|
86
|
+
:use_main_annotation? => !(c.children[:annotation].nil? || ['and', 'but'].include?(c.children[:annotation]))
|
85
87
|
}
|
86
88
|
end
|
87
89
|
|
@@ -130,6 +132,13 @@ module Hiptest
|
|
130
132
|
false
|
131
133
|
end
|
132
134
|
|
135
|
+
def has_annotations?(scenario)
|
136
|
+
scenario.each_sub_nodes(deep: true) do |node|
|
137
|
+
return true if node.is_a?(Hiptest::Nodes::Call) && !node.children[:annotation].nil?
|
138
|
+
end
|
139
|
+
false
|
140
|
+
end
|
141
|
+
|
133
142
|
def has_datasets?(scenario)
|
134
143
|
datatable = scenario.children[:datatable]
|
135
144
|
datatable ? !datatable.children[:datasets].empty? : false
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{{#curly}}{{#indent}}{{> desc}}{{#unless has_annotations?}}{{#unless is_empty?}}
|
2
|
+
expect:{{/unless}}{{/unless}}
|
3
|
+
{{> steps}}{{#if has_datasets?}}
|
4
|
+
where:
|
5
|
+
{{ join rendered_children.parameters ' | ' }} {{#if context.uids}} | hiptestUid{{/if}}
|
6
|
+
{{rendered_children.datatable}}
|
7
|
+
{{/if}}{{/indent}}
|
8
|
+
{{/curly}}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
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?}}
|
2
|
+
expect:{{/unless}}{{/unless}}
|
3
|
+
{{> steps}}{{#if has_datasets?}}
|
4
|
+
where:
|
5
|
+
{{ join rendered_children.parameters ' | ' }}{{#if context.uids}} | hiptestUid{{/if}}
|
6
|
+
{{rendered_children.datatable}}
|
7
|
+
{{/if}}{{/indent}}
|
8
|
+
{{/curly}}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
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?}}
|
2
|
+
expect:{{/unless}}{{/unless}}
|
3
|
+
{{> steps}}{{/indent}}
|
4
|
+
{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.to }}} = {{{ rendered_children.value }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ join rendered_children.arguments ' | ' }}}{{#if context.uids}} | "uid:{{{rendered_children.uid}}}"{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
[{{{ join rendered_children.items ', '}}}]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import spock.lang.*
|
2
|
+
|
3
|
+
class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
|
4
|
+
def {{{ context.call_prefix }}} = Actionwords.newInstance()
|
5
|
+
|
6
|
+
{{#unless is_empty?}}
|
7
|
+
def setup() {{#curly}}{{#indent}}
|
8
|
+
{{#each rendered_children.body}}{{{this}}}
|
9
|
+
{{/each}}
|
10
|
+
{{/indent}}{{/curly}}
|
11
|
+
{{/unless}}
|
12
|
+
|
13
|
+
{{#each rendered_children.scenarios}}{{{this}}}
|
14
|
+
{{/each}}
|
15
|
+
{{/indent}}
|
16
|
+
{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}[{{{ rendered_children.expression }}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
[{{{ join rendered_children.items ', '}}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
null
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ camelize_lower rendered_children.name }}}{{#if has_default_value?}} = {{{ rendered_children.default }}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.key }}}: {{{ rendered_children.value }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1 @@
|
|
1
|
+
"{{#each treated_chunks}}{{#if this.is_variable?}}${{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> test}}
|
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.2.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-05-
|
11
|
+
date: 2017-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -231,6 +231,7 @@ files:
|
|
231
231
|
- lib/config/cucumber-java.conf
|
232
232
|
- lib/config/cucumber-javascript.conf
|
233
233
|
- lib/config/cucumber-ruby.conf
|
234
|
+
- lib/config/groovy-spock.conf
|
234
235
|
- lib/config/java-espresso.conf
|
235
236
|
- lib/config/java-junit.conf
|
236
237
|
- lib/config/java-testng.conf
|
@@ -339,6 +340,31 @@ files:
|
|
339
340
|
- lib/templates/gherkin/stringliteral.hbs
|
340
341
|
- lib/templates/gherkin/tag.hbs
|
341
342
|
- lib/templates/gherkin/template.hbs
|
343
|
+
- lib/templates/groovy/_body.hbs
|
344
|
+
- lib/templates/groovy/_desc.hbs
|
345
|
+
- lib/templates/groovy/_scenario.hbs
|
346
|
+
- lib/templates/groovy/_steps.hbs
|
347
|
+
- lib/templates/groovy/_test.hbs
|
348
|
+
- lib/templates/groovy/actionword.hbs
|
349
|
+
- lib/templates/groovy/actionwords.hbs
|
350
|
+
- lib/templates/groovy/assign.hbs
|
351
|
+
- lib/templates/groovy/call.hbs
|
352
|
+
- lib/templates/groovy/dataset.hbs
|
353
|
+
- lib/templates/groovy/datatable.hbs
|
354
|
+
- lib/templates/groovy/dict.hbs
|
355
|
+
- lib/templates/groovy/folder.hbs
|
356
|
+
- lib/templates/groovy/index.hbs
|
357
|
+
- lib/templates/groovy/list.hbs
|
358
|
+
- lib/templates/groovy/nullliteral.hbs
|
359
|
+
- lib/templates/groovy/parameter.hbs
|
360
|
+
- lib/templates/groovy/property.hbs
|
361
|
+
- lib/templates/groovy/scenario.hbs
|
362
|
+
- lib/templates/groovy/scenarios.hbs
|
363
|
+
- lib/templates/groovy/single_scenario.hbs
|
364
|
+
- lib/templates/groovy/single_test.hbs
|
365
|
+
- lib/templates/groovy/template.hbs
|
366
|
+
- lib/templates/groovy/test.hbs
|
367
|
+
- lib/templates/groovy/tests.hbs
|
342
368
|
- lib/templates/java/_body.hbs
|
343
369
|
- lib/templates/java/_item_as_function.hbs
|
344
370
|
- lib/templates/java/_scenario.hbs
|