testrail-cucumber 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/testrail-cucumber/update-testrails.rb +11 -10
- data/lib/testrail-cucumber/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fbd107751e5b18a212031362af080fc05b7e29bc2d2232a9ad7b777a4567ba1
|
4
|
+
data.tar.gz: 44b151e0c20e5c9b7e1137b9702066fd8b3c97722d3d0d5a7622a935bb031fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e23032a5947b3f5d361aa9a83cec1a8852dee3f596b0ce6f8bf71ef10ab97b19032bb89dd650085d279cee93ae0b45ab51810613690fea28dc1a10db2461694c
|
7
|
+
data.tar.gz: 21ea15b709926fa7c7ca992b435c31f92d5f6be0817b95ebe9279114f785b3f049bcf666c5cfb9ebee65082c80e24bf0f33dc1ccf34f7a6a12381d77c4553915
|
@@ -3,12 +3,20 @@ require_relative 'api-client'
|
|
3
3
|
module TestrailCucumber
|
4
4
|
class UpdateTestRails
|
5
5
|
attr_accessor :client
|
6
|
-
|
6
|
+
|
7
7
|
def initialize(scenario)
|
8
8
|
@scenario = scenario
|
9
9
|
|
10
10
|
if File.exist? './testrail_config.yml'
|
11
11
|
@config = YAML.load_file("./testrail_config.yml")['testrail']
|
12
|
+
|
13
|
+
@config = @config.transform_values do |e|
|
14
|
+
if e.class != Integer && e.to_s.include?('ENV[')
|
15
|
+
eval(e)
|
16
|
+
else
|
17
|
+
e
|
18
|
+
end
|
19
|
+
end
|
12
20
|
raise 'TestRail configuration file not loaded successfully' if @config.nil?
|
13
21
|
else
|
14
22
|
raise 'TestRail configuration file is required'
|
@@ -38,13 +46,9 @@ module TestrailCucumber
|
|
38
46
|
@run_id = @@run_id = client.create_test_run("add_run/#{@config['project_id']}", { "suite_id": @config['suite_id']}) if @run_id.nil?
|
39
47
|
|
40
48
|
case_list.map do |case_id|
|
41
|
-
|
42
|
-
response
|
43
|
-
"add_result_for_case/#{@run_id}/#{case_id}",
|
44
|
-
{ status_id: status_id }
|
45
|
-
)
|
49
|
+
response = client.send_post("add_result_for_case/#{@run_id}/#{case_id}",{ status_id: status_id })
|
50
|
+
warn("\n###################### \ninvalid #case_id: #{case_id} \n######################") if (response.nil? || response['error'] != nil) && (response.class != Integer)
|
46
51
|
end
|
47
|
-
|
48
52
|
response
|
49
53
|
end
|
50
54
|
|
@@ -106,9 +110,6 @@ module TestrailCucumber
|
|
106
110
|
warn("\n###################### \ninvalid #suite_id: #{id} \n######################") if client.send_get("get_suite/#{id}").nil? || client.send_get("get_suite/#{id}")['error'] != nil
|
107
111
|
when :run_id
|
108
112
|
warn("\n###################### \ninvalid #run_id: #{id} \n######################") if client.send_get("get_run/#{id}").nil? || client.send_get("get_run/#{id}")['error'] != nil
|
109
|
-
when :case_id
|
110
|
-
return if client.send_get("get_case/#{id}").class == Integer
|
111
|
-
warn("\n###################### \ninvalid #case_id: #{id} \n######################") if client.send_get("get_case/#{id}").nil? || client.send_get("get_case/#{id}")['error'] != nil
|
112
113
|
else
|
113
114
|
p "no config available"
|
114
115
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testrail-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prashanth Sams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|