hiptest-publisher 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +98 -0
- data/bin/hiptest-publisher +11 -0
- data/lib/hiptest-publisher.rb +121 -0
- data/lib/hiptest-publisher/call_arguments_adder.rb +63 -0
- data/lib/hiptest-publisher/handlebars_helper.rb +97 -0
- data/lib/hiptest-publisher/nodes.rb +380 -0
- data/lib/hiptest-publisher/nodes_walker.rb +45 -0
- data/lib/hiptest-publisher/options_parser.rb +225 -0
- data/lib/hiptest-publisher/parameter_type_adder.rb +139 -0
- data/lib/hiptest-publisher/parent_adder.rb +18 -0
- data/lib/hiptest-publisher/render_context_maker.rb +92 -0
- data/lib/hiptest-publisher/renderer.rb +87 -0
- data/lib/hiptest-publisher/string.rb +52 -0
- data/lib/hiptest-publisher/utils.rb +47 -0
- data/lib/hiptest-publisher/xml_parser.rb +294 -0
- data/lib/templates/common/booleanliteral.hbs +1 -0
- data/lib/templates/common/dataset.hbs +0 -0
- data/lib/templates/common/datatable.hbs +3 -0
- data/lib/templates/common/nullliteral.hbs +1 -0
- data/lib/templates/common/numericliteral.hbs +1 -0
- data/lib/templates/common/stringliteral.hbs +1 -0
- data/lib/templates/common/variable.hbs +1 -0
- data/lib/templates/java/_body.hbs +5 -0
- data/lib/templates/java/_item_as_function.hbs +6 -0
- data/lib/templates/java/_scenario.hbs +7 -0
- data/lib/templates/java/actionword.hbs +1 -0
- data/lib/templates/java/actionwords.hbs +8 -0
- data/lib/templates/java/argument.hbs +1 -0
- data/lib/templates/java/assign.hbs +1 -0
- data/lib/templates/java/binaryexpression.hbs +1 -0
- data/lib/templates/java/call.hbs +1 -0
- data/lib/templates/java/dataset.hbs +3 -0
- data/lib/templates/java/dict.hbs +1 -0
- data/lib/templates/java/field.hbs +1 -0
- data/lib/templates/java/ifthen.hbs +7 -0
- data/lib/templates/java/index.hbs +1 -0
- data/lib/templates/java/list.hbs +1 -0
- data/lib/templates/java/nullliteral.hbs +1 -0
- data/lib/templates/java/output_config +11 -0
- data/lib/templates/java/parameter.hbs +1 -0
- data/lib/templates/java/parenthesis.hbs +1 -0
- data/lib/templates/java/property.hbs +1 -0
- data/lib/templates/java/scenario.hbs +1 -0
- data/lib/templates/java/scenarios.hbs +11 -0
- data/lib/templates/java/single_scenario.hbs +11 -0
- data/lib/templates/java/single_test.hbs +11 -0
- data/lib/templates/java/step.hbs +1 -0
- data/lib/templates/java/stringliteral.hbs +1 -0
- data/lib/templates/java/tag.hbs +1 -0
- data/lib/templates/java/template.hbs +1 -0
- data/lib/templates/java/test.hbs +1 -0
- data/lib/templates/java/testng/_scenario.hbs +8 -0
- data/lib/templates/java/testng/dataset.hbs +4 -0
- data/lib/templates/java/testng/scenarios.hbs +16 -0
- data/lib/templates/java/testng/single_scenario.hbs +11 -0
- data/lib/templates/java/testng/single_test.hbs +11 -0
- data/lib/templates/java/testng/tests.hbs +16 -0
- data/lib/templates/java/tests.hbs +11 -0
- data/lib/templates/java/unaryexpression.hbs +1 -0
- data/lib/templates/java/variable.hbs +1 -0
- data/lib/templates/java/while.hbs +4 -0
- data/lib/templates/python/_body.hbs +10 -0
- data/lib/templates/python/_item_as_def.hbs +2 -0
- data/lib/templates/python/_parameters.hbs +1 -0
- data/lib/templates/python/_scenario.hbs +4 -0
- data/lib/templates/python/actionword.hbs +1 -0
- data/lib/templates/python/actionwords.hbs +9 -0
- data/lib/templates/python/argument.hbs +1 -0
- data/lib/templates/python/assign.hbs +1 -0
- data/lib/templates/python/binaryexpression.hbs +1 -0
- data/lib/templates/python/call.hbs +1 -0
- data/lib/templates/python/dataset.hbs +2 -0
- data/lib/templates/python/dict.hbs +1 -0
- data/lib/templates/python/field.hbs +1 -0
- data/lib/templates/python/ifthen.hbs +4 -0
- data/lib/templates/python/index.hbs +1 -0
- data/lib/templates/python/list.hbs +1 -0
- data/lib/templates/python/nullliteral.hbs +1 -0
- data/lib/templates/python/output_config +9 -0
- data/lib/templates/python/parameter.hbs +1 -0
- data/lib/templates/python/parenthesis.hbs +1 -0
- data/lib/templates/python/project.hbs +2 -0
- data/lib/templates/python/property.hbs +1 -0
- data/lib/templates/python/scenario.hbs +1 -0
- data/lib/templates/python/scenarios.hbs +11 -0
- data/lib/templates/python/single_scenario.hbs +9 -0
- data/lib/templates/python/single_test.hbs +9 -0
- data/lib/templates/python/step.hbs +1 -0
- data/lib/templates/python/tag.hbs +1 -0
- data/lib/templates/python/template.hbs +1 -0
- data/lib/templates/python/test.hbs +1 -0
- data/lib/templates/python/tests.hbs +11 -0
- data/lib/templates/python/unaryexpression.hbs +1 -0
- data/lib/templates/python/while.hbs +4 -0
- data/lib/templates/robotframework/_keyword.hbs +4 -0
- data/lib/templates/robotframework/_scenario.hbs +11 -0
- data/lib/templates/robotframework/actionword.hbs +1 -0
- data/lib/templates/robotframework/actionwords.hbs +4 -0
- data/lib/templates/robotframework/argument.hbs +1 -0
- data/lib/templates/robotframework/assign.hbs +1 -0
- data/lib/templates/robotframework/binaryexpression.hbs +1 -0
- data/lib/templates/robotframework/call.hbs +1 -0
- data/lib/templates/robotframework/dataset.hbs +1 -0
- data/lib/templates/robotframework/datatable.hbs +2 -0
- data/lib/templates/robotframework/dict.hbs +1 -0
- data/lib/templates/robotframework/field.hbs +1 -0
- data/lib/templates/robotframework/ifthen.hbs +1 -0
- data/lib/templates/robotframework/index.hbs +1 -0
- data/lib/templates/robotframework/list.hbs +1 -0
- data/lib/templates/robotframework/nullliteral.hbs +1 -0
- data/lib/templates/robotframework/output_config +8 -0
- data/lib/templates/robotframework/parameter.hbs +1 -0
- data/lib/templates/robotframework/parenthesis.hbs +1 -0
- data/lib/templates/robotframework/project.hbs +2 -0
- data/lib/templates/robotframework/property.hbs +1 -0
- data/lib/templates/robotframework/scenario.hbs +1 -0
- data/lib/templates/robotframework/scenarios.hbs +1 -0
- data/lib/templates/robotframework/single_scenario.hbs +11 -0
- data/lib/templates/robotframework/single_test.hbs +11 -0
- data/lib/templates/robotframework/step.hbs +1 -0
- data/lib/templates/robotframework/stringliteral.hbs +1 -0
- data/lib/templates/robotframework/tag.hbs +1 -0
- data/lib/templates/robotframework/template.hbs +1 -0
- data/lib/templates/robotframework/test.hbs +1 -0
- data/lib/templates/robotframework/tests.hbs +1 -0
- data/lib/templates/robotframework/unaryexpression.hbs +1 -0
- data/lib/templates/robotframework/variable.hbs +1 -0
- data/lib/templates/robotframework/while.hbs +1 -0
- data/lib/templates/ruby/_body.hbs +9 -0
- data/lib/templates/ruby/_item_as_def.hbs +3 -0
- data/lib/templates/ruby/_scenario.hbs +5 -0
- data/lib/templates/ruby/actionword.hbs +1 -0
- data/lib/templates/ruby/actionwords.hbs +6 -0
- data/lib/templates/ruby/argument.hbs +1 -0
- data/lib/templates/ruby/assign.hbs +1 -0
- data/lib/templates/ruby/binaryexpression.hbs +1 -0
- data/lib/templates/ruby/call.hbs +1 -0
- data/lib/templates/ruby/dataset.hbs +3 -0
- data/lib/templates/ruby/dict.hbs +1 -0
- data/lib/templates/ruby/field.hbs +1 -0
- data/lib/templates/ruby/ifthen.hbs +7 -0
- data/lib/templates/ruby/index.hbs +1 -0
- data/lib/templates/ruby/list.hbs +1 -0
- data/lib/templates/ruby/minitest/_item_as_def.hbs +3 -0
- data/lib/templates/ruby/minitest/_scenario.hbs +4 -0
- data/lib/templates/ruby/minitest/dataset.hbs +3 -0
- data/lib/templates/ruby/minitest/output_config +6 -0
- data/lib/templates/ruby/minitest/scenario.hbs +1 -0
- data/lib/templates/ruby/minitest/scenarios.hbs +13 -0
- data/lib/templates/ruby/minitest/single_scenario.hbs +11 -0
- data/lib/templates/ruby/minitest/single_test.hbs +11 -0
- data/lib/templates/ruby/minitest/test.hbs +1 -0
- data/lib/templates/ruby/minitest/tests.hbs +13 -0
- data/lib/templates/ruby/output_config +6 -0
- data/lib/templates/ruby/parameter.hbs +1 -0
- data/lib/templates/ruby/parenthesis.hbs +1 -0
- data/lib/templates/ruby/project.hbs +2 -0
- data/lib/templates/ruby/property.hbs +1 -0
- data/lib/templates/ruby/scenario.hbs +1 -0
- data/lib/templates/ruby/scenarios.hbs +12 -0
- data/lib/templates/ruby/single_scenario.hbs +11 -0
- data/lib/templates/ruby/single_test.hbs +11 -0
- data/lib/templates/ruby/step.hbs +1 -0
- data/lib/templates/ruby/tag.hbs +1 -0
- data/lib/templates/ruby/template.hbs +1 -0
- data/lib/templates/ruby/test.hbs +1 -0
- data/lib/templates/ruby/tests.hbs +12 -0
- data/lib/templates/ruby/unaryexpression.hbs +1 -0
- data/lib/templates/ruby/while.hbs +5 -0
- data/lib/templates/seleniumide/argument.hbs +1 -0
- data/lib/templates/seleniumide/call.hbs +6 -0
- data/lib/templates/seleniumide/output_config +9 -0
- data/lib/templates/seleniumide/single_test.hbs +28 -0
- data/lib/templates/seleniumide/step.hbs +0 -0
- data/lib/templates/seleniumide/stringliteral.hbs +1 -0
- data/lib/templates/seleniumide/template.hbs +1 -0
- data/lib/templates/seleniumide/test.hbs +4 -0
- data/lib/templates/seleniumide/tests.hbs +19 -0
- metadata +404 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
{{#if has_datasets?}}
|
2
|
+
Test Template {{{ underscore rendered_children.name }}}
|
3
|
+
|
4
|
+
*** Test Cases ***{{#each node.children.parameters}}{{{ tab }}}{{{ this.children.name}}}{{/each}}
|
5
|
+
{{{ rendered_children.datatable }}}
|
6
|
+
|
7
|
+
*** Keywords ***
|
8
|
+
{{else}}
|
9
|
+
*** Test Cases ***
|
10
|
+
{{/if}}
|
11
|
+
{{> keyword}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> keyword}}
|
@@ -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 @@
|
|
1
|
+
{{{ underscore rendered_children.actionword }}}{{#if has_arguments?}}{{tab}}{{{ join rendered_children.arguments '\t'}}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.name}}}{{{ tab }}}{{{ join rendered_children.arguments '\t'}}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}.{{{ rendered_children.name }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
# NOT SUPPORTED YET
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}[{{{ rendered_children.expression }}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
[{{{ join rendered_children.items ', '}}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
None
|
@@ -0,0 +1 @@
|
|
1
|
+
${{#curly}}{{{ underscore rendered_children.name }}}{{/curly}}{{#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 @@
|
|
1
|
+
PLEASE USE THE --split-scenarios OPTION WHEN PUBLISHING
|
@@ -0,0 +1,11 @@
|
|
1
|
+
*** Settings ***
|
2
|
+
Documentation
|
3
|
+
{{#comment '... '}}{{#clear_empty_lines}}
|
4
|
+
{{{ rendered_children.description}}}
|
5
|
+
{{#if has_tags?}}
|
6
|
+
Tags: {{{ join rendered_children.tags ' '}}}
|
7
|
+
{{/if}}{{/clear_empty_lines}}{{/comment}}
|
8
|
+
|
9
|
+
Resource keywords.txt
|
10
|
+
|
11
|
+
{{> scenario}}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
*** Settings ***
|
2
|
+
Documentation
|
3
|
+
{{#comment '... '}}{{#clear_empty_lines}}
|
4
|
+
{{{ rendered_children.description}}}
|
5
|
+
{{#if has_tags?}}
|
6
|
+
Tags: {{{ join rendered_children.tags ' '}}}
|
7
|
+
{{/if}}{{/clear_empty_lines}}{{/comment}}
|
8
|
+
|
9
|
+
Resource keywords.txt
|
10
|
+
|
11
|
+
{{> scenario}}
|
@@ -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
|
+
{{#each treated_chunks}}{{#if this.is_variable?}}${{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1 @@
|
|
1
|
+
PLEASE USE THE --split-scenarios OPTION WHEN PUBLISHING
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.operator }}}{{{ rendered_children.expression }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
${{#curly}}{{ underscore rendered_children.name }}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
# NOT SUPPORTED YET
|
@@ -0,0 +1,9 @@
|
|
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}}
|
7
|
+
{{#if has_step?}}raise NotImplementedError{{/if}}
|
8
|
+
{{/indent}}
|
9
|
+
{{/clear_empty_lines}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> item_as_def}}
|
@@ -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 @@
|
|
1
|
+
{{{ underscore rendered_children.actionword }}}{{#if has_arguments?}}({{{ join rendered_children.arguments ', '}}}){{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}.{{{ rendered_children.name }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}[{{{ rendered_children.expression }}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
[{{{ join rendered_children.items ', '}}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require_relative 'actionwords'
|
5
|
+
|
6
|
+
class Test{{{ camelize project_name }}} < MiniTest::Unit::TestCase
|
7
|
+
include Actionwords
|
8
|
+
{{#indent}}
|
9
|
+
{{#each rendered_children.scenarios}}{{{this}}}
|
10
|
+
|
11
|
+
{{/each}}
|
12
|
+
{{/indent}}
|
13
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require_relative 'actionwords'
|
5
|
+
|
6
|
+
class Test{{{ camelize project_name }}} < MiniTest::Unit::TestCase
|
7
|
+
include Actionwords
|
8
|
+
{{#indent}}
|
9
|
+
{{#each rendered_children.tests}}{{{this}}}
|
10
|
+
|
11
|
+
{{/each}}
|
12
|
+
{{/indent}}
|
13
|
+
end
|
@@ -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 @@
|
|
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}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}"
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.operator }}}{{{ rendered_children.expression }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
<td>{{{ rendered_children.value }}}</td>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">{{#indent}}
|
4
|
+
<head profile="http://selenium-ide.openqa.org/profiles/test-case">{{#indent}}
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<link rel="selenium.base" href="http://selenium.googlecode.com/" />
|
7
|
+
<title>{{{ rendered_children.name }}}</title>
|
8
|
+
{{/indent}}
|
9
|
+
</head>
|
10
|
+
<body>{{#indent}}
|
11
|
+
<table>{{#indent}}
|
12
|
+
<thead>{{#indent}}
|
13
|
+
<tr>{{#indent}}
|
14
|
+
<td colspan="3">{{{ rendered_children.name }}}</td>
|
15
|
+
{{/indent}}
|
16
|
+
</tr>
|
17
|
+
{{/indent}}
|
18
|
+
</thead>
|
19
|
+
<tbody>{{#indent}}
|
20
|
+
{{#each rendered_children.body}}{{{ this }}}
|
21
|
+
{{/each}}{{/indent}}
|
22
|
+
</tbody>
|
23
|
+
{{/indent}}
|
24
|
+
</table>
|
25
|
+
{{/indent}}
|
26
|
+
</body>
|
27
|
+
{{/indent}}
|
28
|
+
</html>
|