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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de46ef75c4fcd2611fac0fcff6d3dce0d84efe42
4
- data.tar.gz: 0e7e09d5bedd7c6af79f714df313263732351f4f
3
+ metadata.gz: 86c8c27179d12415472ec3f8523b649f5b651285
4
+ data.tar.gz: 22e1f2a6a6a1e0ef087db9038773733b06280c36
5
5
  SHA512:
6
- metadata.gz: f21104a41b824014945004b0682fadee70ce929520611f191857772f95080c70f5ba66faa409bc4bd873082b278a39a5bf10827806976cffbbab5c7b09e9ffa4
7
- data.tar.gz: 9b3f459954581a90a9a94e243e704496a02dfcbaa974c09a6a6fbba50fd2a478884c1d492149426162db6077c67bb1aae8cc4296377a581178903d4af4aa9487
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,5 @@
1
+ {{#if has_description?}}
2
+ {{#comment '//'}}{{rendered_children.description}}{{/comment}}
3
+ {{/if}}{{#if has_tags?}}
4
+ {{#comment '//'}}Tags: {{{ join rendered_children.tags ' '}}}{{/comment}}
5
+ {{/if}}
@@ -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
+
2
+ {{#each rendered_children.body}}{{{this}}}
3
+ {{/each}}{{#if has_step?}}
4
+ throw new UnsupportedOperationException(){{/if}}
@@ -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,2 @@
1
+ def {{{camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.parameters ', '}}}{{/if}}) {{#curly}}{{#indent}}{{> desc}}{{> steps}}{{/indent}}
2
+ {{/curly}}
@@ -0,0 +1,5 @@
1
+ class Actionwords {{#curly}}{{#indent}}{{#each rendered_children.actionwords}}
2
+ {{{this}}}
3
+ {{/each}}
4
+ {{/indent}}
5
+ {{/curly}}
@@ -0,0 +1 @@
1
+ {{{ rendered_children.to }}} = {{{ rendered_children.value }}}
@@ -0,0 +1,2 @@
1
+ {{#if use_main_annotation?}}{{rendered_children.annotation}}:
2
+ {{/if}}{{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{{ camelize_lower rendered_children.actionword }}}({{{ join rendered_children.all_arguments ', '}}})
@@ -0,0 +1 @@
1
+ {{{ join rendered_children.arguments ' | ' }}}{{#if context.uids}} | "uid:{{{rendered_children.uid}}}"{{/if}}
@@ -0,0 +1,2 @@
1
+ {{#each rendered_children.datasets}}{{{this}}}
2
+ {{/each}}
@@ -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
+ {{{ 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,8 @@
1
+ import spock.lang.*
2
+
3
+ class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
4
+ def {{{ context.call_prefix }}} = Actionwords.newInstance()
5
+
6
+ {{#each rendered_children.scenarios}}{{{this}}}
7
+ {{/each}}{{/indent}}
8
+ {{/curly}}
@@ -0,0 +1,7 @@
1
+ import spock.lang.*
2
+
3
+ class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
4
+ def {{{ context.call_prefix }}} = Actionwords.newInstance()
5
+
6
+ {{> scenario}}{{/indent}}
7
+ {{/curly}}
@@ -0,0 +1,8 @@
1
+ import spock.lang.*
2
+
3
+ class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
4
+ def {{{ context.call_prefix }}} = Actionwords.newInstance()
5
+
6
+ {{> test}}
7
+ {{/indent}}
8
+ {{/curly}}
@@ -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}}
@@ -0,0 +1,8 @@
1
+ import spock.lang.*
2
+
3
+ class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
4
+ def {{{ context.call_prefix }}} = Actionwords.newInstance()
5
+
6
+ {{#each rendered_children.tests}}{{{this}}}
7
+ {{/each}}{{/indent}}
8
+ {{/curly}}
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.1.3
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 00:00:00.000000000 Z
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