test_rail_integration 0.0.5 → 0.0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/Gemfile +0 -0
- data/Gemfile.lock +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bin/test_rail_integration +0 -0
- data/lib/test_rail_integration/cli.rb +1 -0
- data/lib/test_rail_integration/generator/API_client.rb +0 -0
- data/lib/test_rail_integration/generator/connection.rb +7 -7
- data/lib/test_rail_integration/generator/project/run_test_run.rb +1 -0
- data/lib/test_rail_integration/generator/project/test_rail_data.yml +3 -3
- data/lib/test_rail_integration/generator/project.rb +10 -1
- data/lib/test_rail_integration/generator/test_case_result.rb +12 -7
- data/lib/test_rail_integration/generator/test_rail_data_load.rb +14 -0
- data/lib/test_rail_integration/generator/test_rail_hooks.rb +0 -0
- data/lib/test_rail_integration/generator/test_rail_tools.rb +18 -9
- data/lib/test_rail_integration/generator/test_run_parameters.rb +5 -2
- data/lib/test_rail_integration/version.rb +1 -1
- data/lib/test_rail_integration.rb +0 -0
- data/test_rail_integration.gemspec +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5478e38a8277295f0d5a2533c06cd6948e0214a5
|
4
|
+
data.tar.gz: 3b5426cab43889eef9b58372065585eba1c68052
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f014852d9621650bb8edbc73aaccf87d544fda542db6670cc269f9fd11f0e67c96f90d2557564a1a24c256dbf3ec419c769f92042b705f18ee05bd7319b1e247
|
7
|
+
data.tar.gz: 9b6089f4fb83258d8fb412ef436ff2a3181c7b2002c46e88ac49ae1ab5ed7dd7b05cf42eb9dbd9e1c8b483184918ec7e10c6d58b14d6ba9aaaedf1d6bcda987c
|
data/.gitignore
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/Gemfile.lock
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/bin/test_rail_integration
CHANGED
File without changes
|
File without changes
|
@@ -1,16 +1,16 @@
|
|
1
|
+
require_relative 'test_rail_data_load'
|
1
2
|
require_relative 'API_client'
|
2
3
|
require_relative 'test_case_result'
|
3
|
-
require_relative 'test_rail_tools'
|
4
4
|
|
5
5
|
module TestRail
|
6
6
|
class Connection
|
7
7
|
|
8
|
-
ASSIGNED_TO ||=
|
9
|
-
TEST_SUITE ||=
|
10
|
-
CONNECTION_DATA ||=
|
11
|
-
PROJECT_ID ||=
|
12
|
-
TEST_RUN_ID ||=
|
13
|
-
IN_PROGRESS ||=
|
8
|
+
ASSIGNED_TO ||= TestRailDataLoad.test_rail_data[:assigned_to]
|
9
|
+
TEST_SUITE ||= TestRailDataLoad.test_rail_data[:test_suite]
|
10
|
+
CONNECTION_DATA ||= TestRailDataLoad.test_rail_data[:connection_data]
|
11
|
+
PROJECT_ID ||= TestRailDataLoad.test_rail_data[:project]
|
12
|
+
TEST_RUN_ID ||= TestRailDataLoad.test_rail_data[:test_run_id]
|
13
|
+
IN_PROGRESS ||= TestRailDataLoad.test_rail_data[:in_progress]
|
14
14
|
NO_TEST_RAIL ||= 0
|
15
15
|
|
16
16
|
#
|
@@ -17,9 +17,9 @@
|
|
17
17
|
:test_passed_comment: "test **passed**"
|
18
18
|
:test_failed_comment: "test **failed**"
|
19
19
|
|
20
|
-
:ventures: #values for generating parametrized url for running test
|
21
|
-
:environments: #values for generating parametrized url for running test
|
20
|
+
:ventures: /vn|id|ph|my|sg|th/ #values for generating parametrized url for running test
|
21
|
+
:environments: /live_test|staging|showroom/ #values for generating parametrized url for running test
|
22
22
|
|
23
23
|
:in_progress: " (in progress)" #value for changing test run name for monitoring complete of test run
|
24
24
|
|
25
|
-
:test_run_id: 0 #parametrized test run from "ruby run_test_run.rb <
|
25
|
+
:test_run_id: 0 #parametrized test run from "ruby run_test_run.rb <test run number>"
|
@@ -9,17 +9,26 @@ module TestRailIntegration
|
|
9
9
|
|
10
10
|
desc "Generates files that contains information about TestRail"
|
11
11
|
|
12
|
+
#
|
13
|
+
# Obtaining path of project folder
|
14
|
+
#
|
12
15
|
def self.source_root
|
13
16
|
File.dirname(__FILE__)
|
14
17
|
end
|
15
18
|
|
19
|
+
#
|
20
|
+
# Checking existence of tes trail data file
|
21
|
+
#
|
16
22
|
def self.test_rail_data_file_exist?
|
17
23
|
File.exists?("config/data/test_rail_data.yml")
|
18
24
|
end
|
19
25
|
|
26
|
+
#
|
27
|
+
# Copying templates for using for accessing to testrail
|
28
|
+
#
|
20
29
|
def self.copy_file(file_name, root = nil)
|
21
30
|
if file_name == "test_rail_data.yml"
|
22
|
-
FileUtils.
|
31
|
+
FileUtils.mkdir_p("config/data")
|
23
32
|
end
|
24
33
|
if root
|
25
34
|
FileUtils.cp("#{source_root}/project/#{file_name}", "#{root}/#{file_name}")
|
@@ -1,16 +1,16 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'test_rail_data_load'
|
2
2
|
|
3
3
|
module TestRail
|
4
4
|
class TestCaseResult
|
5
5
|
|
6
6
|
attr_accessor :test_case_id, :title, :comment, :exception_message
|
7
7
|
|
8
|
-
COMMENT_STATUS ||= TestRail::
|
9
|
-
PASS ||= TestRail::
|
10
|
-
FAILED ||= TestRail::
|
11
|
-
NEW ||= TestRail::
|
12
|
-
PASS_COMMENT ||= TestRail::
|
13
|
-
FAILED_COMMENT ||= TestRail::
|
8
|
+
COMMENT_STATUS ||= TestRail::TestRailDataLoad.test_rail_data[:status_comment]
|
9
|
+
PASS ||= TestRail::TestRailDataLoad.test_rail_data[:test_pass]
|
10
|
+
FAILED ||= TestRail::TestRailDataLoad.test_rail_data[:test_failed]
|
11
|
+
NEW ||= TestRail::TestRailDataLoad.test_rail_data[:new_test]
|
12
|
+
PASS_COMMENT ||= TestRail::TestRailDataLoad.test_rail_data[:test_passed_comment]
|
13
|
+
FAILED_COMMENT ||= TestRail::TestRailDataLoad.test_rail_data[:test_failed_comment]
|
14
14
|
|
15
15
|
COMMENT ||= { :pass => { status: PASS, comment: PASS_COMMENT },
|
16
16
|
:fail => { status: FAILED, comment: FAILED_COMMENT },
|
@@ -22,6 +22,11 @@ module TestRail
|
|
22
22
|
self.title = title
|
23
23
|
end
|
24
24
|
|
25
|
+
#
|
26
|
+
# Send status to TestRail
|
27
|
+
#
|
28
|
+
# {status_id: 1, comment: "Test passed"}
|
29
|
+
#
|
25
30
|
def to_test_rail_api
|
26
31
|
comment_message = "\"#{self.title}\" #{self.comment[:comment]}"
|
27
32
|
comment_message += "\n Exception : #{self.exception_message}" unless self.exception_message.nil?
|
File without changes
|
@@ -1,16 +1,19 @@
|
|
1
|
-
|
1
|
+
require_relative 'test_rail_data_load'
|
2
2
|
require_relative 'connection'
|
3
3
|
require_relative 'test_run_parameters'
|
4
4
|
|
5
5
|
module TestRail
|
6
6
|
class TestRailTools
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
#
|
9
|
+
# Method generates executable cucumber file
|
10
|
+
#
|
11
|
+
# generate_cucumber_execution_file(2)
|
12
|
+
#
|
13
|
+
# cucumber -p lazada.vn.live_test TESTRAIL=1 --color -f json -o cucumber.json -t @C6162,@C6163,@C6164
|
14
|
+
#
|
15
|
+
# change this method for create your own cucumber executable
|
16
|
+
#
|
14
17
|
def self.generate_cucumber_execution_file(id_of_run)
|
15
18
|
parameters = TestRunParameters.new
|
16
19
|
command = "cucumber -p lazada.#{parameters.venture}.#{parameters.environment} TESTRAIL=1 --color -f json -o cucumber.json -t " + Connection.cases_id(id_of_run).map { |id| "@C"+id.to_s }.join(",")
|
@@ -21,13 +24,19 @@ module TestRail
|
|
21
24
|
cucumber_file.close
|
22
25
|
end
|
23
26
|
|
27
|
+
#
|
28
|
+
# Writing test run ID into test rail data file
|
29
|
+
#
|
24
30
|
def self.write_test_run_id(test_run_id)
|
25
|
-
|
31
|
+
test_rail_data_file = File.read(CONFIG_PATH).gsub(/^:test_run_id: \d+/, ":test_run_id: #{test_run_id}")
|
26
32
|
config_file = File.open(CONFIG_PATH, "w")
|
27
|
-
config_file.write (
|
33
|
+
config_file.write (test_rail_data_file)
|
28
34
|
config_file.close
|
29
35
|
end
|
30
36
|
|
37
|
+
#
|
38
|
+
# Preparation for create right cucumber executable file
|
39
|
+
#
|
31
40
|
def self.prepare_config(run_id)
|
32
41
|
Connection.test_run_id = run_id
|
33
42
|
write_test_run_id(run_id)
|
@@ -2,11 +2,14 @@ require_relative 'API_client'
|
|
2
2
|
|
3
3
|
module TestRail
|
4
4
|
class TestRunParameters
|
5
|
-
VENTURE_REGEX ||=
|
6
|
-
ENVIRONMENT_REGEX ||=
|
5
|
+
VENTURE_REGEX ||= TestRail::TestRailDataLoad.test_rail_data[:ventures]
|
6
|
+
ENVIRONMENT_REGEX ||= TestRail::TestRailDataLoad.test_rail_data[:environments]
|
7
7
|
|
8
8
|
attr_accessor :environment, :venture
|
9
9
|
|
10
|
+
#
|
11
|
+
# Checking of correct naming of created test run and return parameters for runnng test run
|
12
|
+
#
|
10
13
|
def initialize
|
11
14
|
parameters = Connection.test_run_name.downcase.match(/^(#{VENTURE_REGEX}) (#{ENVIRONMENT_REGEX})*/)
|
12
15
|
begin
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_rail_integration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.5
|
4
|
+
version: 0.0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirikami
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- lib/test_rail_integration/generator/project/run_test_run.rb
|
90
90
|
- lib/test_rail_integration/generator/project/test_rail_data.yml
|
91
91
|
- lib/test_rail_integration/generator/test_case_result.rb
|
92
|
+
- lib/test_rail_integration/generator/test_rail_data_load.rb
|
92
93
|
- lib/test_rail_integration/generator/test_rail_hooks.rb
|
93
94
|
- lib/test_rail_integration/generator/test_rail_tools.rb
|
94
95
|
- lib/test_rail_integration/generator/test_run_parameters.rb
|
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
version: '0'
|
115
116
|
requirements: []
|
116
117
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
118
|
+
rubygems_version: 2.4.5
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
121
|
summary: Gem for integration between framework and TestRail API
|