testrail_helper 0.0.11 → 0.0.12

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: 60e1c9ce5dd384048d582e7938cca5e152c7d0bc
4
- data.tar.gz: 735666bb9641e42b66ce27c6e3beaa53eb49eee7
3
+ metadata.gz: 6d6634c6fb2d92e6d6d45474c9a26a081223f82e
4
+ data.tar.gz: 0b3b077adf85d5b5a17af8323e30f64b14cd2334
5
5
  SHA512:
6
- metadata.gz: 25364b7df76e529dd589f28a61aa555f1f58ea65d508670e6f89f857360e3902b6343235ec7063e6413a4b0e9ee45c0b7348ea7510a258a32a8620679eb089ba
7
- data.tar.gz: bb7932602a1b74fdf0d630b18b68542deb3c2c60d170a243d8ad6c0ba88f61fe973e7a2fe0b7840d17df1bcf627cc082ba4e22ec2d89d979337d47b43d1482bd
6
+ metadata.gz: b7ba43e9934d8868c588b5a4c2e21c6618273c8d5afc7644c5e7f2a66dfd2ccc0ee0bbb94d173898c95908c5cb180b42918a28cc57dba195f73119531fd15908
7
+ data.tar.gz: a97129e4b9ebf49483b5661b8e908cc42833ed71848e438af518a4190415f4cdb0e08a4d0547250d9195123831b30d415c3d170719d63e57daa30914fd399e8b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testrail_helper (0.0.11)
4
+ testrail_helper (0.0.12)
5
5
  json
6
6
  testrail_client
7
7
 
data/README.md CHANGED
@@ -62,6 +62,14 @@ client.get_user_by_email("guybrush@SCUMM.com)
62
62
 
63
63
  # get sections
64
64
  client.get_sections(project_id, suite_id)
65
+
66
+ # create test plan
67
+ client.create_test_plan(34, name: 'test plan')
68
+
69
+ # create test plan entry
70
+ client.add_plan_entry(432, suite_id: 2, name: 'run name', include_all: false, case_ids: [1, 2, 3])
71
+
72
+
65
73
  ```
66
74
 
67
75
  ## Development
@@ -1,4 +1,4 @@
1
- require 'testrail_helper'
1
+ require 'testrail_client'
2
2
  require 'json'
3
3
 
4
4
  require File.expand_path(File.dirname(__FILE__) + '/testrail_api')
@@ -24,6 +24,7 @@ module TestrailHelper
24
24
  uri = "get_cases/#{params[:project_id]}&suite_id=#{params[:project_id]}"
25
25
  uri = uri + "&suite_id=#{params[:suite_id]}" if params[:suite_id]
26
26
  uri = uri + "&section_id=#{params[:section_id]}" if params[:section_id]
27
+ uri = uri + "&priority_id=#{params[:priority_id]}" if params[:priority_id]
27
28
  @client.send_get(uri)
28
29
  end
29
30
 
@@ -81,7 +82,7 @@ module TestrailHelper
81
82
  params.merge({title:get_title(case_id)})
82
83
  puts params
83
84
  uri = "update_case/#{case_id}"
84
- puts @client.send_post(uri,params)
85
+ puts @client.send_post(uri, params)
85
86
  end
86
87
 
87
88
  def get_all_users
@@ -145,5 +146,15 @@ module TestrailHelper
145
146
  uri = "get_sections/#{project_id}&suite_id=#{suite_id}"
146
147
  @client.send_get(uri)
147
148
  end
149
+
150
+ def create_test_plan(project_id, params={})
151
+ uri = "add_plan/#{project_id}"
152
+ @client.send_post(uri, params)
153
+ end
154
+
155
+ def add_plan_entry(plan_id, params={})
156
+ uri = "add_plan_entry/#{plan_id}"
157
+ @client.send_post(uri, params)
158
+ end
148
159
  end
149
160
  end
@@ -1,3 +1,3 @@
1
1
  module TestrailHelper
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
data/test.rb CHANGED
@@ -5,7 +5,7 @@ client = TestrailHelper::Client.new(username:'',password: '',url: 'https://blarg
5
5
 
6
6
  # get a list of test cases by passing in the suite_id and section_id
7
7
  cases = client.get_all_test_cases_in_section(suite_id: "729", section_id: "8")
8
- cases = client.get_test_cases(suite_id: "10685", project_id: "34")
8
+ cases = client.get_test_cases(suite_id: "10685", project_id: "34", priority_id: 6)
9
9
 
10
10
  # filter your list down by various required fields. AND
11
11
  filtered_cases_with_and = client.filter_by_fields_and(cases,priority_id: 4, created_by: 34)
@@ -23,4 +23,16 @@ update_test_case(12345,priority_id:2,type_id:1)
23
23
  get_test_plan("5000")
24
24
  get_test_run("5001")
25
25
  get_results_for_run("5001")
26
- get_sections(34, 10685)
26
+ get_sections(34, 10685)
27
+
28
+ plan = client.create_test_plan(34, name: 'test plan')
29
+
30
+ client.add_plan_entry(plan['id'], suite_id: 10685, name: 'run name', include_all: true)
31
+
32
+ case_ids = []
33
+ cases.each do |caze|
34
+ case_ids << caze['id']
35
+ end
36
+
37
+ client.add_plan_entry(plan['id'], suite_id: 10685, name: 'run name', include_all: false, case_ids: case_ids)
38
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrail_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - kinezu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json