hiptest-publisher 0.8.3 → 0.9.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/csharp-nunit.conf +1 -1
- data/lib/config/cucumber-java.conf +1 -1
- data/lib/config/cucumber-ruby.conf +2 -1
- data/lib/config/java-junit.conf +2 -1
- data/lib/config/java-testng.conf +2 -1
- data/lib/config/javascript-jasmine.conf +2 -1
- data/lib/config/javascript-mocha.conf +2 -1
- data/lib/config/javascript-qunit.conf +2 -1
- data/lib/config/php-phpunit.conf +3 -2
- data/lib/config/python-unittest.conf +2 -1
- data/lib/config/robotframework.conf +2 -2
- data/lib/config/ruby-minitest.conf +2 -1
- data/lib/config/ruby-rspec.conf +2 -1
- data/lib/config/seleniumide.conf +1 -1
- data/lib/config/specflow.conf +2 -1
- data/lib/hiptest-publisher/formatters/console_formatter.rb +1 -1
- data/lib/hiptest-publisher/handlebars_helper.rb +13 -0
- data/lib/hiptest-publisher/options_parser.rb +39 -19
- data/lib/hiptest-publisher/render_context_maker.rb +29 -14
- data/lib/hiptest-publisher/string.rb +16 -14
- data/lib/templates/csharp/folder.hbs +21 -0
- data/lib/templates/csharp/scenarios.hbs +6 -1
- data/lib/templates/csharp/single_scenario.hbs +3 -2
- data/lib/templates/cucumber/java/actionword.hbs +1 -1
- data/lib/templates/cucumber/java/actionwords.hbs +1 -1
- data/lib/templates/java/folder.hbs +12 -0
- data/lib/templates/java/single_scenario.hbs +3 -2
- data/lib/templates/java/testng/folder.hbs +17 -0
- data/lib/templates/java/testng/single_scenario.hbs +3 -2
- data/lib/templates/javascript/_module_declaration.hbs +1 -1
- data/lib/templates/javascript/_scenario.hbs +1 -1
- data/lib/templates/javascript/folder.hbs +8 -0
- data/lib/templates/javascript/jasmine/folder.hbs +8 -0
- data/lib/templates/javascript/jasmine/scenarios.hbs +1 -1
- data/lib/templates/javascript/jasmine/single_scenario.hbs +1 -1
- data/lib/templates/javascript/jasmine/single_test.hbs +1 -1
- data/lib/templates/javascript/jasmine/tests.hbs +1 -1
- data/lib/templates/javascript/mocha/_before_each.hbs +1 -1
- data/lib/templates/php/folder.hbs +13 -0
- data/lib/templates/php/scenarios.hbs +1 -1
- data/lib/templates/php/single_scenario.hbs +2 -2
- data/lib/templates/php/single_test.hbs +1 -1
- data/lib/templates/php/tests.hbs +1 -1
- data/lib/templates/python/_scenario.hbs +1 -1
- data/lib/templates/python/folder.hbs +11 -0
- data/lib/templates/python/scenarios.hbs +1 -1
- data/lib/templates/python/single_scenario.hbs +1 -1
- data/lib/templates/python/single_test.hbs +1 -1
- data/lib/templates/python/tests.hbs +1 -1
- data/lib/templates/robotframework/folder.hbs +1 -0
- data/lib/templates/ruby/_scenario.hbs +2 -2
- data/lib/templates/ruby/folder.hbs +12 -0
- data/lib/templates/ruby/minitest/folder.hbs +13 -0
- data/lib/templates/ruby/minitest/scenarios.hbs +2 -2
- data/lib/templates/ruby/minitest/single_scenario.hbs +2 -2
- data/lib/templates/ruby/minitest/single_test.hbs +1 -1
- data/lib/templates/ruby/minitest/tests.hbs +1 -1
- data/lib/templates/ruby/scenarios.hbs +2 -2
- data/lib/templates/ruby/single_scenario.hbs +2 -2
- data/lib/templates/ruby/single_test.hbs +1 -1
- data/lib/templates/ruby/tests.hbs +1 -1
- metadata +13 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39afe8e077af4429d7ca2396b0b49191f18a8690
|
4
|
+
data.tar.gz: 409aeaf3cc6bed1a076d68517a2533d7517ee983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f03ab8b780cee93cb22d5c36fccfaf63300986a7690f982193452ba703351521d921d17b051c653a556f9e6f1c4499f4488413a86059a84486541cfec806b444
|
7
|
+
data.tar.gz: c04410ae58e6f8fc1fbb3a0cd2a4f52be7e7b596ebff9a7b6854761f33e7edb977af1a5a271a3115b23b98ef8d1e2460522f39d5b85c60a3504ec9b35a46a514
|
data/lib/config/java-junit.conf
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
template_dirs = java, common
|
3
3
|
package = 'com.example'
|
4
4
|
indentation = ' '
|
5
|
+
dirname_convention = 'underscore'
|
5
6
|
filename_convention = 'camelize'
|
6
7
|
naming_convention = 'camelize_lower'
|
7
8
|
|
8
9
|
[tests]
|
9
10
|
filename = 'ProjectTest.java'
|
10
|
-
|
11
|
+
named_filename = '%sTest.java'
|
11
12
|
call_prefix = 'actionwords'
|
12
13
|
|
13
14
|
[actionwords]
|
data/lib/config/java-testng.conf
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
template_dirs = java/testng, java, common
|
3
3
|
package = 'com.example'
|
4
4
|
indentation = ' '
|
5
|
+
dirname_convention = 'underscore'
|
5
6
|
filename_convention = 'camelize'
|
6
7
|
naming_convention = 'camelize_lower'
|
7
8
|
|
8
9
|
[tests]
|
9
10
|
filename = 'ProjectTest.java'
|
10
|
-
|
11
|
+
named_filename = '%sTest.java'
|
11
12
|
call_prefix = 'actionwords'
|
12
13
|
|
13
14
|
[actionwords]
|
@@ -3,8 +3,9 @@ template_dirs = javascript/jasmine, javascript, common
|
|
3
3
|
|
4
4
|
[tests]
|
5
5
|
filename = 'project_test.js'
|
6
|
-
|
6
|
+
named_filename = '%s_test.js'
|
7
7
|
call_prefix = 'actionwords'
|
8
|
+
filename_convention = 'underscore'
|
8
9
|
|
9
10
|
[actionwords]
|
10
11
|
filename = 'actionwords.js'
|
@@ -3,8 +3,9 @@ template_dirs = javascript/mocha, javascript/jasmine, javascript, common
|
|
3
3
|
|
4
4
|
[tests]
|
5
5
|
filename = 'project_test.js'
|
6
|
-
|
6
|
+
named_filename = '%s_test.js'
|
7
7
|
call_prefix = 'actionwords'
|
8
|
+
filename_convention = 'underscore'
|
8
9
|
|
9
10
|
[actionwords]
|
10
11
|
filename = 'actionwords.js'
|
data/lib/config/php-phpunit.conf
CHANGED
@@ -3,9 +3,10 @@ template_dirs = php, common
|
|
3
3
|
indentation = " "
|
4
4
|
|
5
5
|
[tests]
|
6
|
-
filename = '
|
7
|
-
|
6
|
+
filename = 'ProjectTest.php'
|
7
|
+
named_filename = '%sTest.php'
|
8
8
|
call_prefix = '$this->actionwords'
|
9
|
+
filename_convention = 'camelize'
|
9
10
|
|
10
11
|
[actionwords]
|
11
12
|
filename = 'Actionwords.php'
|
data/lib/config/ruby-rspec.conf
CHANGED
data/lib/config/seleniumide.conf
CHANGED
data/lib/config/specflow.conf
CHANGED
@@ -7,7 +7,8 @@ fallback_template = 'empty'
|
|
7
7
|
indentation = ' '
|
8
8
|
node_name = folders
|
9
9
|
template_dirs = gherkin, gherkin, common
|
10
|
-
|
10
|
+
named_filename = '%s.feature'
|
11
|
+
filename_convention = 'camelize_upper'
|
11
12
|
|
12
13
|
[step_definitions]
|
13
14
|
node_name = actionwords
|
@@ -21,6 +21,6 @@ class ConsoleFormatter
|
|
21
21
|
return unless verbose
|
22
22
|
message ||= "Running Hiptest-publisher #{hiptest_publisher_version} with:"
|
23
23
|
puts message.yellow
|
24
|
-
options.each { |k, v| puts " - #{k}: #{v.inspect}"
|
24
|
+
options.each { |k, v| puts " - #{k}: #{v.inspect}" }
|
25
25
|
end
|
26
26
|
end
|
@@ -131,6 +131,19 @@ module Hiptest
|
|
131
131
|
"\t"
|
132
132
|
end
|
133
133
|
|
134
|
+
def hh_relative_path(context, filename, path_prefix = nil, block)
|
135
|
+
levels_count = context.get('context.relative_path').count('/')
|
136
|
+
name = ""
|
137
|
+
name << path_prefix if path_prefix
|
138
|
+
if levels_count == 0
|
139
|
+
name << filename
|
140
|
+
else
|
141
|
+
name << "../" * levels_count
|
142
|
+
name << filename.to_s.gsub(/\A\.\//, '')
|
143
|
+
end
|
144
|
+
name
|
145
|
+
end
|
146
|
+
|
134
147
|
def hh_debug(context, block)
|
135
148
|
require 'pry'
|
136
149
|
binding.pry
|
@@ -355,25 +355,42 @@ class LanguageGroupConfig
|
|
355
355
|
end
|
356
356
|
|
357
357
|
def with_folders?
|
358
|
-
@with_folders
|
358
|
+
@with_folders && (node_name == :scenarios || node_name == :folders)
|
359
359
|
end
|
360
360
|
|
361
361
|
def splitted_files?
|
362
|
-
if self[:
|
362
|
+
if self[:named_filename].nil?
|
363
|
+
# if we can't give a different name for each file, we can't split them
|
363
364
|
false
|
364
365
|
elsif self[:filename].nil?
|
366
|
+
# if we can't give a name to a single file, we must split them
|
365
367
|
true
|
366
368
|
else
|
369
|
+
# both options are possible, do as user specified
|
367
370
|
@split_scenarios
|
368
371
|
end
|
369
372
|
end
|
370
373
|
|
374
|
+
def can_name_files?
|
375
|
+
if self[:named_filename]
|
376
|
+
splitted_files? || with_folders?
|
377
|
+
else
|
378
|
+
false
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
371
382
|
def nodes(project)
|
372
383
|
case node_name
|
373
384
|
when :tests, :scenarios, :actionwords
|
374
|
-
|
385
|
+
if splitted_files?
|
386
|
+
project.children[node_name].children[node_name]
|
387
|
+
elsif with_folders?
|
388
|
+
get_folder_nodes(project)
|
389
|
+
else
|
390
|
+
[project.children[node_name]]
|
391
|
+
end
|
375
392
|
when :folders
|
376
|
-
project
|
393
|
+
get_folder_nodes(project)
|
377
394
|
end
|
378
395
|
end
|
379
396
|
|
@@ -421,7 +438,9 @@ class LanguageGroupConfig
|
|
421
438
|
end
|
422
439
|
|
423
440
|
def build_node_rendering_context(node)
|
424
|
-
|
441
|
+
relative_path = File.join(output_dirname(node), output_filename(node))
|
442
|
+
relative_path = relative_path[1..-1] if relative_path[0] == '/'
|
443
|
+
path = File.join(language_group_output_directory, relative_path)
|
425
444
|
|
426
445
|
if splitted_files?
|
427
446
|
description = "#{singularize(node_name)} \"#{node.children[:name]}\""
|
@@ -431,6 +450,7 @@ class LanguageGroupConfig
|
|
431
450
|
|
432
451
|
NodeRenderingContext.new(
|
433
452
|
path: path,
|
453
|
+
relative_path: relative_path,
|
434
454
|
indentation: indentation,
|
435
455
|
template_finder: template_finder,
|
436
456
|
description: description,
|
@@ -445,22 +465,21 @@ class LanguageGroupConfig
|
|
445
465
|
@user_params["#{@language_group_params[:group_name]}_output_directory"] || @output_directory
|
446
466
|
end
|
447
467
|
|
448
|
-
def
|
468
|
+
def output_dirname(node)
|
469
|
+
return "" unless with_folders?
|
449
470
|
folder = node.folder
|
450
471
|
hierarchy = []
|
451
472
|
while folder && !folder.root?
|
452
|
-
hierarchy <<
|
473
|
+
hierarchy << normalized_dirname(folder.children[:name])
|
453
474
|
folder = folder.parent
|
454
475
|
end
|
455
476
|
File.join(*hierarchy.reverse)
|
456
477
|
end
|
457
478
|
|
458
|
-
def
|
459
|
-
if
|
460
|
-
name = normalized_filename(node.children[:name])
|
461
|
-
|
462
|
-
directory = with_folders? ? output_directory(node) : ""
|
463
|
-
File.join(directory, filename)
|
479
|
+
def output_filename(node)
|
480
|
+
if can_name_files?
|
481
|
+
name = normalized_filename(node.children[:name] || '')
|
482
|
+
self[:named_filename].gsub('%s', name)
|
464
483
|
else
|
465
484
|
self[:filename]
|
466
485
|
end
|
@@ -480,12 +499,13 @@ class LanguageGroupConfig
|
|
480
499
|
end
|
481
500
|
end
|
482
501
|
|
483
|
-
def
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
502
|
+
def get_folder_nodes(project)
|
503
|
+
project.children[:test_plan].children[:folders].select {|folder| folder.children[:scenarios].length > 0}
|
504
|
+
end
|
505
|
+
|
506
|
+
def normalized_dirname(name)
|
507
|
+
dirname_convention = @language_group_params[:dirname_convention] || @language_group_params[:filename_convention] || :normalize
|
508
|
+
name.send(dirname_convention)
|
489
509
|
end
|
490
510
|
|
491
511
|
def normalized_filename(name)
|
@@ -1,11 +1,5 @@
|
|
1
1
|
module Hiptest
|
2
2
|
module RenderContextMaker
|
3
|
-
def walk_folder(folder)
|
4
|
-
{
|
5
|
-
:has_tags? => !folder.children[:tags].empty?
|
6
|
-
}
|
7
|
-
end
|
8
|
-
|
9
3
|
def walk_item(item)
|
10
4
|
{
|
11
5
|
:has_parameters? => !item.children[:parameters].empty?,
|
@@ -13,19 +7,35 @@ module Hiptest
|
|
13
7
|
:has_step? => has_step?(item),
|
14
8
|
:is_empty? => item.children[:body].empty?,
|
15
9
|
:declared_variables => item.declared_variables_names,
|
16
|
-
:raw_parameter_names => item.children[:parameters].map {|p| p.children[:name] }
|
10
|
+
:raw_parameter_names => item.children[:parameters].map {|p| p.children[:name] },
|
11
|
+
:self_name => item.children[:name],
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
def walk_relative_item(item)
|
16
|
+
relative_package = @context.relative_path.split('/')[0...-1].join('.')
|
17
|
+
relative_package = ".#{relative_package}" unless relative_package.empty?
|
18
|
+
{
|
19
|
+
:needs_to_import_actionwords? => @context.relative_path.count('/') > 0,
|
20
|
+
:relative_package => relative_package,
|
17
21
|
}
|
18
22
|
end
|
19
23
|
|
20
24
|
alias :walk_actionword :walk_item
|
21
25
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
26
|
+
def walk_folder(folder)
|
27
|
+
walk_relative_item(folder).merge(
|
28
|
+
:self_name => folder.children[:name],
|
29
|
+
:has_tags? => !folder.children[:tags].empty?,
|
30
|
+
)
|
31
|
+
end
|
25
32
|
|
33
|
+
def walk_scenario(scenario)
|
26
34
|
datatable = scenario.children[:datatable]
|
27
|
-
|
28
|
-
|
35
|
+
walk_item(scenario).merge(walk_relative_item(scenario)).merge(
|
36
|
+
:project_name => scenario.parent.parent.children[:name],
|
37
|
+
:has_datasets? => datatable ? !datatable.children[:datasets].empty? : false
|
38
|
+
)
|
29
39
|
end
|
30
40
|
|
31
41
|
def walk_dataset(dataset)
|
@@ -36,8 +46,10 @@ module Hiptest
|
|
36
46
|
end
|
37
47
|
|
38
48
|
def walk_scenarios(scenarios)
|
49
|
+
project = scenarios.parent
|
39
50
|
{
|
40
|
-
:project_name =>
|
51
|
+
:project_name => project.children[:name],
|
52
|
+
:self_name => project.children[:name],
|
41
53
|
}
|
42
54
|
end
|
43
55
|
|
@@ -49,12 +61,15 @@ module Hiptest
|
|
49
61
|
:is_empty? => test.children[:body].empty?,
|
50
62
|
:has_datasets? => false,
|
51
63
|
:project_name => test.parent.parent.children[:name],
|
64
|
+
:self_name => test.children[:name],
|
52
65
|
}
|
53
66
|
end
|
54
67
|
|
55
68
|
def walk_tests(tests)
|
69
|
+
project = tests.parent
|
56
70
|
{
|
57
|
-
:project_name =>
|
71
|
+
:project_name => project.children[:name],
|
72
|
+
:self_name => project.children[:name],
|
58
73
|
}
|
59
74
|
end
|
60
75
|
|
@@ -10,26 +10,33 @@ class String
|
|
10
10
|
|
11
11
|
def normalize
|
12
12
|
literated = self.literate
|
13
|
-
literated.strip
|
13
|
+
literated.strip!
|
14
|
+
literated.gsub!(/\s+/, '_')
|
15
|
+
literated.gsub!(/\W/, '')
|
16
|
+
literated
|
14
17
|
end
|
15
18
|
|
16
19
|
def normalize_lower
|
17
|
-
self.normalize
|
20
|
+
normalized = self.normalize
|
21
|
+
normalized.downcase!
|
22
|
+
normalized
|
18
23
|
end
|
19
24
|
|
20
25
|
def underscore
|
21
26
|
# based on:
|
22
27
|
# http://stackoverflow.com/questions/1509915/converting-camel-case-to-underscore-case-in-ruby
|
23
28
|
normalized = self.normalize
|
24
|
-
normalized.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
normalized.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
30
|
+
normalized.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
31
|
+
normalized.tr!("-", "_")
|
32
|
+
normalized.downcase!
|
33
|
+
normalized
|
28
34
|
end
|
29
35
|
|
30
36
|
def camelize
|
31
|
-
normalized = self.normalize
|
32
|
-
normalized.
|
37
|
+
normalized = self.normalize.split('_')
|
38
|
+
normalized.map! {|w| w.empty? ? "" : "#{w[0].upcase}#{w[1..-1]}"}
|
39
|
+
normalized.join
|
33
40
|
end
|
34
41
|
|
35
42
|
def camelize_lower
|
@@ -42,12 +49,7 @@ class String
|
|
42
49
|
end
|
43
50
|
|
44
51
|
def camelize_upper
|
45
|
-
|
46
|
-
if camelized.empty?
|
47
|
-
""
|
48
|
-
else
|
49
|
-
"#{camelized[0].upcase}#{camelized[1..-1]}"
|
50
|
-
end
|
52
|
+
self.camelize
|
51
53
|
end
|
52
54
|
|
53
55
|
def clear_extension
|
@@ -0,0 +1,21 @@
|
|
1
|
+
namespace {{{ context.namespace }}}{{{ relative_package }}} {{#curly}}{{#indent}}
|
2
|
+
|
3
|
+
using System;
|
4
|
+
using NUnit.Framework;
|
5
|
+
{{#if needs_to_import_actionwords? }}using {{{ context.namespace }}};
|
6
|
+
{{/if}}
|
7
|
+
[TestFixture]
|
8
|
+
public class {{{ clear_extension context.filename }}} {{#curly}}
|
9
|
+
{{#indent}}
|
10
|
+
public Actionwords {{{ context.call_prefix }}};
|
11
|
+
|
12
|
+
[SetUp]
|
13
|
+
protected void SetUp() {{#curly}}
|
14
|
+
{{{ context.call_prefix}}} = new Actionwords();
|
15
|
+
{{/curly}}
|
16
|
+
{{#each rendered_children.scenarios}}{{{this}}}
|
17
|
+
{{/each}}
|
18
|
+
{{/indent}}
|
19
|
+
{{/curly}}
|
20
|
+
{{/indent}}
|
21
|
+
{{/curly}}
|
@@ -6,7 +6,12 @@ using NUnit.Framework;
|
|
6
6
|
[TestFixture]
|
7
7
|
public class {{{ clear_extension context.filename }}} {{#curly}}
|
8
8
|
{{#indent}}
|
9
|
-
public Actionwords {{{ context.call_prefix }}}
|
9
|
+
public Actionwords {{{ context.call_prefix }}};
|
10
|
+
|
11
|
+
[SetUp]
|
12
|
+
protected void SetUp() {{#curly}}
|
13
|
+
{{{ context.call_prefix}}} = new Actionwords();
|
14
|
+
{{/curly}}
|
10
15
|
{{#each rendered_children.scenarios}}{{{this}}}
|
11
16
|
{{/each}}
|
12
17
|
{{/indent}}
|
@@ -1,8 +1,9 @@
|
|
1
|
-
namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
|
1
|
+
namespace {{{ context.namespace }}}{{{ relative_package }}} {{#curly}}{{#indent}}
|
2
2
|
|
3
3
|
using System;
|
4
4
|
using NUnit.Framework;
|
5
|
-
|
5
|
+
{{#if needs_to_import_actionwords? }}using {{{ context.namespace }}};
|
6
|
+
{{/if}}
|
6
7
|
[TestFixture]
|
7
8
|
public class {{{ clear_extension context.filename }}} {{#curly}}
|
8
9
|
{{#indent}}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
{{#if rendered_children.gherkin_annotation }}@
|
1
|
+
{{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{{escape_double_quotes rendered_children.gherkin_pattern }}}")
|
2
2
|
public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.parameters ', '}}}) {{#curly}}{{#indent}}
|
3
3
|
{{{ context.call_prefix }}}.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
package {{{ context.package }}}{{{ relative_package }}};
|
2
|
+
|
3
|
+
import junit.framework.TestCase;
|
4
|
+
{{#if needs_to_import_actionwords? }}import {{{ context.package }}}.Actionwords;
|
5
|
+
{{/if}}
|
6
|
+
public class {{{ clear_extension context.filename }}} extends TestCase {{#curly}}
|
7
|
+
{{#indent}}
|
8
|
+
public Actionwords {{{ context.call_prefix }}} = new Actionwords();
|
9
|
+
{{#each rendered_children.scenarios}}{{{this}}}
|
10
|
+
{{/each}}
|
11
|
+
{{/indent}}
|
12
|
+
{{/curly}}
|
@@ -1,7 +1,8 @@
|
|
1
|
-
package {{{ context.package }}};
|
1
|
+
package {{{ context.package }}}{{{ relative_package }}};
|
2
2
|
|
3
3
|
import junit.framework.TestCase;
|
4
|
-
|
4
|
+
{{#if needs_to_import_actionwords? }}import {{{ context.package }}}.Actionwords;
|
5
|
+
{{/if}}
|
5
6
|
public class {{{ clear_extension context.filename }}} extends TestCase {{#curly}}
|
6
7
|
{{#indent}}
|
7
8
|
public Actionwords {{{ context.call_prefix }}} = new Actionwords();
|
@@ -0,0 +1,17 @@
|
|
1
|
+
package {{{ context.package }}}{{{ relative_package }}};
|
2
|
+
|
3
|
+
import org.testng.annotations.*;
|
4
|
+
{{#if needs_to_import_actionwords? }}import {{{ context.package }}}.Actionwords;
|
5
|
+
{{/if}}
|
6
|
+
public class {{{ clear_extension context.filename }}} {{#curly}}
|
7
|
+
|
8
|
+
{{#indent}}public Actionwords {{{ context.call_prefix }}};
|
9
|
+
|
10
|
+
@BeforeMethod
|
11
|
+
public void setUp() {{#curly}}
|
12
|
+
{{#indent}}{{{ context.call_prefix }}} = new Actionwords();{{/indent}}
|
13
|
+
{{/curly}}{{/indent}}
|
14
|
+
{{#indent}}{{#each rendered_children.scenarios}}{{{this}}}
|
15
|
+
{{/each}}
|
16
|
+
{{/indent}}
|
17
|
+
{{/curly}}
|
@@ -1,7 +1,8 @@
|
|
1
|
-
package {{{ context.package }}};
|
1
|
+
package {{{ context.package }}}{{{ relative_package }}};
|
2
2
|
|
3
3
|
import org.testng.annotations.*;
|
4
|
-
|
4
|
+
{{#if needs_to_import_actionwords? }}import {{{ context.package }}}.Actionwords;
|
5
|
+
{{/if}}
|
5
6
|
public class {{{ clear_extension context.filename }}} {{#curly}}
|
6
7
|
{{#indent}}
|
7
8
|
public Actionwords {{{ context.call_prefix }}} = new Actionwords();
|
@@ -1,4 +1,4 @@
|
|
1
1
|
{{#if has_datasets?}}{{> item_as_function}}
|
2
|
-
{{{ rendered_children.datatable }}}{{else}}test('{{{
|
2
|
+
{{{ rendered_children.datatable }}}{{else}}test('{{{ escape_single_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
|
3
3
|
{{> body}}
|
4
4
|
{{/curly}});{{/if}}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?php
|
2
|
+
require_once(__DIR__.'{{{ relative_path 'Actionwords.php' '/'}}}');
|
3
|
+
|
4
|
+
class {{{ clear_extension context.filename }}} 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
|
+
?>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<?php
|
2
2
|
require_once('Actionwords.php');
|
3
3
|
|
4
|
-
class {{{
|
4
|
+
class {{{ clear_extension context.filename }}} extends PHPUnit_Framework_TestCase {{#curly}}{{#indent}}
|
5
5
|
public $actionwords;
|
6
6
|
{{> setup}}
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<?php
|
2
|
-
require_once('Actionwords.php');
|
2
|
+
require_once(__DIR__.'{{{ relative_path 'Actionwords.php' '/'}}}');
|
3
3
|
|
4
|
-
class {{{
|
4
|
+
class {{{ clear_extension context.filename }}} extends PHPUnit_Framework_TestCase {{#curly}}{{#indent}}
|
5
5
|
public $actionwords;
|
6
6
|
{{> setup}}
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<?php
|
2
2
|
require_once('Actionwords.php');
|
3
3
|
|
4
|
-
class {{{
|
4
|
+
class {{{ clear_extension context.filename }}} extends PHPUnit_Framework_TestCase {{#curly}}{{#indent}}
|
5
5
|
public $actionwords;
|
6
6
|
{{> setup}}
|
7
7
|
|
data/lib/templates/php/tests.hbs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<?php
|
2
2
|
require_once('Actionwords.php');
|
3
3
|
|
4
|
-
class {{{
|
4
|
+
class {{{ clear_extension context.filename }}} extends PHPUnit_Framework_TestCase {{#curly}}{{#indent}}
|
5
5
|
public $actionwords;
|
6
6
|
{{> setup}}
|
7
7
|
|
@@ -1,4 +1,4 @@
|
|
1
1
|
{{#if has_datasets?}}{{> item_as_def}}
|
2
2
|
{{{ rendered_children.datatable }}}
|
3
|
-
{{else}}def test_{{{ normalize
|
3
|
+
{{else}}def test_{{{ normalize self_name }}}{{#if rendered_children.uid}}_uid{{{ normalize rendered_children.uid}}}{{/if}}({{> parameters}}):
|
4
4
|
{{> body}}{{/if}}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
import unittest
|
3
|
+
from actionwords import Actionwords
|
4
|
+
|
5
|
+
class Test{{{ camelize self_name }}}(unittest.TestCase):
|
6
|
+
def setUp(self):
|
7
|
+
self.actionwords = Actionwords(self)
|
8
|
+
{{#indent}}
|
9
|
+
{{#each rendered_children.scenarios}}{{{this}}}
|
10
|
+
{{/each}}
|
11
|
+
{{/indent}}
|
@@ -0,0 +1 @@
|
|
1
|
+
PLEASE USE THE --split-scenarios OPTION WHEN PUBLISHING
|
@@ -1,5 +1,5 @@
|
|
1
|
-
{{#if has_datasets?}}context "{{{ escape_double_quotes
|
1
|
+
{{#if has_datasets?}}context "{{{ escape_double_quotes self_name }}}" do{{#indent}}
|
2
2
|
{{> item_as_def}}
|
3
|
-
{{{ rendered_children.datatable }}}{{/indent}}{{else}}it "{{{ escape_double_quotes
|
3
|
+
{{{ rendered_children.datatable }}}{{/indent}}{{else}}it "{{{ escape_double_quotes self_name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}" do
|
4
4
|
{{> body}}{{/if}}
|
5
5
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'spec_helper'
|
3
|
+
require_relative '{{{ relative_path 'actionwords' }}}'
|
4
|
+
|
5
|
+
describe '{{{ escape_single_quotes self_name }}}' do
|
6
|
+
include Actionwords
|
7
|
+
{{#indent}}
|
8
|
+
{{#each rendered_children.scenarios}}{{{this}}}
|
9
|
+
|
10
|
+
{{/each}}
|
11
|
+
{{/indent}}
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require_relative '{{{ relative_path 'actionwords' }}}'
|
5
|
+
|
6
|
+
class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase
|
7
|
+
include Actionwords
|
8
|
+
{{#indent}}
|
9
|
+
{{#each rendered_children.scenarios}}{{{this}}}
|
10
|
+
|
11
|
+
{{/each}}
|
12
|
+
{{/indent}}
|
13
|
+
end
|
@@ -3,11 +3,11 @@
|
|
3
3
|
require 'minitest/autorun'
|
4
4
|
require_relative 'actionwords'
|
5
5
|
|
6
|
-
class Test{{{ camelize
|
6
|
+
class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase
|
7
7
|
include Actionwords
|
8
8
|
{{#indent}}
|
9
9
|
{{#each rendered_children.scenarios}}{{{this}}}
|
10
10
|
|
11
11
|
{{/each}}
|
12
12
|
{{/indent}}
|
13
|
-
end
|
13
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require_relative 'actionwords'
|
4
|
+
require_relative '{{{ relative_path 'actionwords' }}}'
|
5
5
|
|
6
|
-
class Test{{{ camelize
|
6
|
+
class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase
|
7
7
|
include Actionwords
|
8
8
|
{{#indent}}
|
9
9
|
{{> scenario}}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'minitest/autorun'
|
4
4
|
require_relative 'actionwords'
|
5
5
|
|
6
|
-
class Test{{{ camelize
|
6
|
+
class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase
|
7
7
|
include Actionwords
|
8
8
|
{{#indent}}
|
9
9
|
{{#each rendered_children.tests}}{{{this}}}
|
@@ -2,11 +2,11 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
require_relative 'actionwords'
|
4
4
|
|
5
|
-
describe '{{{
|
5
|
+
describe '{{{ escape_single_quotes self_name }}}' do
|
6
6
|
include Actionwords
|
7
7
|
{{#indent}}
|
8
8
|
{{#each rendered_children.scenarios}}{{{this}}}
|
9
9
|
|
10
10
|
{{/each}}
|
11
11
|
{{/indent}}
|
12
|
-
end
|
12
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
require 'spec_helper'
|
3
|
-
require_relative 'actionwords'
|
3
|
+
require_relative '{{{ relative_path 'actionwords' }}}'
|
4
4
|
|
5
|
-
describe '{{{
|
5
|
+
describe '{{{ escape_single_quotes self_name }}}' do
|
6
6
|
include Actionwords
|
7
7
|
|
8
8
|
{{#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.
|
4
|
+
version: 0.9.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:
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -295,6 +295,7 @@ files:
|
|
295
295
|
- lib/templates/csharp/dataset.hbs
|
296
296
|
- lib/templates/csharp/dict.hbs
|
297
297
|
- lib/templates/csharp/field.hbs
|
298
|
+
- lib/templates/csharp/folder.hbs
|
298
299
|
- lib/templates/csharp/ifthen.hbs
|
299
300
|
- lib/templates/csharp/index.hbs
|
300
301
|
- lib/templates/csharp/list.hbs
|
@@ -346,6 +347,7 @@ files:
|
|
346
347
|
- lib/templates/java/dataset.hbs
|
347
348
|
- lib/templates/java/dict.hbs
|
348
349
|
- lib/templates/java/field.hbs
|
350
|
+
- lib/templates/java/folder.hbs
|
349
351
|
- lib/templates/java/ifthen.hbs
|
350
352
|
- lib/templates/java/index.hbs
|
351
353
|
- lib/templates/java/list.hbs
|
@@ -364,6 +366,7 @@ files:
|
|
364
366
|
- lib/templates/java/test.hbs
|
365
367
|
- lib/templates/java/testng/_scenario.hbs
|
366
368
|
- lib/templates/java/testng/dataset.hbs
|
369
|
+
- lib/templates/java/testng/folder.hbs
|
367
370
|
- lib/templates/java/testng/scenarios.hbs
|
368
371
|
- lib/templates/java/testng/single_scenario.hbs
|
369
372
|
- lib/templates/java/testng/single_test.hbs
|
@@ -386,11 +389,13 @@ files:
|
|
386
389
|
- lib/templates/javascript/dataset.hbs
|
387
390
|
- lib/templates/javascript/dict.hbs
|
388
391
|
- lib/templates/javascript/field.hbs
|
392
|
+
- lib/templates/javascript/folder.hbs
|
389
393
|
- lib/templates/javascript/ifthen.hbs
|
390
394
|
- lib/templates/javascript/index.hbs
|
391
395
|
- lib/templates/javascript/jasmine/_before_each.hbs
|
392
396
|
- lib/templates/javascript/jasmine/_scenario.hbs
|
393
397
|
- lib/templates/javascript/jasmine/dataset.hbs
|
398
|
+
- lib/templates/javascript/jasmine/folder.hbs
|
394
399
|
- lib/templates/javascript/jasmine/scenarios.hbs
|
395
400
|
- lib/templates/javascript/jasmine/single_scenario.hbs
|
396
401
|
- lib/templates/javascript/jasmine/single_test.hbs
|
@@ -427,6 +432,7 @@ files:
|
|
427
432
|
- lib/templates/php/dataset.hbs
|
428
433
|
- lib/templates/php/dict.hbs
|
429
434
|
- lib/templates/php/field.hbs
|
435
|
+
- lib/templates/php/folder.hbs
|
430
436
|
- lib/templates/php/ifthen.hbs
|
431
437
|
- lib/templates/php/index.hbs
|
432
438
|
- lib/templates/php/list.hbs
|
@@ -460,6 +466,7 @@ files:
|
|
460
466
|
- lib/templates/python/dataset.hbs
|
461
467
|
- lib/templates/python/dict.hbs
|
462
468
|
- lib/templates/python/field.hbs
|
469
|
+
- lib/templates/python/folder.hbs
|
463
470
|
- lib/templates/python/ifthen.hbs
|
464
471
|
- lib/templates/python/index.hbs
|
465
472
|
- lib/templates/python/list.hbs
|
@@ -487,6 +494,7 @@ files:
|
|
487
494
|
- lib/templates/robotframework/call.hbs
|
488
495
|
- lib/templates/robotframework/dataset.hbs
|
489
496
|
- lib/templates/robotframework/datatable.hbs
|
497
|
+
- lib/templates/robotframework/folder.hbs
|
490
498
|
- lib/templates/robotframework/ifthen.hbs
|
491
499
|
- lib/templates/robotframework/parameter.hbs
|
492
500
|
- lib/templates/robotframework/scenarios.hbs
|
@@ -509,12 +517,14 @@ files:
|
|
509
517
|
- lib/templates/ruby/dataset.hbs
|
510
518
|
- lib/templates/ruby/dict.hbs
|
511
519
|
- lib/templates/ruby/field.hbs
|
520
|
+
- lib/templates/ruby/folder.hbs
|
512
521
|
- lib/templates/ruby/ifthen.hbs
|
513
522
|
- lib/templates/ruby/index.hbs
|
514
523
|
- lib/templates/ruby/list.hbs
|
515
524
|
- lib/templates/ruby/minitest/_item_as_def.hbs
|
516
525
|
- lib/templates/ruby/minitest/_scenario.hbs
|
517
526
|
- lib/templates/ruby/minitest/dataset.hbs
|
527
|
+
- lib/templates/ruby/minitest/folder.hbs
|
518
528
|
- lib/templates/ruby/minitest/scenario.hbs
|
519
529
|
- lib/templates/ruby/minitest/scenarios.hbs
|
520
530
|
- lib/templates/ruby/minitest/single_scenario.hbs
|
@@ -566,7 +576,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
566
576
|
version: '0'
|
567
577
|
requirements: []
|
568
578
|
rubyforge_project:
|
569
|
-
rubygems_version: 2.4.
|
579
|
+
rubygems_version: 2.4.5.1
|
570
580
|
signing_key:
|
571
581
|
specification_version: 4
|
572
582
|
summary: Export your tests from Hiptest into executable tests.
|