teuton 2.1.11 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -12
- data/bin/check_teuton +0 -2
- data/docs/changelog/ideas.md +132 -0
- data/docs/changelog/v2.1.md +14 -122
- data/docs/changelog/v2.2.md +52 -28
- data/docs/changelog/version2.1.md +4 -0
- data/docs/commands/README.md +58 -15
- data/docs/commands/example_check.md +0 -4
- data/docs/commands/example_run.md +0 -4
- data/docs/dsl/README.md +1 -1
- data/docs/dsl/definition/result.md +1 -0
- data/docs/dsl/definition/run_remote.md +12 -6
- data/docs/dsl/definition/target.md +9 -10
- data/docs/install/README.md +13 -18
- data/docs/install/vagrant_docker.md +1 -1
- data/docs/learn/README.md +8 -8
- data/docs/learn/example-01-target.md +25 -25
- data/docs/learn/example-02-config.md +38 -49
- data/docs/learn/example-03-remote-hosts.md +22 -22
- data/docs/learn/{example-11-first-test.md → example-04-new-test.md} +23 -24
- data/docs/learn/{example-04-use.md → example-05-use.md} +6 -6
- data/docs/learn/{example-05-debug.md → example-06-debug.md} +8 -8
- data/docs/learn/{example-06-log.md → example-07-log.md} +7 -7
- data/docs/learn/{example-07-readme.md → example-08-readme.md} +10 -10
- data/docs/learn/{example-08-preserve.md → example-09-preserve.md} +6 -6
- data/docs/videos.md +19 -0
- data/lib/teuton/application.rb +22 -3
- data/lib/teuton/case_manager/case/dsl/goto.rb +2 -2
- data/lib/teuton/case_manager/case/dsl/macro.rb +1 -0
- data/lib/teuton/case_manager/case/dsl/send.rb +2 -1
- data/lib/teuton/case_manager/case/play.rb +2 -0
- data/lib/teuton/case_manager/case/result/ext_compare.rb +16 -0
- data/lib/teuton/case_manager/case/result/result.rb +1 -1
- data/lib/teuton/case_manager/case/runner.rb +30 -4
- data/lib/teuton/case_manager/case_manager.rb +1 -1
- data/lib/teuton/case_manager/export_manager.rb +21 -11
- data/lib/teuton/case_manager/utils.rb +1 -1
- data/lib/teuton/{project/laboratory → check}/builtin.rb +0 -0
- data/lib/teuton/{project/laboratory → check}/dsl.rb +40 -28
- data/lib/teuton/{project/laboratory → check}/laboratory.rb +3 -8
- data/lib/teuton/{project/laboratory → check}/show.rb +53 -59
- data/lib/teuton/cli.rb +85 -14
- data/lib/teuton/{project/readme → readme}/dsl.rb +0 -0
- data/lib/teuton/{project/readme → readme}/lang.rb +1 -1
- data/lib/teuton/{project/readme → readme}/readme.rb +22 -18
- data/lib/teuton/report/formatter/array_formatter.rb +13 -1
- data/lib/teuton/report/formatter/base_formatter.rb +18 -5
- data/lib/teuton/{project/skeleton.rb → skeleton.rb} +7 -19
- data/lib/teuton/utils/configfile_reader.rb +121 -0
- data/lib/teuton/{project → utils}/name_file_finder.rb +46 -26
- data/lib/teuton/version.rb +8 -0
- data/lib/teuton.rb +39 -32
- metadata +107 -65
- data/lib/teuton/cli/check.rb +0 -38
- data/lib/teuton/cli/main.rb +0 -6
- data/lib/teuton/cli/play.rb +0 -38
- data/lib/teuton/cli/readme.rb +0 -26
- data/lib/teuton/cli/version.rb +0 -12
- data/lib/teuton/files/gitignore +0 -2
- data/lib/teuton/project/configfile_reader.rb +0 -49
- data/lib/teuton/project/project.rb +0 -80
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
require 'json/pure'
|
5
|
-
|
6
|
-
# Functions that read data from ConfigFile using formats YAML and JSON
|
7
|
-
# * read
|
8
|
-
# * read_yaml
|
9
|
-
# * read_json
|
10
|
-
module ConfigFileReader
|
11
|
-
def self.read(filepath)
|
12
|
-
unless File.exist?(filepath)
|
13
|
-
data = {}
|
14
|
-
data[:global] = {}
|
15
|
-
data[:alias] = {}
|
16
|
-
data[:cases] = [{ tt_members: 'anonymous' }]
|
17
|
-
return data
|
18
|
-
end
|
19
|
-
return read_yaml(filepath) if File.extname(filepath) == '.yaml'
|
20
|
-
|
21
|
-
return read_json(filepath) if File.extname(filepath) == '.json'
|
22
|
-
|
23
|
-
raise "[ERROR] ConfigFileReader: #{filepath}"
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.read_yaml(filepath)
|
27
|
-
begin
|
28
|
-
data = YAML.load(File.open(filepath))
|
29
|
-
rescue StandardError => e
|
30
|
-
puts "\n" + ('=' * 80)
|
31
|
-
puts "[ERROR] ConfigFileReader#read <#{filepath}>"
|
32
|
-
puts ' I suggest to revise file format!'
|
33
|
-
puts " #{e.message}\n" + ('=' * 80)
|
34
|
-
raise "[ERROR] ConfigFileReader <#{e}>"
|
35
|
-
end
|
36
|
-
data[:global] = data[:global] || {}
|
37
|
-
data[:alias] = data[:alias] || {}
|
38
|
-
data[:cases] = data[:cases] || []
|
39
|
-
data
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.read_json(filepath)
|
43
|
-
data = JSON.parse(File.read(filepath), symbolize_names: true)
|
44
|
-
data[:global] = data[:global] || {}
|
45
|
-
data[:alias] = data[:alias] || {}
|
46
|
-
data[:cases] = data[:cases] || []
|
47
|
-
data
|
48
|
-
end
|
49
|
-
end
|
@@ -1,80 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../application'
|
4
|
-
require_relative 'name_file_finder'
|
5
|
-
|
6
|
-
# Project functions invoked by CLI project tool
|
7
|
-
# * test
|
8
|
-
# * play
|
9
|
-
# * process_input_case_option
|
10
|
-
# * readme
|
11
|
-
# * require_dsl_and_script
|
12
|
-
module Project ##
|
13
|
-
##
|
14
|
-
# Check teuton test syntax
|
15
|
-
# @param projectpath (String) Path to teuton test
|
16
|
-
# @param options (Array) Array of input options
|
17
|
-
def self.check(projectpath, options)
|
18
|
-
Application.instance.options.merge! options
|
19
|
-
NameFileFinder.find_filenames_for(projectpath)
|
20
|
-
NameFileFinder.puts_input_info_on_screen
|
21
|
-
require_dsl_and_script('laboratory/laboratory') # Define DSL keywords
|
22
|
-
|
23
|
-
app = Application.instance
|
24
|
-
lab = Laboratory.new(app.script_path, app.config_path)
|
25
|
-
# lab.show_requests if options[:r]
|
26
|
-
lab.show_config if options[:c]
|
27
|
-
lab.show_dsl unless options[:r] || options[:c]
|
28
|
-
end
|
29
|
-
|
30
|
-
##
|
31
|
-
# Run test
|
32
|
-
# @param projectpath (String) Path to teuton test
|
33
|
-
# @param options (Array) Array of input options
|
34
|
-
def self.play(projectpath, options)
|
35
|
-
Application.instance.options.merge! options
|
36
|
-
process_input_options
|
37
|
-
NameFileFinder.find_filenames_for(projectpath)
|
38
|
-
NameFileFinder.puts_input_info_on_screen
|
39
|
-
require_dsl_and_script('../case_manager/dsl') # Define DSL keywords
|
40
|
-
end
|
41
|
-
|
42
|
-
##
|
43
|
-
# Preprocess input options:
|
44
|
-
# * Convert input case options String to an Array of integers
|
45
|
-
# * Read color input option
|
46
|
-
def self.process_input_options
|
47
|
-
options = Application.instance.options
|
48
|
-
options['color'] = true if options['color'].nil?
|
49
|
-
Rainbow.enabled = options['color']
|
50
|
-
return if options['case'].nil?
|
51
|
-
|
52
|
-
a = options['case'].split(',')
|
53
|
-
options['case'] = a.collect!(&:to_i)
|
54
|
-
end
|
55
|
-
|
56
|
-
##
|
57
|
-
# Create Readme file for a test
|
58
|
-
# @param projectpath (String) Path to teuton test
|
59
|
-
# @param options (Array) Array of input options
|
60
|
-
def self.readme(projectpath, options)
|
61
|
-
Application.instance.options.merge! options
|
62
|
-
NameFileFinder.find_filenames_for(projectpath)
|
63
|
-
require_dsl_and_script('readme/readme') # Define DSL keywords
|
64
|
-
|
65
|
-
app = Application.instance
|
66
|
-
readme = Readme.new(app.script_path, app.config_path)
|
67
|
-
readme.show
|
68
|
-
end
|
69
|
-
|
70
|
-
def self.require_dsl_and_script(dslpath)
|
71
|
-
app = Application.instance
|
72
|
-
require_relative dslpath
|
73
|
-
begin
|
74
|
-
require_relative app.script_path
|
75
|
-
rescue SyntaxError => e
|
76
|
-
puts e.to_s
|
77
|
-
puts Rainbow.new("[ERROR] SyntaxError into file #{app.script_path}").red
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|