trail_marker 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 6fa914ab38fc9f73fade971a9e1e17dc73e33ef783d5e3f9af270ba3286f3c55
4
- data.tar.gz: 08400303f17caa576dd2b1407270d0b6f35e7ac732adfdbf63a8b6cb5b3dce99
3
+ metadata.gz: 268d2189b65924504ec56882c5f41935a2bb4ebc634c3e56ab74112cda115d1c
4
+ data.tar.gz: d9d811429122cec9670ebb65a91e6354349e0cec5d48aca1a0e16eb9146804af
5
5
  SHA512:
6
- metadata.gz: 1794d8f73ad47fd2b3e0bc018e543648e55fe2c0b8b7a15205d89430320cf4ca9903e3b6df1488c326885e05c2e593aa0062031e542b2d6eedb82edcca2aa110
7
- data.tar.gz: 538c4eeaa7ea4a96bb14db0cb70a8abaf39634dd42d6dd58144e9ddbef0c47e7fbee426896eaf0dceb1bf0406041cc61179670ca2fdb7ab5d2a51dcecea51719
6
+ metadata.gz: 340256c5aa5001667425989601cd697b560350042a4d9e27b8a4d48b2b874ef8cb333039f616343cc0920cafe1934643f6af128bd09c10a71053e9a11089dd4a
7
+ data.tar.gz: 91424b1e940cf936025ffc8ca75763f6765ac9e875fa54742bcf9c941a9cade684e062c8eb4d84c950e85a8e867dd7aad26fb7f645636faa38ba188f7cc3c4a6
@@ -328,37 +328,4 @@ class ApiTestRail
328
328
  end
329
329
  return retval
330
330
  end
331
-
332
-
333
- # NOTE: MARK_TEST_PLAN
334
- # User Input: Project Name, TestRun Name
335
- # Project Name > Get project_id
336
- # Call API get_plans/project_id to get all test plans for the project
337
- # Get testplan_id of testplan with the given name
338
- # Call API get_plan/testplan_id to get testruns inside this testplan
339
- #
340
-
341
-
342
-
343
-
344
-
345
- ############### DELETE THESE NOT USED
346
-
347
- # TODO: Parse XML for failed reason and add to comment(?)
348
- #
349
- # def markoff_test(case_id, run_id, pass_status)
350
- # status_id = search_array_kv(@statuses, 'name', 'failed', 'id')
351
- # defect_txt = ""
352
- # if pass_status
353
- # status_id = search_array_kv(@statuses, 'name', 'passed', 'id')
354
- # defect_txt = ""
355
- # end
356
- # equiv_json = {:status_id => status_id, :comment => 'Auto marker.', :defects => defect_txt}
357
- # add_result_req = "add_result_for_case/" + run_id.to_s + "/" + case_id.to_s
358
- # request_post(add_result_req, equiv_json)
359
- # end
360
- #
361
-
362
-
363
-
364
331
  end
@@ -220,7 +220,7 @@ class Argument
220
220
 
221
221
  if !params_good || ! has_atleast_one || ! has_only_one
222
222
  puts "#{REQUIRED}"
223
- exit(1)
223
+ exit(0)
224
224
  end
225
225
 
226
226
  end
@@ -26,7 +26,7 @@ class ConfigFile
26
26
  end
27
27
  if atmps >= 3
28
28
  puts "\nERROR: Value cannot be empty... exiting."
29
- exit(1)
29
+ exit(0)
30
30
  end
31
31
  return retval
32
32
  end
@@ -8,12 +8,34 @@ class MarkTests
8
8
  def initialize(argobj, config_filename)
9
9
  @argument = argobj
10
10
  cf = ConfigFile.new(config_filename)
11
- cf.check_create_configfile
11
+ if !@argument.arg_exists?('-u') || !@argument.arg_exists?('-p')
12
+ cf.check_create_configfile
13
+ end
12
14
  @user = @argument.get_arg_value('-u') == '' ? cf.username : @argument.get_arg_value('-u')
13
15
  @token = @argument.get_arg_value('-pw') == '' ? cf.token : @argument.get_arg_value('-pw')
14
16
  @url = @argument.get_arg_value('-url') == '' ? cf.testrail_url : @argument.get_arg_value('-url')
15
17
  @default_comment = @argument.get_arg_value('-com') == '' ? cf.default_comment : @argument.get_arg_value('-com')
16
- puts "VALUES: #{@user} #{@token}"
18
+
19
+ unless check_all_required_values
20
+ puts "Missing Required Parameters, exiting."
21
+ exit 0
22
+ end
23
+ end
24
+
25
+ def check_all_required_values
26
+ if is_empty_or_nil?(@user)
27
+ return false
28
+ end
29
+ if is_empty_or_nil?(@token)
30
+ return false
31
+ end
32
+ if is_empty_or_nil?(@url)
33
+ return false
34
+ end
35
+ if is_empty_or_nil?(@default_comment)
36
+ return false
37
+ end
38
+ true
17
39
  end
18
40
 
19
41
  # If user name and password (or token) are passed in the command line arguments
@@ -163,6 +185,11 @@ class MarkTests
163
185
 
164
186
  def show_exit_msg
165
187
  puts "\n#{EXIT_MSG}\n"
188
+ exit 0
189
+ end
190
+
191
+ def is_empty_or_nil?(vale)
192
+ vale.to_s.empty?
166
193
  end
167
194
 
168
195
 
@@ -80,7 +80,7 @@ class Request
80
80
 
81
81
  def exit_script()
82
82
  msg("Exiting script.")
83
- exit(1)
83
+ exit(0)
84
84
  end
85
85
 
86
86
  def msg(msg_txt)
@@ -115,7 +115,7 @@ class Request
115
115
  max_attempts_str = "maximum number of failed"
116
116
  if response_hash[:response].include?(failed_str) || response_hash[:response].include?(max_attempts_str)
117
117
  puts "Cannot authenticate User or password.\n"
118
- exit(1)
118
+ exit(0)
119
119
  end
120
120
  end
121
121
 
@@ -24,7 +24,7 @@ class ResultsParser
24
24
  puts "ERROR: Cannot find the XML results directory or file:"
25
25
  puts " #{xml_loc}"
26
26
  puts " Please check the path of the directory where the results are located.\n\n"
27
- exit(1)
27
+ exit(0)
28
28
  end
29
29
  end
30
30
 
@@ -1,3 +1,3 @@
1
1
  module TrailMarker
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trail_marker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ibarra Alfonso
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-19 00:00:00.000000000 Z
11
+ date: 2018-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: os