hiptest-publisher 0.7.5 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/php-phpunit.conf +13 -0
- data/lib/hiptest-publisher/nodes.rb +3 -2
- data/lib/hiptest-publisher/options_parser.rb +1 -0
- data/lib/hiptest-publisher/render_context_maker.rb +6 -0
- data/lib/hiptest-publisher/utils.rb +12 -4
- data/lib/hiptest-publisher/xml_parser.rb +2 -1
- data/lib/templates/gherkin/folder.hbs +2 -1
- data/lib/templates/gherkin/single_scenario.hbs +4 -2
- data/lib/templates/gherkin/tag.hbs +1 -0
- data/lib/templates/php/_body.hbs +8 -0
- data/lib/templates/php/_item_as_function.hbs +3 -0
- data/lib/templates/php/_scenario.hbs +4 -0
- data/lib/templates/php/_setup.hbs +4 -0
- data/lib/templates/php/actionword.hbs +1 -0
- data/lib/templates/php/actionwords.hbs +7 -0
- data/lib/templates/php/argument.hbs +1 -0
- data/lib/templates/php/assign.hbs +1 -0
- data/lib/templates/php/binaryexpression.hbs +1 -0
- data/lib/templates/php/call.hbs +2 -0
- data/lib/templates/php/dataset.hbs +3 -0
- data/lib/templates/php/dict.hbs +1 -0
- data/lib/templates/php/field.hbs +1 -0
- data/lib/templates/php/ifthen.hbs +7 -0
- data/lib/templates/php/index.hbs +1 -0
- data/lib/templates/php/list.hbs +1 -0
- data/lib/templates/php/nullliteral.hbs +1 -0
- data/lib/templates/php/parameter.hbs +1 -0
- data/lib/templates/php/parenthesis.hbs +1 -0
- data/lib/templates/php/project.hbs +2 -0
- data/lib/templates/php/property.hbs +1 -0
- data/lib/templates/php/scenario.hbs +1 -0
- data/lib/templates/php/scenarios.hbs +13 -0
- data/lib/templates/php/single_scenario.hbs +11 -0
- data/lib/templates/php/single_test.hbs +11 -0
- data/lib/templates/php/step.hbs +1 -0
- data/lib/templates/php/tag.hbs +1 -0
- data/lib/templates/php/template.hbs +1 -0
- data/lib/templates/php/test.hbs +1 -0
- data/lib/templates/php/tests.hbs +13 -0
- data/lib/templates/php/unaryexpression.hbs +1 -0
- data/lib/templates/php/variable.hbs +1 -0
- data/lib/templates/php/while.hbs +5 -0
- metadata +37 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b5193a63f746ddb72f900a01da80c1de637a509
|
4
|
+
data.tar.gz: d8ab11b68757655d3d1e75c8856a548ec3d16d57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2654e4cacaf2f522d6ebcb398cd29bfd13cec77af449813e2e251b25969b290c1a232e988d2824b2c490e479c2ac9de36305a9676e5f7cbcbdbdf89c36f0432
|
7
|
+
data.tar.gz: f09e6c6711584c09ec95eab129f01662809cfcb324134d9c029d7928b976a66053ebd1f2f46844c04ec7fd9d3565fa4c9e93db389cfa94691f8b45023e753ff7
|
@@ -0,0 +1,13 @@
|
|
1
|
+
[_common]
|
2
|
+
template_dirs = php, common
|
3
|
+
indentation = " "
|
4
|
+
|
5
|
+
[tests]
|
6
|
+
filename = 'TestProject.php'
|
7
|
+
scenario_filename = 'Test_%s.php'
|
8
|
+
call_prefix = '$this->actionwords'
|
9
|
+
|
10
|
+
[actionwords]
|
11
|
+
filename = 'Actionwords.php'
|
12
|
+
naming_convention = 'camel_case'
|
13
|
+
call_prefix = '$this'
|
@@ -384,7 +384,7 @@ module Hiptest
|
|
384
384
|
class Folder < Node
|
385
385
|
attr_reader :uid, :parent_uid
|
386
386
|
|
387
|
-
def initialize(uid, parent_uid, name, description)
|
387
|
+
def initialize(uid, parent_uid, name, description, tags = [])
|
388
388
|
super()
|
389
389
|
|
390
390
|
@uid = uid
|
@@ -394,7 +394,8 @@ module Hiptest
|
|
394
394
|
:name => name,
|
395
395
|
:description => description,
|
396
396
|
:subfolders => [],
|
397
|
-
:scenarios => []
|
397
|
+
:scenarios => [],
|
398
|
+
:tags => tags
|
398
399
|
}
|
399
400
|
end
|
400
401
|
|
@@ -1,6 +1,7 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
require 'io/console'
|
1
3
|
require 'open-uri'
|
2
4
|
require 'openssl'
|
3
|
-
require 'colorize'
|
4
5
|
require 'net/http/post/multipart'
|
5
6
|
|
6
7
|
def hiptest_publisher_path
|
@@ -16,7 +17,7 @@ rescue
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def pluralize_word(count, singular, plural=nil)
|
19
|
-
|
20
|
+
if count == 1
|
20
21
|
singular
|
21
22
|
else
|
22
23
|
"#{singular}s"
|
@@ -61,7 +62,6 @@ end
|
|
61
62
|
|
62
63
|
def show_status_message(message, status=nil)
|
63
64
|
status_icon = " "
|
64
|
-
line_end = status.nil? ? "" : "\n"
|
65
65
|
output = STDOUT
|
66
66
|
|
67
67
|
if status == :success
|
@@ -70,8 +70,16 @@ def show_status_message(message, status=nil)
|
|
70
70
|
status_icon = "x".red
|
71
71
|
output = STDERR
|
72
72
|
end
|
73
|
+
if status
|
74
|
+
cursor_offset = ""
|
75
|
+
else
|
76
|
+
return unless $stdout.tty?
|
77
|
+
rows, columns = IO.console.winsize
|
78
|
+
vertical_offset = (4 + message.length) / columns
|
79
|
+
cursor_offset = "\r\e[#{vertical_offset + 1}A"
|
80
|
+
end
|
73
81
|
|
74
|
-
output.print "[#{status_icon}] #{message}
|
82
|
+
output.print "[#{status_icon}] #{message}#{cursor_offset}\n"
|
75
83
|
end
|
76
84
|
|
77
85
|
def with_status_message(message, &blk)
|
@@ -272,7 +272,8 @@ module Hiptest
|
|
272
272
|
css_first_content(folder, 'uid'),
|
273
273
|
css_first_content(folder, 'parentUid'),
|
274
274
|
css_first_content(folder, 'name'),
|
275
|
-
css_first_content(folder, 'description')
|
275
|
+
css_first_content(folder, 'description'),
|
276
|
+
build_tags(folder))
|
276
277
|
end
|
277
278
|
alias :build_folderSnapshot :build_folder
|
278
279
|
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
{{#if has_tags?}}{{join rendered_children.tags ' '}}
|
2
|
+
{{/if}}Feature: {{{ rendered_children.name }}}{{#indent}}
|
2
3
|
{{#if rendered_children.description}}{{#indent}}{{rendered_children.description}}{{/indent}}{{/if}}
|
3
4
|
{{#each rendered_children.scenarios}}{{{this}}}{{/each}}
|
4
5
|
{{/indent}}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
{{#if has_datasets?}}
|
2
|
-
|
2
|
+
{{#if has_tags?}}{{join rendered_children.tags ' '}}
|
3
|
+
{{/if}}Scenario Outline: {{{ rendered_children.name }}}{{#indent}}
|
3
4
|
{{#each rendered_children.body}}{{{ this }}}
|
4
5
|
{{/each}}
|
5
6
|
Examples:{{#indent}}
|
@@ -7,7 +8,8 @@ Examples:{{#indent}}
|
|
7
8
|
{{{rendered_children.datatable}}}
|
8
9
|
{{/indent}}{{/indent}}
|
9
10
|
{{else}}
|
10
|
-
|
11
|
+
{{#if has_tags?}}{{join rendered_children.tags ' '}}
|
12
|
+
{{/if}}Scenario: {{{ rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}{{#indent}}
|
11
13
|
{{#each rendered_children.body}}{{{ this }}}
|
12
14
|
{{/each}}
|
13
15
|
{{/indent}}
|
@@ -0,0 +1 @@
|
|
1
|
+
@{{{ rendered_children.key }}}{{#if has_value? }}:{{{ rendered_children.value }}}{{/if}}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{{#clear_empty_lines}}
|
2
|
+
{{#indent}}
|
3
|
+
{{#comment '//'}}{{{ rendered_children.description }}}{{/comment}}
|
4
|
+
{{#if has_tags?}}// Tags: {{{ join rendered_children.tags ' '}}}{{/if}}
|
5
|
+
{{#each rendered_children.body}}{{{this}}}
|
6
|
+
{{/each}}{{#if has_step?}}
|
7
|
+
throw new Exception('Not implemented');{{/if}}{{/indent}}
|
8
|
+
{{/clear_empty_lines}}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
{{#if has_datasets?}}{{> item_as_function}}
|
2
|
+
{{{ rendered_children.datatable }}}{{else}}public function test{{{ camelize_upper rendered_children.name }}}{{#if rendered_children.uid}}Uid{{{camelize_upper rendered_children.uid}}}{{/if}}() {{#curly}}
|
3
|
+
{{> body}}
|
4
|
+
{{/curly}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> item_as_function }}
|
@@ -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,3 @@
|
|
1
|
+
public function test{{camelize_upper scenario_name}}{{{camelize_upper rendered_children.name}}}{{#if rendered_children.uid}}Uid{{{camelize_upper rendered_children.uid}}}{{/if}}() {{#curly}}
|
2
|
+
$this->{{{ camelize_lower scenario_name }}}({{{ join rendered_children.arguments ', ' }}});
|
3
|
+
{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#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}}}{{/each}}
|
3
|
+
{{/indent}}
|
4
|
+
{{#if has_else?}}{{close_curly}} else {{open_curly}}
|
5
|
+
{{#indent}}{{#each rendered_children.else}}{{{this}}}{{/each}}
|
6
|
+
{{/indent}}
|
7
|
+
{{/if}}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}[{{{ rendered_children.expression }}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
[{{{ join rendered_children.items ', '}}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
NULL
|
@@ -0,0 +1 @@
|
|
1
|
+
${{{ underscore rendered_children.name }}}{{#if has_default_value?}} = {{{ rendered_children.default }}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
({{{ rendered_children.content }}})
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.key }}} => {{{ rendered_children.value }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?php
|
2
|
+
require_once('Actionwords.php');
|
3
|
+
|
4
|
+
class {{{ camelize_upper project_name }}}Test extends PHPUnit_Framework_TestCase {{#curly}}{{#indent}}
|
5
|
+
public $actionwords;
|
6
|
+
{{> setup}}
|
7
|
+
|
8
|
+
{{#each rendered_children.scenarios}}{{this}}
|
9
|
+
|
10
|
+
{{/each}}
|
11
|
+
{{/indent}}
|
12
|
+
{{/curly}}
|
13
|
+
?>
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#comment '//'}}TODO: Implement {{{rendered_children.key}}}: {{{rendered_children.value}}}{{/comment}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.key }}}{{#if has_value?}}:{{{rendered_children.value}}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
"{{#each treated_chunks}}{{#if this.is_variable?}}{{#curly}}${{{camelize_lower this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}"
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?php
|
2
|
+
require_once('Actionwords.php');
|
3
|
+
|
4
|
+
class {{{ camelize_upper project_name }}}Test extends PHPUnit_Framework_TestCase {{#curly}}{{#indent}}
|
5
|
+
public $actionwords;
|
6
|
+
{{> setup}}
|
7
|
+
|
8
|
+
{{#each rendered_children.tests}}{{{this}}}
|
9
|
+
|
10
|
+
{{/each}}
|
11
|
+
{{/indent}}
|
12
|
+
{{/curly}}
|
13
|
+
?>
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.operator }}}{{{ rendered_children.expression }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
${{ underscore rendered_children.name }}
|
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.
|
4
|
+
version: 0.8.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-12-
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -246,6 +246,7 @@ files:
|
|
246
246
|
- lib/config/java-testng.conf
|
247
247
|
- lib/config/javascript-jasmine.conf
|
248
248
|
- lib/config/javascript-qunit.conf
|
249
|
+
- lib/config/php-phpunit.conf
|
249
250
|
- lib/config/python-unittest.conf
|
250
251
|
- lib/config/robotframework.conf
|
251
252
|
- lib/config/ruby-minitest.conf
|
@@ -330,6 +331,7 @@ files:
|
|
330
331
|
- lib/templates/gherkin/single_test.hbs
|
331
332
|
- lib/templates/gherkin/step.hbs
|
332
333
|
- lib/templates/gherkin/stringliteral.hbs
|
334
|
+
- lib/templates/gherkin/tag.hbs
|
333
335
|
- lib/templates/gherkin/template.hbs
|
334
336
|
- lib/templates/java/_body.hbs
|
335
337
|
- lib/templates/java/_item_as_function.hbs
|
@@ -409,6 +411,39 @@ files:
|
|
409
411
|
- lib/templates/javascript/tests.hbs
|
410
412
|
- lib/templates/javascript/unaryexpression.hbs
|
411
413
|
- lib/templates/javascript/while.hbs
|
414
|
+
- lib/templates/php/_body.hbs
|
415
|
+
- lib/templates/php/_item_as_function.hbs
|
416
|
+
- lib/templates/php/_scenario.hbs
|
417
|
+
- lib/templates/php/_setup.hbs
|
418
|
+
- lib/templates/php/actionword.hbs
|
419
|
+
- lib/templates/php/actionwords.hbs
|
420
|
+
- lib/templates/php/argument.hbs
|
421
|
+
- lib/templates/php/assign.hbs
|
422
|
+
- lib/templates/php/binaryexpression.hbs
|
423
|
+
- lib/templates/php/call.hbs
|
424
|
+
- lib/templates/php/dataset.hbs
|
425
|
+
- lib/templates/php/dict.hbs
|
426
|
+
- lib/templates/php/field.hbs
|
427
|
+
- lib/templates/php/ifthen.hbs
|
428
|
+
- lib/templates/php/index.hbs
|
429
|
+
- lib/templates/php/list.hbs
|
430
|
+
- lib/templates/php/nullliteral.hbs
|
431
|
+
- lib/templates/php/parameter.hbs
|
432
|
+
- lib/templates/php/parenthesis.hbs
|
433
|
+
- lib/templates/php/project.hbs
|
434
|
+
- lib/templates/php/property.hbs
|
435
|
+
- lib/templates/php/scenario.hbs
|
436
|
+
- lib/templates/php/scenarios.hbs
|
437
|
+
- lib/templates/php/single_scenario.hbs
|
438
|
+
- lib/templates/php/single_test.hbs
|
439
|
+
- lib/templates/php/step.hbs
|
440
|
+
- lib/templates/php/tag.hbs
|
441
|
+
- lib/templates/php/template.hbs
|
442
|
+
- lib/templates/php/test.hbs
|
443
|
+
- lib/templates/php/tests.hbs
|
444
|
+
- lib/templates/php/unaryexpression.hbs
|
445
|
+
- lib/templates/php/variable.hbs
|
446
|
+
- lib/templates/php/while.hbs
|
412
447
|
- lib/templates/python/_body.hbs
|
413
448
|
- lib/templates/python/_item_as_def.hbs
|
414
449
|
- lib/templates/python/_parameters.hbs
|