hiptest-publisher 1.14.1 → 1.15.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
  SHA256:
3
- metadata.gz: d1673a123f0948f8bdcec1879004e28fd0d85271435169e63da0248b3cd14c8b
4
- data.tar.gz: a520b8f8f7fbb031d7d596f538e7512ba6248a52a144b4e0b06fd2d2d7a2c005
3
+ metadata.gz: '09c7c858fbf0ec7499ca9a13ca5f4ebb9ea5cd2754811d57aaf47a8f2667a803'
4
+ data.tar.gz: 301b30459a64f5fd4e98e7c395e4709177f5863bad7e2f6c9706ccaa6fb2cfbc
5
5
  SHA512:
6
- metadata.gz: 4409a80f24bc26a62c75d1537b002f40a61e4f1997f02aa47ca17e9235b1af6b7d861d4b8c608bf2baef88b9edf9447e885a0df161365936a7ab106763c1ced9
7
- data.tar.gz: 3a904091dbb33e95488d19b1d462725cb78f887db9c15d49a3f1d761312f621c87e9997038ad1fd30c557b67a6af18a206a29cbb4d53a309cc82cec94c2fc046
6
+ metadata.gz: c3cfe825b36ff482f5fe516f49e3406232a06c2cdddef20c6556c64ec1c1d64babfd3da823eb37425ae307eb19143c08ed55d7c461c68ae5923fcbe5dfd61ffc
7
+ data.tar.gz: b60c17d5e69d9f676d7f14447a82d3a0c9db3759528166b715f4cd067b489f8453216f86700fa8028b709027058d599e1ff142a034512d445afb6403a22480a7
@@ -28,13 +28,13 @@ named_filename = 'StepDefinitions%s.groovy'
28
28
  renderer_addons = 'GherkinAddon'
29
29
 
30
30
  [actionwords]
31
- template_dirs = cucumber/groovy/actionwords, groovy, java, common
31
+ template_dirs = groovy/actionwords-library, groovy, java, common
32
32
  filename = 'Actionwords.groovy'
33
33
 
34
34
  [library]
35
- template_dirs = cucumber/groovy/actionwords-library, groovy, java, common
35
+ template_dirs = groovy/actionwords-library, groovy, java, common
36
36
  filename = 'ActionwordLibrary.groovy'
37
37
 
38
38
  [libraries]
39
- template_dirs = cucumber/groovy/actionwords-library, groovy, java, common
39
+ template_dirs = groovy/actionwords-library, groovy, java, common
40
40
  named_filename = '%sLibrary.groovy'
@@ -1,4 +1,5 @@
1
1
  [_common]
2
+ package = 'com.example'
2
3
  template_dirs = groovy, java, common
3
4
  indentation = ' '
4
5
  dirname_convention = 'underscore'
@@ -12,4 +13,13 @@ named_filename = '%sSpec.groovy'
12
13
  call_prefix = 'actionwords'
13
14
 
14
15
  [actionwords]
16
+ template_dirs = groovy/actionwords-library, groovy, java, common
15
17
  filename = 'Actionwords.groovy'
18
+
19
+ [library]
20
+ template_dirs = groovy/actionwords-library, groovy, java, common
21
+ filename = 'ActionwordLibrary.groovy'
22
+
23
+ [libraries]
24
+ template_dirs = groovy/actionwords-library, groovy, java, common
25
+ named_filename = '%sLibrary.groovy'
@@ -111,6 +111,8 @@ module Hiptest
111
111
  def walk_uidcall(uidcall)
112
112
  {
113
113
  has_library?: !uidcall.children[:library_name].nil?,
114
+ has_annotation?: !uidcall.children[:annotation].nil?,
115
+ in_actionword?: uidcall.parent.is_a?(Hiptest::Nodes::Actionword),
114
116
  chunks: uidcall.chunks || []
115
117
  }
116
118
  end
@@ -4,23 +4,37 @@ module Hiptest
4
4
  module GroovySpockAddon
5
5
  def walk_call(call)
6
6
  base = super(call)
7
- base[:use_expect_annotation] = needs_fixing?(call)
8
- base[:use_main_annotation?] = !(call.children[:annotation].nil? || ['and', 'but'].include?(call.children[:annotation]))
7
+ use_annotation(call, base)
8
+ end
9
9
 
10
- return base
10
+ def walk_uidcall(uidcall)
11
+ base = super(uidcall)
12
+ use_annotation(uidcall, base)
11
13
  end
12
14
 
15
+
13
16
  private
14
17
 
18
+ def use_annotation(call, base)
19
+ base[:use_expect_annotation] = needs_fixing?(call)
20
+ base[:use_main_annotation?] = !(call.children[:annotation].nil? || ['and', 'but'].include?(call.children[:annotation]))
21
+
22
+ base
23
+ end
24
+
15
25
  def needs_fixing?(call)
16
26
  scenario = call.parent
17
27
 
18
28
  return false unless scenario.is_a?(Hiptest::Nodes::Scenario)
19
- return false unless call.children[:annotation].nil? || call.children[:annotation].downcase == 'then'
29
+ return false unless call.children[:annotation].nil? || ignore_case_equal?(call.children[:annotation], 'then')
20
30
 
21
31
  return call.parent.children[:body].select do |step|
22
- step.is_a?(Hiptest::Nodes::Call) && !step.children[:annotation].nil? && step.children[:annotation].downcase == 'when'
32
+ (step.is_a?(Hiptest::Nodes::Call) || step.is_a?(Hiptest::Nodes::UIDCall)) && !step.children[:annotation].nil? && ignore_case_equal?(step.children[:annotation], 'when')
23
33
  end.empty?
24
34
  end
35
+
36
+ def ignore_case_equal?(string1, string2)
37
+ string1.casecmp(string2) == 0
38
+ end
25
39
  end
26
40
  end
@@ -317,6 +317,12 @@ module Hiptest
317
317
  )
318
318
  end
319
319
 
320
+ def build_actionwordLibrarySnapshots(libraries)
321
+ Hiptest::Nodes::Libraries.new(
322
+ build_node_list(libraries.css('> actionwordLibrarySnapshot'))
323
+ )
324
+ end
325
+
320
326
  def build_actionwordLibrary(library)
321
327
  Hiptest::Nodes::Library.new(
322
328
  css_first_content(library, '> name'),
@@ -324,6 +330,13 @@ module Hiptest
324
330
  )
325
331
  end
326
332
 
333
+ def build_actionwordLibrarySnapshot(library)
334
+ Hiptest::Nodes::Library.new(
335
+ css_first_content(library, '> name'),
336
+ build_node_list(library.css('> libraryActionwordSnapshots actionwordSnapshot'))
337
+ )
338
+ end
339
+
327
340
  def build_folderSnapshots(folder_snapshots)
328
341
  build_testPlan(folder_snapshots, '> folderSnapshot')
329
342
  end
@@ -336,10 +349,12 @@ module Hiptest
336
349
  test_plan_node = css_first(project, '> testPlan')
337
350
  scenarios_node = css_first(project, '> scenarios')
338
351
  actionwords_node = css_first(project, '> actionwords')
352
+ libraries_node = css_first(project, '> actionwordLibraries')
339
353
  else
340
354
  test_plan_node = css_first(test_run, '> folderSnapshots')
341
355
  scenarios_node = css_first(test_run, '> scenarioSnapshots')
342
356
  actionwords_node = css_first(test_run, '> actionwordSnapshots')
357
+ libraries_node = css_first(test_run, '> actionwordLibrarySnapshots')
343
358
  end
344
359
 
345
360
  @project = Hiptest::Nodes::Project.new(
@@ -349,7 +364,7 @@ module Hiptest
349
364
  build_node(scenarios_node, Hiptest::Nodes::Scenarios),
350
365
  build_node(actionwords_node, Hiptest::Nodes::Actionwords),
351
366
  build_node(css_first(project, '> tests'), Hiptest::Nodes::Tests),
352
- build_node(css_first(project, '> actionwordLibraries'), Hiptest::Nodes::Libraries)
367
+ build_node(libraries_node, Hiptest::Nodes::Libraries)
353
368
  )
354
369
 
355
370
  @project.assign_scenarios_to_folders
@@ -1,4 +1,6 @@
1
- class Actionwords {{#curly}}{{#indent}}{{#each rendered_children.actionwords}}
1
+ package {{{ context.package }}}
2
+
3
+ class Actionwords {{#if uses_library? }}extends ActionwordLibrary{{/if}}{{#curly}}{{#indent}}{{#each rendered_children.actionwords}}
2
4
  {{{this}}}
3
5
  {{/each}}
4
6
  {{/indent}}
@@ -1,3 +1,5 @@
1
+ package {{{ context.package }}}
2
+
1
3
  import spock.lang.*
2
4
 
3
5
  class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
@@ -1,8 +1,8 @@
1
- package {{{ context.package }}};
1
+ package {{{ context.package }}}
2
2
 
3
3
  class ActionwordLibrary {{#curly}}{{#indent}}{{#each library_names}}
4
4
  {{camelize this}}Library get{{camelize this}}Library() {{#curly}}{{#indent}}
5
- return {{camelize this}}Library.instance;
5
+ return {{camelize this}}Library.instance
6
6
  {{/indent}}
7
7
  {{/curly}}
8
8
  {{/each}}{{/indent}}
@@ -1,4 +1,4 @@
1
- package {{{ context.package }}};
1
+ package {{{ context.package }}}
2
2
 
3
3
  @Singleton
4
4
  class {{camelize rendered_children.name}}Library {{#curly}}{{#indent}}{{#each rendered_children.actionwords}}
@@ -1,3 +1,5 @@
1
+ package {{{ context.package }}}
2
+
1
3
  import spock.lang.*
2
4
 
3
5
  class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
@@ -1,3 +1,5 @@
1
+ package {{{ context.package }}}
2
+
1
3
  import spock.lang.*
2
4
 
3
5
  class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
@@ -1,3 +1,5 @@
1
+ package {{{ context.package }}}
2
+
1
3
  import spock.lang.*
2
4
 
3
5
  class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
@@ -1,3 +1,5 @@
1
+ package {{{ context.package }}}
2
+
1
3
  import spock.lang.*
2
4
 
3
5
  class {{{ clear_extension context.filename }}} extends Specification {{#curly}}{{#indent}}
@@ -0,0 +1,2 @@
1
+ {{#unless in_actionword?}}{{#if use_main_annotation?}}{{#if use_expect_annotation}}expect{{else}}{{rendered_children.annotation}}{{/if}}:
2
+ {{/if}}{{/unless}}{{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{#if has_library?}}get{{{camelize rendered_children.library_name}}}Library().{{/if}}{{{ camelize_lower rendered_children.actionword_name }}}({{{ join rendered_children.all_arguments ', '}}})
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.14.1
4
+ version: 1.15.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: 2018-09-25 00:00:00.000000000 Z
11
+ date: 2018-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -335,11 +335,6 @@ files:
335
335
  - lib/templates/csharp/while.hbs
336
336
  - lib/templates/cucumber/actionword.hbs
337
337
  - lib/templates/cucumber/actionwords.hbs
338
- - lib/templates/cucumber/groovy/actionwords-library/actionword.hbs
339
- - lib/templates/cucumber/groovy/actionwords-library/libraries.hbs
340
- - lib/templates/cucumber/groovy/actionwords-library/library.hbs
341
- - lib/templates/cucumber/groovy/actionwords-library/uidcall.hbs
342
- - lib/templates/cucumber/groovy/actionwords/actionwords.hbs
343
338
  - lib/templates/cucumber/groovy/step-definitions/_gherkin_pattern.hbs
344
339
  - lib/templates/cucumber/groovy/step-definitions/actionword.hbs
345
340
  - lib/templates/cucumber/groovy/step-definitions/actionwords.hbs
@@ -380,6 +375,7 @@ files:
380
375
  - lib/templates/groovy/_steps.hbs
381
376
  - lib/templates/groovy/_test.hbs
382
377
  - lib/templates/groovy/actionword.hbs
378
+ - lib/templates/groovy/actionwords-library/actionword.hbs
383
379
  - lib/templates/groovy/actionwords.hbs
384
380
  - lib/templates/groovy/assign.hbs
385
381
  - lib/templates/groovy/call.hbs
@@ -388,6 +384,8 @@ files:
388
384
  - lib/templates/groovy/dict.hbs
389
385
  - lib/templates/groovy/folder.hbs
390
386
  - lib/templates/groovy/index.hbs
387
+ - lib/templates/groovy/libraries.hbs
388
+ - lib/templates/groovy/library.hbs
391
389
  - lib/templates/groovy/list.hbs
392
390
  - lib/templates/groovy/nullliteral.hbs
393
391
  - lib/templates/groovy/parameter.hbs
@@ -399,6 +397,7 @@ files:
399
397
  - lib/templates/groovy/template.hbs
400
398
  - lib/templates/groovy/test.hbs
401
399
  - lib/templates/groovy/tests.hbs
400
+ - lib/templates/groovy/uidcall.hbs
402
401
  - lib/templates/java/_body.hbs
403
402
  - lib/templates/java/_item_as_function.hbs
404
403
  - lib/templates/java/_scenario.hbs
@@ -1 +0,0 @@
1
- {{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{{ camelize_lower rendered_children.actionword_name }}}({{{ join rendered_children.all_arguments ', '}}});
@@ -1,7 +0,0 @@
1
- package {{{ context.package }}}
2
-
3
- class Actionwords {{#if uses_library? }}extends ActionwordLibrary{{/if}}{{#curly}}{{#indent}}{{#each rendered_children.actionwords}}
4
- {{{this}}}
5
- {{/each}}
6
- {{/indent}}
7
- {{/curly}}