hiptest-publisher 0.6.6 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -0
  3. data/lib/config/csharp.conf +15 -0
  4. data/lib/config/cucumber-java.conf +22 -0
  5. data/lib/config/cucumber.conf +1 -1
  6. data/lib/config/specflow.conf +22 -0
  7. data/lib/hiptest-publisher/cli_options_checker.rb +9 -0
  8. data/lib/hiptest-publisher/handlebars_helper.rb +3 -1
  9. data/lib/hiptest-publisher/options_parser.rb +4 -1
  10. data/lib/hiptest-publisher/render_context_maker.rb +4 -2
  11. data/lib/hiptest-publisher/string.rb +15 -10
  12. data/lib/templates/{cucumber → common}/empty.hbs +0 -0
  13. data/lib/templates/csharp/_body.hbs +5 -0
  14. data/lib/templates/csharp/_item_as_function.hbs +6 -0
  15. data/lib/templates/csharp/_scenario.hbs +8 -0
  16. data/lib/templates/csharp/actionword.hbs +1 -0
  17. data/lib/templates/csharp/actionwords.hbs +10 -0
  18. data/lib/templates/csharp/argument.hbs +1 -0
  19. data/lib/templates/csharp/assign.hbs +1 -0
  20. data/lib/templates/csharp/binaryexpression.hbs +1 -0
  21. data/lib/templates/csharp/call.hbs +2 -0
  22. data/lib/templates/csharp/dataset.hbs +4 -0
  23. data/lib/templates/csharp/dict.hbs +1 -0
  24. data/lib/templates/csharp/field.hbs +1 -0
  25. data/lib/templates/csharp/ifthen.hbs +7 -0
  26. data/lib/templates/csharp/index.hbs +1 -0
  27. data/lib/templates/csharp/list.hbs +1 -0
  28. data/lib/templates/csharp/nullliteral.hbs +1 -0
  29. data/lib/templates/csharp/parameter.hbs +1 -0
  30. data/lib/templates/csharp/parenthesis.hbs +1 -0
  31. data/lib/templates/csharp/property.hbs +1 -0
  32. data/lib/templates/csharp/scenario.hbs +1 -0
  33. data/lib/templates/csharp/scenarios.hbs +15 -0
  34. data/lib/templates/csharp/single_scenario.hbs +15 -0
  35. data/lib/templates/csharp/single_test.hbs +15 -0
  36. data/lib/templates/csharp/step.hbs +1 -0
  37. data/lib/templates/csharp/stringliteral.hbs +1 -0
  38. data/lib/templates/csharp/tag.hbs +1 -0
  39. data/lib/templates/csharp/template.hbs +1 -0
  40. data/lib/templates/csharp/test.hbs +1 -0
  41. data/lib/templates/csharp/tests.hbs +15 -0
  42. data/lib/templates/csharp/unaryexpression.hbs +1 -0
  43. data/lib/templates/csharp/variable.hbs +1 -0
  44. data/lib/templates/csharp/while.hbs +4 -0
  45. data/lib/templates/cucumber/java/actionword.hbs +6 -0
  46. data/lib/templates/cucumber/java/actionwords.hbs +11 -0
  47. data/lib/templates/cucumber/java/parameter.hbs +1 -0
  48. data/lib/templates/gherkin/{folders_as_features/folder.hbs → folder.hbs} +0 -0
  49. data/lib/templates/gherkin/scenarios.hbs +2 -2
  50. data/lib/templates/gherkin/single_scenario.hbs +1 -3
  51. data/lib/templates/java/call.hbs +2 -1
  52. data/lib/templates/javascript/call.hbs +2 -1
  53. data/lib/templates/python/call.hbs +2 -1
  54. data/lib/templates/robotframework/call.hbs +2 -1
  55. data/lib/templates/ruby/call.hbs +2 -1
  56. data/lib/templates/specflow/actionword.hbs +5 -0
  57. data/lib/templates/specflow/actionwords.hbs +15 -0
  58. metadata +47 -11
  59. data/lib/config/cucumber-folders_as_features.conf +0 -19
  60. data/lib/templates/gherkin/empty.hbs +0 -0
  61. data/lib/templates/gherkin/folders_as_features/single_scenario.hbs +0 -14
  62. data/lib/templates/seleniumide/empty.hbs +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6956de73d91820080c96b9f0644db1560b493fb2
4
- data.tar.gz: efe6707a3bb007912bb41220deda4efedf219afe
3
+ metadata.gz: 3dd259f5d4127ac725be03241682ff8a69fbcd84
4
+ data.tar.gz: aee290040b67791c783fa2703d33ec430fd6497c
5
5
  SHA512:
6
- metadata.gz: 6219d7d9a5e9d51bdecc035e8cdfbeb1fb1c8b4b162fdacd19b668da190760717539a5304d3c6f2aaefd497ba010e81016259a0df09c113b4b430f05136e8c35
7
- data.tar.gz: 9da9349efbeba2972fc3622e3288ba05c309687aded27cbbf53dbac716c68d5fd58b74c356260a0186f8c0995e54e9dbac0ecca0ed8070eed5d2528c2c4a9ac8
6
+ metadata.gz: a730a8443ab01fee38a4c87e93a11d9eb60b294f61b12aa5217eaed2474624b47a92b988dae3cde530b0c3260b6b5a0704f1663605aece4b42ea842e59bc1504
7
+ data.tar.gz: 7af2017a94a16aca8943840fe8146ea5c0c49bc8bfbdefda24e32a34239f851d713cb2f74cd574a7a239868a611c1abd416fc5594572c9c0243db23eeb54a0a1
data/README.md CHANGED
@@ -139,6 +139,24 @@ The tests must then generate a test report that is supported by Hiptest. Current
139
139
 
140
140
  You can specify the type of export when pushing by using the option "--push-format=[tap|junit|robot]" or specifying it in the config file.
141
141
 
142
+
143
+ Development
144
+ -----------
145
+
146
+ While developing, you can install the gem locally by issuing
147
+
148
+ ```
149
+ rake install
150
+ ```
151
+
152
+ You can also run the command directly with `bundle exec ruby -I lib bin/hiptest-publisher`. It is handy to define an alias so you can test your code easily:
153
+
154
+ ```
155
+ # this alias will only work when run from the root of the project
156
+ alias hiptest-publisher='bundle exec ruby -I lib bin/hiptest-publisher'
157
+ ```
158
+
159
+
142
160
  Adding support for other languages and framework
143
161
  ------------------------------------------------
144
162
 
@@ -0,0 +1,15 @@
1
+ [_common]
2
+ template_dirs = csharp, common
3
+ namespace = 'Example'
4
+ indentation = ' '
5
+ filename_convention = 'camelize'
6
+ naming_convention = 'camelize'
7
+
8
+ [tests]
9
+ filename = 'ProjectTest.cs'
10
+ scenario_filename = '%sTest.cs'
11
+ call_prefix = 'Actionwords'
12
+
13
+ [actionwords]
14
+ filename = 'Actionwords.cs'
15
+ call_prefix = 'this'
@@ -0,0 +1,22 @@
1
+ [_common]
2
+ package = 'com.example'
3
+ indentation = ' '
4
+ fallback_template = 'empty'
5
+
6
+ [features]
7
+ node_name = folders
8
+ template_dirs = gherkin, common
9
+ scenario_filename = '%s.feature'
10
+ indentation = ' '
11
+
12
+ [step_definitions]
13
+ node_name = actionwords
14
+ template_dirs = cucumber/java, java, common
15
+ filename = 'StepDefinitions.java'
16
+ naming_convention = 'camelize_lower'
17
+ call_prefix = 'actionwords'
18
+
19
+ [actionwords]
20
+ template_dirs = java, common
21
+ filename = 'Actionwords.java'
22
+ naming_convention = 'camelize_lower'
@@ -3,7 +3,7 @@ indentation = ' '
3
3
  fallback_template = 'empty'
4
4
 
5
5
  [features]
6
- node_name = tests
6
+ node_name = folders
7
7
  template_dirs = gherkin, common
8
8
  scenario_filename = '%s.feature'
9
9
 
@@ -0,0 +1,22 @@
1
+ [_common]
2
+ indentation = ' '
3
+ namespace = 'Example'
4
+ fallback_template = 'empty'
5
+
6
+ [features]
7
+ indentation = ' '
8
+ node_name = folders
9
+ template_dirs = gherkin, gherkin, common
10
+ scenario_filename = '%s.feature'
11
+
12
+ [step_definitions]
13
+ node_name = actionwords
14
+ template_dirs = specflow, csharp, common
15
+ filename = 'StepDefinitions.cs'
16
+ naming_convention = 'camelize_upper'
17
+ call_prefix = 'Actionwords'
18
+
19
+ [actionwords]
20
+ template_dirs = csharp, common
21
+ filename = 'Actionwords.cs'
22
+ naming_convention = 'camelize_upper'
@@ -85,6 +85,15 @@ module Hiptest
85
85
  if present?(cli_options.test_run_id) && !numeric?(cli_options.test_run_id)
86
86
  raise CliOptionError, "Invalid format --test-run-id=\"#{@cli_options.test_run_id}\": the test run id must be numeric"
87
87
  end
88
+
89
+ # language
90
+ if present?(cli_options.language)
91
+ begin
92
+ LanguageConfigParser.config_path_for(cli_options)
93
+ rescue ArgumentError => err
94
+ raise CliOptionError, err.message
95
+ end
96
+ end
88
97
  end
89
98
 
90
99
  private
@@ -19,7 +19,9 @@ module Hiptest
19
19
  :underscore,
20
20
  :camelize,
21
21
  :camelize_lower,
22
- :clear_extension
22
+ :camelize_upper,
23
+ :clear_extension,
24
+ :downcase
23
25
  ]
24
26
 
25
27
  string_helpers.each do |helper|
@@ -374,6 +374,7 @@ class LanguageGroupConfig
374
374
  node: node,
375
375
  call_prefix: @language_group_params[:call_prefix],
376
376
  package: @language_group_params[:package],
377
+ namespace: @language_group_params[:namespace]
377
378
  )
378
379
  end
379
380
 
@@ -443,7 +444,7 @@ class LanguageConfigParser
443
444
  end.compact.first
444
445
  if config_path.nil?
445
446
  message = "cannot find configuration file in \"#{hiptest_publisher_path}/config\" for language #{cli_options.language.inspect}"
446
- message << " and framework #{cli_options.framework.inspect}" if cli_options.framework
447
+ message << " and framework #{cli_options.framework.inspect}" unless cli_options.framework.to_s.empty?
447
448
  raise ArgumentError.new(message)
448
449
  end
449
450
  config_path
@@ -492,6 +493,8 @@ class LanguageConfigParser
492
493
  language_group_params.merge!(group_config(group_name))
493
494
  language_group_params[:group_name] = group_name
494
495
  language_group_params[:package] = @cli_options.package if @cli_options.package
496
+ language_group_params[:namespace] = @cli_options.namespace if @cli_options.namespace
497
+
495
498
 
496
499
  unless @cli_options.overriden_templates.nil? || @cli_options.overriden_templates.empty?
497
500
  language_group_params[:overriden_templates] = @cli_options.overriden_templates
@@ -6,7 +6,8 @@ module Hiptest
6
6
  :has_tags? => !item.children[:tags].empty?,
7
7
  :has_step? => has_step?(item),
8
8
  :is_empty? => item.children[:body].empty?,
9
- :declared_variables => item.declared_variables_names
9
+ :declared_variables => item.declared_variables_names,
10
+ :raw_parameter_names => item.children[:parameters].map {|p| p.children[:name] }
10
11
  }
11
12
  end
12
13
 
@@ -53,7 +54,8 @@ module Hiptest
53
54
 
54
55
  def walk_call(c)
55
56
  {
56
- :has_arguments? => !c.children[:arguments].empty?
57
+ :has_arguments? => !c.children[:arguments].empty?,
58
+ :has_annotation? => !c.children[:annotation].nil?
57
59
  }
58
60
  end
59
61
 
@@ -33,16 +33,21 @@ class String
33
33
  end
34
34
 
35
35
  def camelize_lower
36
- normalized = self.normalize
37
- normalized.split('_').enum_for(:each_with_index).map do |w, i|
38
- if w.empty?
39
- ""
40
- elsif i == 0
41
- "#{w[0].downcase}#{w[1..-1]}"
42
- else
43
- "#{w[0].upcase}#{w[1..-1]}"
44
- end
45
- end.join
36
+ camelized = self.camelize
37
+ if camelized.empty?
38
+ ""
39
+ else
40
+ "#{camelized[0].downcase}#{camelized[1..-1]}"
41
+ end
42
+ end
43
+
44
+ def camelize_upper
45
+ camelized = self.camelize
46
+ if camelized.empty?
47
+ ""
48
+ else
49
+ "#{camelized[0].upcase}#{camelized[1..-1]}"
50
+ end
46
51
  end
47
52
 
48
53
  def clear_extension
File without changes
@@ -0,0 +1,5 @@
1
+ {{#indent}}
2
+ {{#each rendered_children.body}}{{{this}}}
3
+ {{/each}}
4
+ {{#if has_step?}}throw new NotImplementedException();{{/if}}
5
+ {{/indent}}
@@ -0,0 +1,6 @@
1
+ public void {{{ camelize_upper rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.parameters ', '}}}{{/if}}) {{#curly}}
2
+ {{#clear_empty_lines}}
3
+ {{#indent}}{{#if has_tags?}}// Tags: {{{ join rendered_children.tags ' '}}}{{/if}}{{/indent}}
4
+ {{> body}}
5
+ {{/clear_empty_lines}}
6
+ {{/curly}}
@@ -0,0 +1,8 @@
1
+ {{#if has_datasets?}}{{> item_as_function}}
2
+ {{{ rendered_children.datatable }}}
3
+ {{else}}{{#comment '//'}}{{{ rendered_children.description }}}
4
+ {{#if has_tags?}}Tags: {{{ join rendered_children.tags ' '}}}{{/if}}
5
+ {{/comment}}
6
+ [Test]
7
+ public void {{{ camelize rendered_children.name }}}{{#if rendered_children.uid}}Uid{{{ normalize rendered_children.uid}}}{{/if}}() {{#curly}}{{> body}}
8
+ {{/curly}}{{/if}}
@@ -0,0 +1 @@
1
+ {{> item_as_function}}
@@ -0,0 +1,10 @@
1
+ namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
2
+
3
+ public class Actionwords {{#curly}}{{#indent}}
4
+ {{#each rendered_children.actionwords}}
5
+ {{{this}}}
6
+ {{/each}}
7
+ {{/indent}}
8
+ {{/curly}}
9
+ {{/indent}}
10
+ {{/curly}}
@@ -0,0 +1 @@
1
+ {{{ rendered_children.value }}}
@@ -0,0 +1 @@
1
+ {{{ rendered_children.to }}} = {{{ rendered_children.value }}};
@@ -0,0 +1 @@
1
+ {{{ rendered_children.left }}} {{{ rendered_children.operator }}} {{{ rendered_children.right }}}
@@ -0,0 +1,2 @@
1
+ {{#if has_annotation? }}{{#comment '//'}}{{{ rendered_children.gherkin_text }}}{{/comment}}
2
+ {{/if}}{{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{{ camelize_upper rendered_children.actionword }}}({{{ join rendered_children.arguments ', '}}});
@@ -0,0 +1,4 @@
1
+ [Test]
2
+ public void {{{ camelize scenario_name}}}{{{ camelize rendered_children.name}}}{{#if rendered_children.uid}}Uid{{{ normalize rendered_children.uid}}}{{/if}}() {{#curly}}
3
+ {{#indent}}{{{ camelize scenario_name }}}({{{ join rendered_children.arguments ', '}}});{{/indent}}
4
+ {{/curly}}
@@ -0,0 +1 @@
1
+ new Dictionary<String, String>() {{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}}
@@ -0,0 +1 @@
1
+ {{{ rendered_children.base }}}.{{{ rendered_children.name }}}
@@ -0,0 +1,7 @@
1
+ if ({{{ rendered_children.condition }}}) {{#curly}}
2
+ {{#indent}}{{#each rendered_children.then}}{{{this}}}
3
+ {{/each}}{{/indent}}
4
+ {{#if has_else?}}{{ close_curly }} else {{open_curly}}
5
+ {{#indent}}{{#each rendered_children.else}}{{{this}}}
6
+ {{/each}}{{/indent}}
7
+ {{/if}}{{/curly}}
@@ -0,0 +1 @@
1
+ {{{ rendered_children.base }}}[{{{ rendered_children.expression }}}]
@@ -0,0 +1 @@
1
+ {{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {{{ downcase node.type }}} {{{ camelize_lower rendered_children.name }}}
@@ -0,0 +1 @@
1
+ ({{{ rendered_children.content }}})
@@ -0,0 +1 @@
1
+ {{#curly}}{{{ rendered_children.key }}}, {{{ rendered_children.value }}}{{/curly}}
@@ -0,0 +1 @@
1
+ {{> scenario}}
@@ -0,0 +1,15 @@
1
+ namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
2
+
3
+ using System;
4
+ using NUnit.Framework;
5
+
6
+ [TestFixture]
7
+ public class {{{ clear_extension context.filename }}} {{#curly}}
8
+ {{#indent}}
9
+ public Actionwords {{{ context.call_prefix }}} = new Actionwords();
10
+ {{#each rendered_children.scenarios}}{{{this}}}
11
+ {{/each}}
12
+ {{/indent}}
13
+ {{/curly}}
14
+ {{/indent}}
15
+ {{/curly}}
@@ -0,0 +1,15 @@
1
+ namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
2
+
3
+ using System;
4
+ using NUnit.Framework;
5
+
6
+ [TestFixture]
7
+ public class {{{ clear_extension context.filename }}} {{#curly}}
8
+ {{#indent}}
9
+ public Actionwords {{{ context.call_prefix }}} = new Actionwords();
10
+
11
+ {{> scenario}}
12
+ {{/indent}}
13
+ {{/curly}}
14
+ {{/indent}}
15
+ {{/curly}}
@@ -0,0 +1,15 @@
1
+ namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
2
+
3
+ using System;
4
+ using NUnit.Framework;
5
+
6
+ [TestFixture]
7
+ public class {{{ clear_extension context.filename }}} {{#curly}}
8
+ {{#indent}}
9
+ public Actionwords {{{ context.call_prefix }}} = new Actionwords();
10
+
11
+ {{> scenario}}
12
+ {{/indent}}
13
+ {{/curly}}
14
+ {{/indent}}
15
+ {{/curly}}
@@ -0,0 +1 @@
1
+ {{#comment '//'}}TODO: Implement {{{ rendered_children.key }}}: {{{ rendered_children.value }}}{{/comment}}
@@ -0,0 +1 @@
1
+ "{{ rendered_children.value }}"
@@ -0,0 +1 @@
1
+ {{{ rendered_children.key }}}{{#if has_value? }}:{{{ rendered_children.value }}}{{/if}}
@@ -0,0 +1 @@
1
+ {{#join treated_chunks ' + '}}{{#if this.is_variable?}}{{{this.raw.children.name}}}{{else}}"{{{ escape_quotes this.raw.children.value }}}"{{/if}}{{/join}}
@@ -0,0 +1 @@
1
+ {{> scenario}}
@@ -0,0 +1,15 @@
1
+ namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
2
+
3
+ using System;
4
+ using NUnit.Framework;
5
+
6
+ [TestFixture]
7
+ public class {{{ clear_extension context.filename }}} {{#curly}}
8
+ {{#indent}}
9
+ public Actionwords {{{ context.call_prefix }}} = new Actionwords();
10
+ {{#each rendered_children.tests}}{{{this}}}
11
+ {{/each}}
12
+ {{/indent}}
13
+ {{/curly}}
14
+ {{/indent}}
15
+ {{/curly}}
@@ -0,0 +1 @@
1
+ {{{ rendered_children.operator }}}{{{ rendered_children.expression }}}
@@ -0,0 +1 @@
1
+ {{ camelize_lower rendered_children.name }}
@@ -0,0 +1,4 @@
1
+ while ({{{ rendered_children.condition }}}) {{#curly}}{{#indent}}
2
+ {{#each rendered_children.body}}{{{this}}}
3
+ {{/each}}{{/indent}}
4
+ {{/curly}}
@@ -0,0 +1,6 @@
1
+ {{#if rendered_children.gherkin_annotation }}@Given("{{{escape_quotes rendered_children.gherkin_pattern }}}")
2
+ public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.parameters ', '}}}) {{#curly}}{{#indent}}
3
+ {{{ context.call_prefix }}}.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}});
4
+ {{/indent}}
5
+ {{/curly}}
6
+ {{/if}}
@@ -0,0 +1,11 @@
1
+ package {{{ context.package }}};
2
+
3
+ import cucumber.api.java.en.Given;
4
+
5
+ public class StepDefinitions {{#curly}}{{#indent}}
6
+ public Actionwords {{{ context.call_prefix }}} = new Actionwords();
7
+
8
+ {{#each rendered_children.actionwords}}{{{this}}}
9
+ {{/each}}
10
+ {{/indent}}
11
+ {{/curly}}
@@ -0,0 +1 @@
1
+ {{{ node.type }}} {{{ camelize_lower rendered_children.name }}}
@@ -1,3 +1,3 @@
1
- # To export your project to Cucumber correctly, please add the option
1
+ # To export your project to Gherkin correctly, please add the option
2
2
  # --split-scenarios when calling hiptest-publisher. It will generate one
3
- # feature file per scenario from your project.
3
+ # feature file per folder from your project.
@@ -1,4 +1,3 @@
1
- Feature: {{{ rendered_children.name }}}{{#indent}}
2
1
  {{#if has_datasets?}}
3
2
  Scenario Outline: {{{ rendered_children.name }}}{{#indent}}
4
3
  {{#each rendered_children.body}}{{{ this }}}
@@ -12,5 +11,4 @@ Scenario: {{{ rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{re
12
11
  {{#each rendered_children.body}}{{{ this }}}
13
12
  {{/each}}
14
13
  {{/indent}}
15
- {{/if}}
16
- {{/indent}}
14
+ {{/if}}
@@ -1 +1,2 @@
1
- {{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{{ camelize_lower rendered_children.actionword }}}({{{ join rendered_children.arguments ', '}}});
1
+ {{#if has_annotation? }}{{#comment '//'}}{{{ rendered_children.gherkin_text }}}{{/comment}}
2
+ {{/if}}{{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{{ camelize_lower rendered_children.actionword }}}({{{ join rendered_children.arguments ', '}}});
@@ -1 +1,2 @@
1
- this.{{#if context.call_prefix}}{{{ context.call_prefix }}}.{{/if}}{{{ camelize_lower rendered_children.actionword }}}({{{ join rendered_children.arguments ', '}}});
1
+ {{#if has_annotation? }}{{#comment '//'}}{{{ rendered_children.gherkin_text }}}{{/comment}}
2
+ {{/if}}this.{{#if context.call_prefix}}{{{ context.call_prefix }}}.{{/if}}{{{ camelize_lower rendered_children.actionword }}}({{{ join rendered_children.arguments ', '}}});
@@ -1 +1,2 @@
1
- self.{{#if context.call_prefix}}{{{ context.call_prefix }}}.{{/if}}{{{ underscore rendered_children.actionword }}}({{{ join rendered_children.arguments ', '}}})
1
+ {{#if has_annotation? }}{{#comment '#'}}{{{ rendered_children.gherkin_text }}}{{/comment}}
2
+ {{/if}}self.{{#if context.call_prefix}}{{{ context.call_prefix }}}.{{/if}}{{{ underscore rendered_children.actionword }}}({{{ join rendered_children.arguments ', '}}})
@@ -1 +1,2 @@
1
- {{{ underscore rendered_children.actionword }}}{{#if has_arguments?}}{{tab}}{{{ join rendered_children.arguments '\t'}}}{{/if}}
1
+ {{#if has_annotation? }}{{#comment '#'}}{{{ rendered_children.gherkin_text }}}{{/comment}}
2
+ {{/if}}{{{ underscore rendered_children.actionword }}}{{#if has_arguments?}}{{tab}}{{{ join rendered_children.arguments '\t'}}}{{/if}}
@@ -1 +1,2 @@
1
- {{{ underscore rendered_children.actionword }}}{{#if has_arguments?}}({{{ join rendered_children.all_arguments ', '}}}){{/if}}
1
+ {{#if has_annotation? }}{{#comment '#'}}{{{ rendered_children.gherkin_text }}}{{/comment}}
2
+ {{/if}}{{{ underscore rendered_children.actionword }}}{{#if has_arguments?}}({{{ join rendered_children.all_arguments ', '}}}){{/if}}
@@ -0,0 +1,5 @@
1
+ [Given("{{{escape_quotes rendered_children.gherkin_pattern }}}"), When("{{{escape_quotes rendered_children.gherkin_pattern }}}"), Then("{{{escape_quotes rendered_children.gherkin_pattern }}}")]
2
+ public void {{{ camelize_upper rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.parameters ', '}}}{{/if}}) {{#curly}}{{#indent}}
3
+ {{{ context.call_prefix }}}.{{ camelize_upper rendered_children.name }}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}});
4
+ {{/indent}}
5
+ {{/curly}}
@@ -0,0 +1,15 @@
1
+ namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
2
+ using System;
3
+ using TechTalk.SpecFlow;
4
+
5
+ [Binding]
6
+ public class StepDefinitions {{#curly}}{{#indent}}
7
+
8
+ public Actionwords {{{ context.call_prefix }}} = new Actionwords();
9
+ {{#each rendered_children.actionwords}}
10
+ {{{this}}}
11
+ {{/each}}
12
+ {{/indent}}
13
+ {{/curly}}
14
+ {{/indent}}
15
+ {{/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: 0.6.6
4
+ version: 0.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: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2015-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -76,14 +76,14 @@ dependencies:
76
76
  requirements:
77
77
  - - '='
78
78
  - !ruby/object:Gem::Version
79
- version: 1.6.7.rc3
79
+ version: 1.6.7.rc4
80
80
  type: :runtime
81
81
  prerelease: false
82
82
  version_requirements: !ruby/object:Gem::Requirement
83
83
  requirements:
84
84
  - - '='
85
85
  - !ruby/object:Gem::Version
86
- version: 1.6.7.rc3
86
+ version: 1.6.7.rc4
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: multipart-post
89
89
  requirement: !ruby/object:Gem::Requirement
@@ -239,7 +239,8 @@ extra_rdoc_files:
239
239
  files:
240
240
  - README.md
241
241
  - bin/hiptest-publisher
242
- - lib/config/cucumber-folders_as_features.conf
242
+ - lib/config/csharp.conf
243
+ - lib/config/cucumber-java.conf
243
244
  - lib/config/cucumber.conf
244
245
  - lib/config/java-testng.conf
245
246
  - lib/config/java.conf
@@ -250,6 +251,7 @@ files:
250
251
  - lib/config/ruby-minitest.conf
251
252
  - lib/config/ruby.conf
252
253
  - lib/config/seleniumide.conf
254
+ - lib/config/specflow.conf
253
255
  - lib/hiptest-publisher.rb
254
256
  - lib/hiptest-publisher/actionword_indexer.rb
255
257
  - lib/hiptest-publisher/call_arguments_adder.rb
@@ -273,21 +275,54 @@ files:
273
275
  - lib/templates/common/booleanliteral.hbs
274
276
  - lib/templates/common/dataset.hbs
275
277
  - lib/templates/common/datatable.hbs
278
+ - lib/templates/common/empty.hbs
276
279
  - lib/templates/common/nullliteral.hbs
277
280
  - lib/templates/common/numericliteral.hbs
278
281
  - lib/templates/common/stringliteral.hbs
279
282
  - lib/templates/common/variable.hbs
283
+ - lib/templates/csharp/_body.hbs
284
+ - lib/templates/csharp/_item_as_function.hbs
285
+ - lib/templates/csharp/_scenario.hbs
286
+ - lib/templates/csharp/actionword.hbs
287
+ - lib/templates/csharp/actionwords.hbs
288
+ - lib/templates/csharp/argument.hbs
289
+ - lib/templates/csharp/assign.hbs
290
+ - lib/templates/csharp/binaryexpression.hbs
291
+ - lib/templates/csharp/call.hbs
292
+ - lib/templates/csharp/dataset.hbs
293
+ - lib/templates/csharp/dict.hbs
294
+ - lib/templates/csharp/field.hbs
295
+ - lib/templates/csharp/ifthen.hbs
296
+ - lib/templates/csharp/index.hbs
297
+ - lib/templates/csharp/list.hbs
298
+ - lib/templates/csharp/nullliteral.hbs
299
+ - lib/templates/csharp/parameter.hbs
300
+ - lib/templates/csharp/parenthesis.hbs
301
+ - lib/templates/csharp/property.hbs
302
+ - lib/templates/csharp/scenario.hbs
303
+ - lib/templates/csharp/scenarios.hbs
304
+ - lib/templates/csharp/single_scenario.hbs
305
+ - lib/templates/csharp/single_test.hbs
306
+ - lib/templates/csharp/step.hbs
307
+ - lib/templates/csharp/stringliteral.hbs
308
+ - lib/templates/csharp/tag.hbs
309
+ - lib/templates/csharp/template.hbs
310
+ - lib/templates/csharp/test.hbs
311
+ - lib/templates/csharp/tests.hbs
312
+ - lib/templates/csharp/unaryexpression.hbs
313
+ - lib/templates/csharp/variable.hbs
314
+ - lib/templates/csharp/while.hbs
280
315
  - lib/templates/cucumber/actionword.hbs
281
316
  - lib/templates/cucumber/actionwords.hbs
282
- - lib/templates/cucumber/empty.hbs
317
+ - lib/templates/cucumber/java/actionword.hbs
318
+ - lib/templates/cucumber/java/actionwords.hbs
319
+ - lib/templates/cucumber/java/parameter.hbs
283
320
  - lib/templates/cucumber/parameter.hbs
284
321
  - lib/templates/gherkin/argument.hbs
285
322
  - lib/templates/gherkin/call.hbs
286
323
  - lib/templates/gherkin/dataset.hbs
287
324
  - lib/templates/gherkin/datatable.hbs
288
- - lib/templates/gherkin/empty.hbs
289
- - lib/templates/gherkin/folders_as_features/folder.hbs
290
- - lib/templates/gherkin/folders_as_features/single_scenario.hbs
325
+ - lib/templates/gherkin/folder.hbs
291
326
  - lib/templates/gherkin/parameter.hbs
292
327
  - lib/templates/gherkin/scenarios.hbs
293
328
  - lib/templates/gherkin/single_scenario.hbs
@@ -464,13 +499,14 @@ files:
464
499
  - lib/templates/ruby/while.hbs
465
500
  - lib/templates/seleniumide/argument.hbs
466
501
  - lib/templates/seleniumide/call.hbs
467
- - lib/templates/seleniumide/empty.hbs
468
502
  - lib/templates/seleniumide/single_test.hbs
469
503
  - lib/templates/seleniumide/step.hbs
470
504
  - lib/templates/seleniumide/stringliteral.hbs
471
505
  - lib/templates/seleniumide/template.hbs
472
506
  - lib/templates/seleniumide/test.hbs
473
507
  - lib/templates/seleniumide/tests.hbs
508
+ - lib/templates/specflow/actionword.hbs
509
+ - lib/templates/specflow/actionwords.hbs
474
510
  homepage: https://hiptest.net
475
511
  licenses:
476
512
  - GPL 2
@@ -491,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
491
527
  version: '0'
492
528
  requirements: []
493
529
  rubyforge_project:
494
- rubygems_version: 2.4.5
530
+ rubygems_version: 2.4.6
495
531
  signing_key:
496
532
  specification_version: 4
497
533
  summary: Export your tests from Hiptest into executable tests.
@@ -1,19 +0,0 @@
1
- [_common]
2
- indentation = ' '
3
- fallback_template = 'empty'
4
-
5
- [features]
6
- node_name = folders
7
- template_dirs = gherkin/folders_as_features, gherkin, common
8
- scenario_filename = '%s.feature'
9
-
10
- [step_definitions]
11
- node_name = actionwords
12
- template_dirs = cucumber, common
13
- filename = 'step_definitions.rb'
14
- naming_convention = 'underscore'
15
-
16
- [actionwords]
17
- template_dirs = ruby, common
18
- filename = 'actionwords.rb'
19
- naming_convention = 'underscore'
File without changes
@@ -1,14 +0,0 @@
1
- {{#if has_datasets?}}
2
- Scenario Outline: {{{ rendered_children.name }}}{{#indent}}
3
- {{#each rendered_children.body}}{{{ this }}}
4
- {{/each}}
5
- Examples:{{#indent}}
6
- | {{ join rendered_children.parameters ' | ' }} | hiptest-uid |
7
- {{{rendered_children.datatable}}}
8
- {{/indent}}{{/indent}}
9
- {{else}}
10
- Scenario: {{{ rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}{{#indent}}
11
- {{#each rendered_children.body}}{{{ this }}}
12
- {{/each}}
13
- {{/indent}}
14
- {{/if}}
File without changes