hiptest-publisher 1.11.1 → 1.12.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
- SHA1:
3
- metadata.gz: 9aed441d2c5e289cc0a6dd6e8e3837cd273309f8
4
- data.tar.gz: c931d3440587c60b9f5896eadf1e61dd03584dd5
2
+ SHA256:
3
+ metadata.gz: 4c8a02db3a799b5e2e155b033bd99540a6004f10548d8e96b8790bd0db7754f7
4
+ data.tar.gz: 7a72e7b6b64462ef50e77a9e22bf32bf380f427a3fc859ab5019e7943efe7cf8
5
5
  SHA512:
6
- metadata.gz: 9af7e369dee2a26bb01ad31a1cc40085a1893b85f339be14a763acbaaecc54c3d298d31037a75b06d5c5b15e32aacb537ce939ec19215825f5ca186ba2b669b3
7
- data.tar.gz: aba538efc3a191caf6308172835abc0bdf544f9da34a23502ef079d25092fd0958ce0b7141820ba863cd94b0fb85b1b064d8b7c7f2bbf147711fd1d9a4e977c9
6
+ metadata.gz: d21c08e718c31874d666d125699a800269a0b2c816b51c02f1559abbfa16dc4db96e56b67a0e2de09249f27ee099f533bba39ee04a8ff8c27731ca05fc249e69
7
+ data.tar.gz: 6bfef4d36438d2c457e13b6a4f0b308b90f207be612e9abe52ea138362f094f7d0c07531781e7c4e83ed3c7b11c368bb36e6dcecc8d88f8b32e0d2992864e9cc
data/README.md CHANGED
@@ -6,7 +6,6 @@ Hiptest Publisher
6
6
  [![Gem Version](https://badge.fury.io/rb/hiptest-publisher.svg)](http://badge.fury.io/rb/hiptest-publisher)
7
7
  [![Code Climate](https://codeclimate.com/github/hiptest/hiptest-publisher/badges/gpa.svg)](https://codeclimate.com/github/hiptest/hiptest-publisher)
8
8
  [![Test Coverage](https://codeclimate.com/github/hiptest/hiptest-publisher/badges/coverage.svg)](https://codeclimate.com/github/hiptest/hiptest-publisher)
9
- [![Dependency Status](https://gemnasium.com/hiptest/hiptest-publisher.svg)](https://gemnasium.com/hiptest/hiptest-publisher)
10
9
 
11
10
 
12
11
  Installing
@@ -93,6 +92,7 @@ You could obtain for example:
93
92
 
94
93
  ```shell
95
94
  Exports tests from Hiptest for automation.
95
+
96
96
  Specific options:
97
97
  -t, --token=TOKEN Secret token (available in your project settings)
98
98
  -l, --language=LANG Target language (default: ruby)
@@ -110,6 +110,8 @@ Specific options:
110
110
  --actionwords-only (deprecated) alias for --only=actionwords (default: false)
111
111
  --actionwords-signature Export actionwords signature (default: false)
112
112
  --show-actionwords-diff Show actionwords diff since last update (summary) (default: false)
113
+ --show-actionwords-diff-as-json
114
+ Show actionwords diff since last update (JSON output) (default: false)
113
115
  --show-actionwords-deleted Output signature of deleted action words (default: false)
114
116
  --show-actionwords-created Output code for new action words (default: false)
115
117
  --show-actionwords-renamed Output signatures of renamed action words (default: false)
@@ -123,6 +125,8 @@ Specific options:
123
125
  --leafless-export Use only last level action word (default: false)
124
126
  -s, --site=SITE Site to fetch from (default: https://app.hiptest.com)
125
127
  -p, --push=FILE.TAP Push a results file to the server
128
+ --global-failure-on-missing-reports
129
+ When there is no results file to push, report a global failure (default: false)
126
130
  --push-format=tap Format of the test results (junit, nunit, tap, robot) (default: tap)
127
131
  --sort=[id,order,alpha] Sorting of tests in output: id will sort them by age, order will keep the same order than in hiptest (only with --with-folders option, will fallback to id otherwise), alpha will sort them by name (default: order)
128
132
  --[no-]uids Export UIDs (note: can be disabled only for Gherkin-based exports, may cause issue when pushing results back) (default: true)
@@ -137,6 +141,7 @@ Specific options:
137
141
  --filter-on-status=STATUS Filter on test status in last build (use in conjunction with a test run)
138
142
  --not-recursive Used in conjunction with filter-on-folder-ids or filter-on-folder-name: only exports those folders, not their children (default: false)
139
143
  --check-version Check if a new release of hiptest-publisher is available (default: false)
144
+ --force Force overwrite of existing files (do not apply to test files) (default: false)
140
145
  -v, --verbose Run verbosely (default: false)
141
146
  -H, --languages-help Show languages and framework options
142
147
  -h, --help Show this message
@@ -15,6 +15,7 @@ template_dirs = behave, python, common
15
15
  filename = 'steps.py'
16
16
  naming_convention = 'underscore'
17
17
  call_prefix = 'self.actionwords'
18
+ renderer_addons = 'BehaveAddon'
18
19
 
19
20
  [actionwords]
20
21
  template_dirs = python, common
@@ -0,0 +1,22 @@
1
+ [_common]
2
+ package = 'com.example'
3
+ indentation = ' '
4
+ fallback_template = 'empty'
5
+
6
+ [stories]
7
+ node_name = folders
8
+ template_dirs = jbehave, gherkin/inlined_uids, gherkin/java, gherkin, common
9
+ named_filename = '%s.story'
10
+ indentation = ' '
11
+
12
+ [step_definitions]
13
+ node_name = actionwords
14
+ template_dirs = jbehave/steps, jbehave/actionwords, java, common
15
+ filename = 'StepDefinitions.java'
16
+ naming_convention = 'camelize_lower'
17
+ call_prefix = 'actionwords'
18
+
19
+ [actionwords]
20
+ template_dirs = jbehave/actionwords, java, common
21
+ filename = 'Actionwords.java'
22
+ naming_convention = 'camelize_lower'
@@ -134,6 +134,7 @@ module Hiptest
134
134
  if actionword_parameters.has_key?(inline_parameter_name)
135
135
  actionword.chunks << {
136
136
  value: "(.*)",
137
+ name: inline_parameter_name,
137
138
  is_parameter: true
138
139
  }
139
140
  else
@@ -148,6 +149,7 @@ module Hiptest
148
149
  missing_parameter_names.each do |missing_parameter_name|
149
150
  actionword.extra_inlined_parameters << {
150
151
  value: "(.*)",
152
+ name: missing_parameter_name,
151
153
  is_parameter: true
152
154
  }
153
155
  end
@@ -199,7 +199,8 @@ class OptionsParser
199
199
  'SpecFlow' => [''],
200
200
  'Behave' => [''],
201
201
  'Behat' => [''],
202
- 'Groovy' => ['Spock']
202
+ 'Groovy' => ['Spock'],
203
+ 'JBehave' => ['']
203
204
  }
204
205
  end
205
206
 
@@ -237,6 +238,7 @@ class OptionsParser
237
238
  Option.new(nil, 'push-format=tap', 'tap', String, "Format of the test results (junit, nunit, tap, robot)", :push_format),
238
239
  Option.new(nil, 'sort=[id,order,alpha]', 'order', String, "Sorting of tests in output: id will sort them by age, order will keep the same order than in hiptest (only with --with-folders option, will fallback to id otherwise), alpha will sort them by name", :sort),
239
240
  Option.new(nil, '[no-]uids', true, nil, 'Export UIDs (note: can be disabled only for Gherkin-based exports, may cause issue when pushing results back)', :uids),
241
+ Option.new(nil, 'with-dataset-names', false, nil, 'Export dataset name when creating feature files (note: available only for Gherkin-based exports)', :with_dataset_names),
240
242
  Option.new(nil, 'keep-filenames', false, nil, "Keep the same name as in Hiptest for the test files (note: may cause encoding issues)", :keep_filenames),
241
243
  Option.new(nil, 'keep-foldernames', false, nil, "Keep the same name as in Hiptest for the folders (note: may cause encoding issues)", :keep_foldernames),
242
244
  Option.new(nil, 'filter-on-scenario-ids=IDS', '', String, "Filter on scenario ids (use commas to separate ids when fetching multiple scenarios)", :filter_on_scenario_ids),
@@ -561,7 +563,8 @@ class LanguageGroupConfig
561
563
  package: @language_group_params[:package],
562
564
  namespace: @language_group_params[:namespace],
563
565
  uids: @user_params[:uids],
564
- renderer_addons: @language_group_params[:renderer_addons],
566
+ with_dataset_names: @user_params[:with_dataset_names],
567
+ renderer_addons: @language_group_params[:renderer_addons]
565
568
  )
566
569
  end
567
570
 
@@ -25,7 +25,9 @@ module Hiptest
25
25
  def walk_actionword(aw)
26
26
  walk_item(aw).merge(
27
27
  chunks: aw.chunks || [],
28
- extra_inlined_parameters: aw.extra_inlined_parameters || []
28
+ extra_inlined_parameters: aw.extra_inlined_parameters || [],
29
+ has_free_text_parameter?: aw.children[:parameters].select(&:free_text?).count > 0,
30
+ has_datatable_parameter?: aw.children[:parameters].select(&:datatable?).count > 0
29
31
  )
30
32
  end
31
33
 
@@ -63,6 +65,10 @@ module Hiptest
63
65
  }
64
66
  end
65
67
 
68
+ def walk_actionwords(aws)
69
+ {}
70
+ end
71
+
66
72
  def walk_test(test)
67
73
  {
68
74
  has_description?: !test.children[:description].nil? && !test.children[:description].empty?,
@@ -1 +1,2 @@
1
+ require 'hiptest-publisher/renderer_addons/behave_addon'
1
2
  require 'hiptest-publisher/renderer_addons/groovy_spock_addon'
@@ -0,0 +1,23 @@
1
+ require 'hiptest-publisher/nodes'
2
+
3
+ module Hiptest
4
+ module BehaveAddon
5
+ def walk_actionwords(aws)
6
+ base = super(aws)
7
+ sorted_aws = aws.children[:actionwords]
8
+ .sort_by {|aw|
9
+ pattern = aw.children.fetch(:gherkin_pattern, "")
10
+ [pattern.length, pattern]
11
+ }.reverse
12
+
13
+ @rendered_children[:sorted_actionwords] = sorted_aws.map {|aw| @rendered[aw]}
14
+ return base
15
+ end
16
+
17
+ private
18
+
19
+ def get_pattern(aw)
20
+ name = aw.children["name"]
21
+ end
22
+ end
23
+ end
@@ -2,7 +2,6 @@ require 'hiptest-publisher/nodes'
2
2
 
3
3
  module Hiptest
4
4
  module GroovySpockAddon
5
-
6
5
  def walk_call(call)
7
6
  base = super(call)
8
7
  base[:use_expect_annotation] = needs_fixing?(call)
@@ -7,6 +7,6 @@ from behave import *
7
7
  # context.actionwords = Actionwords()
8
8
 
9
9
  use_step_matcher('re')
10
- {{#each rendered_children.actionwords}}
10
+ {{#each rendered_children.sorted_actionwords}}
11
11
  {{{this}}}
12
12
  {{/each}}
@@ -5,7 +5,7 @@
5
5
  {{/if}}{{#each rendered_children.body}}{{{ this }}}
6
6
  {{/each}}
7
7
  Examples:{{#indent}}
8
- | {{ join rendered_children.parameters ' | ' }} |{{#if context.uids}} hiptest-uid |{{/if}}
8
+ {{#if context.with_dataset_names}}| dataset name {{/if}}| {{ join rendered_children.parameters ' | ' }} |{{#if context.uids}} hiptest-uid |{{/if}}
9
9
  {{{rendered_children.datatable}}}
10
10
  {{/indent}}{{/indent}}
11
11
  {{else}}
@@ -1 +1 @@
1
- | {{{ join_gherkin_dataset rendered_children.arguments }}} |{{#if context.uids}} {{#if rendered_children.test_snapshot_uid}}uid:{{{rendered_children.test_snapshot_uid}}}{{/if}} |{{/if}}
1
+ {{#if context.with_dataset_names}}| {{rendered_children.name}} {{/if}}| {{{ join_gherkin_dataset rendered_children.arguments }}} |{{#if context.uids}} {{#if rendered_children.test_snapshot_uid}}uid:{{{rendered_children.test_snapshot_uid}}}{{/if}} |{{/if}}
@@ -0,0 +1,9 @@
1
+ Scenario: {{{ rendered_children.name }}}{{#if context.uids}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}{{/if}}
2
+ {{#if has_tags?}}Meta:
3
+ {{join rendered_children.tags ' '}}
4
+ {{/if}}{{#if has_description?}}{{#comment '#'}}{{rendered_children.description}}{{/comment}}
5
+ {{/if}}{{#each rendered_children.body}}{{{ this }}}
6
+ {{/each}}{{#if has_datasets?}}
7
+ Examples:
8
+ {{#if context.with_dataset_names}}| dataset name {{/if}}| {{ join rendered_children.parameters ' | ' }} |{{#if context.uids}} hiptest-uid |{{/if}}
9
+ {{{rendered_children.datatable}}}{{/if}}
@@ -0,0 +1 @@
1
+ {{#if is_datatable?}}ExamplesTable{{else}}{{#if is_bool?}}boolean{{else}}{{{ node.type }}}{{/if}}{{/if}} {{{ camelize_lower rendered_children.name }}}
@@ -0,0 +1,5 @@
1
+ {{> gherkin_text}}{{#if rendered_children.free_text_arg}}
2
+ """
3
+ {{remove_surrounding_quotes rendered_children.free_text_arg }}
4
+ """{{/if}}{{#if rendered_children.datatable_arg}}
5
+ {{remove_surrounding_quotes rendered_children.datatable_arg }}{{/if}}
@@ -0,0 +1,14 @@
1
+ {{{ rendered_children.name }}}
2
+ {{#if rendered_children.ancestor_tags}}Meta:
3
+ {{rendered_children.ancestor_tags}}{{/if}}{{#if has_tags?}}{{#if rendered_children.ancestor_tags}} {{else}}Meta:
4
+ {{/if}}{{join rendered_children.tags " "}}
5
+ {{/if}}{{#if rendered_children.description}}
6
+ Narrative:
7
+ {{rendered_children.description}}{{/if}}
8
+ {{#unless is_empty?}}
9
+ Lifecycle:
10
+ Before:
11
+ Scope: SCENARIO
12
+ {{#each rendered_children.body}}{{{ this }}}
13
+ {{/each}}{{/unless}}{{#each rendered_children.scenarios}}
14
+ {{{this}}}{{/each}}
@@ -0,0 +1,3 @@
1
+ Scenario: {{{ rendered_children.name }}}
2
+ {{#each rendered_children.body}}{{{ this }}}
3
+ {{/each}}
@@ -0,0 +1 @@
1
+ {{#strip}}{{#join chunks '"'}}{{#if this.is_parameter}}${{this.name}}{{else}}{{this.value}}{{/if}}{{/join}}{{#each extra_inlined_parameters}} "${{this.name}}"{{/each}}{{/strip}}{{#if has_free_text_parameter?}} """$freeText"""{{/if}}{{#if has_datatable_parameter?}} $datatable{{/if}}
@@ -0,0 +1,6 @@
1
+ {{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{#escape_backslashes_and_double_quotes}}{{> gherkin_pattern}}{{/escape_backslashes_and_double_quotes}}")
2
+ public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.parameters_ordered_by_pattern ', '}}}) {{#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,18 @@
1
+ package {{{ context.package }}};
2
+
3
+ import org.jbehave.core.annotations.*;
4
+ import org.jbehave.core.model.ExamplesTable;
5
+
6
+ public class StepDefinitions {{#curly}}{{#indent}}
7
+ public Actionwords {{{ context.call_prefix }}};
8
+
9
+ @BeforeScenario
10
+ public void beforeEachScenario() {{#curly}}{{#indent}}
11
+ actionwords = new Actionwords();
12
+ {{/indent}}
13
+ {{/curly}}
14
+
15
+ {{#each rendered_children.actionwords}}{{{this}}}
16
+ {{/each}}
17
+ {{/indent}}
18
+ {{/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.11.1
4
+ version: 1.12.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-04-18 00:00:00.000000000 Z
11
+ date: 2018-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -239,6 +239,7 @@ files:
239
239
  - lib/config/javascript-mocha.conf
240
240
  - lib/config/javascript-protractor.conf
241
241
  - lib/config/javascript-qunit.conf
242
+ - lib/config/jbehave.conf
242
243
  - lib/config/php-phpunit.conf
243
244
  - lib/config/python-unittest.conf
244
245
  - lib/config/robotframework.conf
@@ -268,6 +269,7 @@ files:
268
269
  - lib/hiptest-publisher/render_context_maker.rb
269
270
  - lib/hiptest-publisher/renderer.rb
270
271
  - lib/hiptest-publisher/renderer_addons.rb
272
+ - lib/hiptest-publisher/renderer_addons/behave_addon.rb
271
273
  - lib/hiptest-publisher/renderer_addons/groovy_spock_addon.rb
272
274
  - lib/hiptest-publisher/signature_differ.rb
273
275
  - lib/hiptest-publisher/signature_exporter.rb
@@ -467,6 +469,14 @@ files:
467
469
  - lib/templates/javascript/test.hbs
468
470
  - lib/templates/javascript/tests.hbs
469
471
  - lib/templates/javascript/while.hbs
472
+ - lib/templates/jbehave/_scenario.hbs
473
+ - lib/templates/jbehave/actionwords/parameter.hbs
474
+ - lib/templates/jbehave/call.hbs
475
+ - lib/templates/jbehave/folder.hbs
476
+ - lib/templates/jbehave/single_test.hbs
477
+ - lib/templates/jbehave/steps/_gherkin_pattern.hbs
478
+ - lib/templates/jbehave/steps/actionword.hbs
479
+ - lib/templates/jbehave/steps/actionwords.hbs
470
480
  - lib/templates/php/_body.hbs
471
481
  - lib/templates/php/_item_as_function.hbs
472
482
  - lib/templates/php/_scenario.hbs
@@ -630,7 +640,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
630
640
  version: '0'
631
641
  requirements: []
632
642
  rubyforge_project:
633
- rubygems_version: 2.6.14
643
+ rubygems_version: 2.7.6
634
644
  signing_key:
635
645
  specification_version: 4
636
646
  summary: Export your tests from Hiptest into executable tests.