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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbe2e2f64eac4da64edc9db1cb1297f08ab945b3
4
- data.tar.gz: 84c6d54289552e5a24eb1c2949ae74708f29e9af
3
+ metadata.gz: 5478e38a8277295f0d5a2533c06cd6948e0214a5
4
+ data.tar.gz: 3b5426cab43889eef9b58372065585eba1c68052
5
5
  SHA512:
6
- metadata.gz: e71eb44a406958b6d1befba998283015771d66db35c2da60f22a04a7d38393455980820cb3325b0b9bc868e07f8ab113ad147aeb19b13437b056923d8b028d22
7
- data.tar.gz: 60ddd527aa433f40126ad646efb721bf9e4ade577540bb12864fa2d9d57c4715804df08b6d11cc19466c058ff48fe950f98641202580359d74c7f6408d8d4605
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
File without changes
@@ -7,6 +7,7 @@ module TestRailIntegration
7
7
 
8
8
  def perform
9
9
  TestRailIntegration::TestTail::Generators::Project.copy_file('run_test_run.rb')
10
+ TestRailIntegration::TestTail::Generators::Project.copy_file("test_rail_data.yml", "config/data/")
10
11
  end
11
12
  end
12
13
  end
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 ||= TestRailTools.test_rail_data[:assigned_to]
9
- TEST_SUITE ||= TestRailTools.test_rail_data[:test_suite]
10
- CONNECTION_DATA ||= TestRailTools.test_rail_data[:connection_data]
11
- PROJECT_ID ||= TestRailTools.test_rail_data[:project]
12
- TEST_RUN_ID ||= TestRailTools.test_rail_data[:test_run_id]
13
- IN_PROGRESS ||= TestRailTools.test_rail_data[: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
  #
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ require '../../generator/test_rail_data_load'
2
3
  require 'test_rail_integration'
3
4
  require 'thor'
4
5
  require 'test_rail_integration/generator/API_client'
@@ -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 <testrun number>"
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.mkdir("config/data")
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 'test_rail_tools'
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::TestRailTools.test_rail_data[:status_comment]
9
- PASS ||= TestRail::TestRailTools.test_rail_data[:test_pass]
10
- FAILED ||= TestRail::TestRailTools.test_rail_data[:test_failed]
11
- NEW ||= TestRail::TestRailTools.test_rail_data[:new_test]
12
- PASS_COMMENT ||= TestRail::TestRailTools.test_rail_data[:test_passed_comment]
13
- FAILED_COMMENT ||= TestRail::TestRailTools.test_rail_data[:test_failed_comment]
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?
@@ -0,0 +1,14 @@
1
+ require 'yaml'
2
+
3
+ module TestRail
4
+ class TestRailDataLoad
5
+ CONFIG_PATH ||= ('config/data/test_rail_data.yml')
6
+
7
+ #
8
+ # Loading of test rail information
9
+ #
10
+ def self.test_rail_data
11
+ YAML.load(File.open(CONFIG_PATH))
12
+ end
13
+ end
14
+ end
@@ -1,16 +1,19 @@
1
- require 'yaml'
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
- CONFIG_PATH ||= ('config/data/test_rail_data.yml')
9
-
10
- def self.test_rail_data
11
- YAML.load(File.open(CONFIG_PATH))
12
- end
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
- testrail_data_file = File.read(CONFIG_PATH).gsub(/^:test_run_id: \d+/, ":test_run_id: #{test_run_id}")
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 (testrail_data_file)
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 ||= /vn|id|ph|my|sg|th/
6
- ENVIRONMENT_REGEX ||= /live_test|staging|showroom/
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
@@ -1,3 +1,3 @@
1
1
  module TestRailIntegration
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.5.1"
3
3
  end
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: 2014-12-26 00:00:00.000000000 Z
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.2.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