hiptest-publisher 0.9.10 → 0.10.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: 449fc0a2a85042a5a223dae37cb318801c1162dd
4
- data.tar.gz: 8b6c27a2f40ae364065661818aaebedc61fe0bec
3
+ metadata.gz: e2557080821316b37b07952f6e188ba212447b9c
4
+ data.tar.gz: 1370776bc7631858d96cfefc309189a9c2e9ea40
5
5
  SHA512:
6
- metadata.gz: a9c93a249cf80f42db7ee1f4556c3a17ae743af69ed1ef617ac967e2fef8fe9758bc45875a902da0f60cbab202ef5ca7231230830576ab2ee0a1eda3975af7ce
7
- data.tar.gz: cfe9878afa02f73d00d84f5a32fb80dea93b7fb560645d92fca2a3d8f65c2402c0953cb1e37ee7a7954bf19a7dc5fcaaa0023816c0df0170384d181611975c0b
6
+ metadata.gz: 0062913fceeb60b6589c6a2236425318a15ff0112215c9597cdaf4af966806115a854563864a1a5a42c1735749489fea19c23c3273ea36a75e975c2d69d817ed
7
+ data.tar.gz: 84eacad9db2fb793c52fb7ca78cb217e4acb0523a9f9352bd04480de5815b3d0caf59504aeff5a08d7b8df1160a276ba3a36f86d674977cbb4460b793558c56f
data/README.md CHANGED
@@ -143,6 +143,8 @@ You can push multiple files at once (using wildcard) but in that case, do not fo
143
143
 
144
144
  hiptest-publisher --config-file=<path to your config file> --push="reports/*.xml"
145
145
 
146
+ The number of imported test results will be displayed. For debugging purposes, you can display imported tests individually with the `--verbose` option.
147
+
146
148
  Development
147
149
  -----------
148
150
 
@@ -0,0 +1,24 @@
1
+ [_common]
2
+ indentation = ' '
3
+ fallback_template = 'empty'
4
+
5
+ [features]
6
+ indentation = ' '
7
+ node_name = folders
8
+ template_dirs = gherkin, common
9
+ named_filename = '%s.feature'
10
+ filename_convention = 'underscore'
11
+
12
+ [step_definitions]
13
+ node_name = actionwords
14
+ template_dirs = behat, php, common
15
+ filename = 'FeatureContext.php'
16
+ naming_convention = 'camelize'
17
+ call_prefix = 'self.actionwords'
18
+
19
+ [actionwords]
20
+ template_dirs = php, common
21
+ filename = 'Actionwords.php'
22
+ naming_convention = 'camel_case'
23
+ call_prefix = '$this'
24
+
@@ -0,0 +1,22 @@
1
+ [_common]
2
+ indentation = ' '
3
+ fallback_template = 'empty'
4
+
5
+ [features]
6
+ indentation = ' '
7
+ node_name = folders
8
+ template_dirs = gherkin, common
9
+ named_filename = '%s.feature'
10
+ filename_convention = 'underscore'
11
+
12
+ [step_definitions]
13
+ node_name = actionwords
14
+ template_dirs = behave, python, common
15
+ filename = 'steps.py'
16
+ naming_convention = 'underscore'
17
+ call_prefix = 'self.actionwords'
18
+
19
+ [actionwords]
20
+ template_dirs = python, common
21
+ filename = 'actionwords.py'
22
+ naming_convention = 'underscore'
@@ -1,5 +1,5 @@
1
1
  [_common]
2
- template_dirs = python, common
2
+ template_dirs = python/unittest, python, common
3
3
  indentation = " "
4
4
 
5
5
  [tests]
@@ -6,7 +6,7 @@ fallback_template = 'empty'
6
6
  [features]
7
7
  indentation = ' '
8
8
  node_name = folders
9
- template_dirs = gherkin, gherkin, common
9
+ template_dirs = gherkin, common
10
10
  named_filename = '%s.feature'
11
11
  filename_convention = 'camelize_upper'
12
12
 
@@ -1,4 +1,5 @@
1
1
  require 'colorize'
2
+ require 'json'
2
3
  require 'yaml'
3
4
 
4
5
  require 'hiptest-publisher/formatters/reporter'
@@ -268,10 +269,11 @@ module Hiptest
268
269
  with_status_message "Posting #{@cli_options.push} to #{@cli_options.site}" do
269
270
  response = push_results(@cli_options)
270
271
  end
271
- with_status_message "#{JSON.parse(response.body)['test_import'].size} imported tests" do
272
+ passed_count = JSON.parse(response.body)['test_import'].size
273
+ with_status_message "#{pluralize(passed_count, "test")} imported" do
272
274
  if @cli_options.verbose
273
275
  JSON.parse(response.body)['test_import'].each do |imported_test|
274
- with_status_message "Test '#{imported_test['name']}' imported" do end
276
+ puts " Test '#{imported_test['name']}' imported"
275
277
  end
276
278
  end
277
279
  end
@@ -27,6 +27,7 @@ module Hiptest
27
27
 
28
28
  @annotations_counter.actionwords.each do |actionword|
29
29
  actionword.children[:gherkin_annotation] = @annotations_counter.most_used_annotation(actionword) || "Given"
30
+ actionword.children[:gherkin_used_annotations] = @annotations_counter.all_used_annotations(actionword) || ['Given']
30
31
  end
31
32
  end
32
33
 
@@ -159,5 +160,9 @@ module Hiptest
159
160
  max = @counts_by_actionword[actionword].values.max
160
161
  @counts_by_actionword[actionword].key(max)
161
162
  end
163
+
164
+ def all_used_annotations(actionword)
165
+ @counts_by_actionword[actionword].keys
166
+ end
162
167
  end
163
168
  end
@@ -153,6 +153,10 @@ module Hiptest
153
153
  name
154
154
  end
155
155
 
156
+ def hh_strip_regexp_delimiters(context, regexp, block)
157
+ return regexp.gsub(/(^\^)|(\$$)/, '')
158
+ end
159
+
156
160
  def hh_debug(context, block)
157
161
  require 'pry'
158
162
  binding.pry
@@ -135,7 +135,8 @@ class OptionsParser
135
135
  'Javascript' => ['qUnit', 'Jasmine', 'Mocha'],
136
136
  'CSharp' => ['NUnit'],
137
137
  'PHP' => ['PHPUnit'],
138
- 'SpecFlow' => ['']
138
+ 'SpecFlow' => [''],
139
+ 'Behave' => ['']
139
140
  }
140
141
  end
141
142
 
@@ -1,5 +1,4 @@
1
1
  require 'colorize'
2
- require 'json'
3
2
  require 'io/console'
4
3
  require 'open-uri'
5
4
  require 'openssl'
@@ -0,0 +1,8 @@
1
+ {{#if rendered_children.gherkin_annotation }}
2
+ /**
3
+ * @{{{ rendered_children.gherkin_annotation }}} /{{{ rendered_children.gherkin_pattern }}}/
4
+ */
5
+ public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.parameters ', '}}}{{/if}}){{#curly}}{{#indent}}
6
+ $this->actionwords->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}${{{underscore this}}}{{/join}}{{/if}});
7
+ {{/indent}}
8
+ {{/curly}}{{/if}}
@@ -0,0 +1,16 @@
1
+ <?php
2
+ use Behat\Behat\Tester\Exception\PendingException;
3
+ use Behat\Behat\Context\SnippetAcceptingContext;
4
+ use Behat\Gherkin\Node\PyStringNode;
5
+ use Behat\Gherkin\Node\TableNode;
6
+
7
+ require_once('Actionwords.php');
8
+
9
+ class FeatureContext implements SnippetAcceptingContext {{#curly}}{{#indent}}
10
+ public function __construct() {{#curly}}{{#indent}}
11
+ $this->actionwords = new Actionwords();{{/indent}}
12
+ {{/curly}}
13
+ {{#each rendered_children.actionwords}}
14
+ {{{this}}}{{/each}}{{/indent}}
15
+ {{/curly}}
16
+ ?>
@@ -0,0 +1,4 @@
1
+ {{#if rendered_children.gherkin_used_annotations}}
2
+ {{#each rendered_children.gherkin_used_annotations}}@{{{downcase this }}}(r'{{{ strip_regexp_delimiters rendered_children.gherkin_pattern }}}')
3
+ {{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.parameters ', '}}}{{/if}}):{{#indent}}
4
+ context.actionwords.{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{underscore this}}}{{/join}}{{/if}}){{/indent}}{{/if}}
@@ -0,0 +1,12 @@
1
+ from behave import *
2
+
3
+ # This should be added to environments.py
4
+ # from steps.actionwords import Actionwords
5
+ #
6
+ # def before_scenario(context, scenario):
7
+ # context.actionwords = Actionwords.new(nil)
8
+
9
+ use_step_matcher('re')
10
+ {{#each rendered_children.actionwords}}
11
+ {{{this}}}
12
+ {{/each}}
@@ -1,9 +1,9 @@
1
1
  # encoding: UTF-8
2
2
 
3
- class Actionwords:
4
- def __init__(self, test):
5
- self.test = test
6
- {{#indent}}
3
+ class Actionwords:{{#indent}}
4
+ def __init__(self):{{#indent}}
5
+ pass{{/indent}}
6
+
7
7
  {{#each rendered_children.actionwords}}{{{this}}}
8
8
  {{/each}}
9
9
  {{/indent}}
@@ -0,0 +1,9 @@
1
+ # encoding: UTF-8
2
+
3
+ class Actionwords:{{#indent}}
4
+ def __init__(self, test):{{#indent}}
5
+ self.test = test{{/indent}}
6
+
7
+ {{#each rendered_children.actionwords}}{{{this}}}
8
+ {{/each}}
9
+ {{/indent}}
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.9.10
4
+ version: 0.10.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: 2016-02-10 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -239,6 +239,8 @@ extra_rdoc_files:
239
239
  files:
240
240
  - README.md
241
241
  - bin/hiptest-publisher
242
+ - lib/config/behat.conf
243
+ - lib/config/behave.conf
242
244
  - lib/config/csharp-nunit.conf
243
245
  - lib/config/cucumber-java.conf
244
246
  - lib/config/cucumber-ruby.conf
@@ -276,6 +278,10 @@ files:
276
278
  - lib/hiptest-publisher/string.rb
277
279
  - lib/hiptest-publisher/utils.rb
278
280
  - lib/hiptest-publisher/xml_parser.rb
281
+ - lib/templates/behat/actionword.hbs
282
+ - lib/templates/behat/actionwords.hbs
283
+ - lib/templates/behave/actionword.hbs
284
+ - lib/templates/behave/actionwords.hbs
279
285
  - lib/templates/common/booleanliteral.hbs
280
286
  - lib/templates/common/dataset.hbs
281
287
  - lib/templates/common/datatable.hbs
@@ -486,6 +492,7 @@ files:
486
492
  - lib/templates/python/test.hbs
487
493
  - lib/templates/python/tests.hbs
488
494
  - lib/templates/python/unaryexpression.hbs
495
+ - lib/templates/python/unittest/actionwords.hbs
489
496
  - lib/templates/python/while.hbs
490
497
  - lib/templates/robotframework/_keyword.hbs
491
498
  - lib/templates/robotframework/_keyword_body.hbs