zephyr_ruby 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f7a9f6f87f9381df9f8553af5bfa76989f11a314940de8c56d4af18be21a1b1
4
- data.tar.gz: 264147893390f27bea28befb18b3bec1df7300862dd3901791e402adbdaea3f9
3
+ metadata.gz: 549801e2026e853cf735c9d2cef973e9ca2059fe3b4733851854ef8cb9424862
4
+ data.tar.gz: 2afe0ae17007648df1b3d1005476b02dd102fd6456d5b39e5f80941f4891e782
5
5
  SHA512:
6
- metadata.gz: 4fb2abff6e2bfd923d256ef714542a14b4e7465c9837b64b58320eefc24ff1325cd811f5d8ce8449111ba5ae92847e76fcc15bbf3823f708f0911c973479e6d4
7
- data.tar.gz: 631e49ef125f097ef38aad283ce862fea5b4d341561d6a5fe62895ee7aa10d35fa2ee5e5ab5333faeaa8076fd6ba373d43e04e9f987a3a098ea08aedd491573e
6
+ metadata.gz: f79bee54080bdba9bcd91a99cdc822e41f0298ab4fccc4ba4c5e0256ad37de42a44487366f053a5b6262b0d19dca4af5f5b871c3e9628621c1bfe08c80f830a5
7
+ data.tar.gz: 0ce25005380c567adaa173be75f637262275b00a3eeb65f0226eb6f4c08fe315ffca0794af69d7a5dcd159dea86f3eaf442f955b4656a17b043cdf31dae49c0d
data/.rubocop.yml ADDED
@@ -0,0 +1,6 @@
1
+ Metrics/MethodLength:
2
+ Max: 13
3
+
4
+ AllCops:
5
+ NewCops: disable
6
+ TargetRubyVersion: 3.0
data/README.md CHANGED
@@ -12,7 +12,9 @@ If bundler is not being used to manage dependencies, install the gem by executin
12
12
 
13
13
  ## Usage
14
14
 
15
- This gem provides access to the Zephyr Scale REST API.
15
+ To get started all you need to do is set your zephyr API access token and instantiate the client.
16
+
17
+ For API endpoint usage see the official REST API documentation [here](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#section/Introduction).
16
18
 
17
19
  ```ruby
18
20
  require 'zephyr_ruby'
@@ -20,9 +22,6 @@ require 'zephyr_ruby'
20
22
  @client = ZephyrRuby::Client.new('YOUR_API_KEY')
21
23
  ```
22
24
 
23
- ## Zephyr Scale REST API Documentation
24
- - [Overview](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#section/Introduction)
25
-
26
25
  ## Development
27
26
 
28
27
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -16,6 +16,7 @@ require_relative 'resource/test_plans'
16
16
  require_relative 'connection'
17
17
 
18
18
  require 'faraday'
19
+ require 'faraday/multipart'
19
20
  require 'json'
20
21
 
21
22
  module ZephyrRuby
@@ -39,7 +40,11 @@ module ZephyrRuby
39
40
  def initialize(api_token)
40
41
  @base_url = 'https://api.zephyrscale.smartbear.com/v2'
41
42
  @api_token = api_token
42
- @client = Faraday.new(@base_url, builder: build_middleware)
43
+ @client = Faraday.new(@base_url) do |f|
44
+ f.request :multipart
45
+ f.request :url_encoded
46
+ f.adapter Faraday.default_adapter
47
+ end
43
48
  @headers = {
44
49
  'Authorization' => "Bearer #{@api_token}",
45
50
  'Content-Type' => 'application/json'
@@ -8,8 +8,21 @@ module ZephyrRuby
8
8
  request :get, path, params
9
9
  end
10
10
 
11
- def post(path, body)
12
- body = body.to_json if body.is_a?(Hash)
11
+ def post(path, body, file_path = nil)
12
+ if file_path
13
+ mime_type = case File.extname(file_path).downcase
14
+ when '.json' then 'application/json'
15
+ when '.xml' then 'application/xml'
16
+ when '.zip' then 'application/zip'
17
+ else 'application/octet-stream'
18
+ end
19
+
20
+ file = Faraday::UploadIO.new(file_path, mime_type)
21
+ body = { file: file }.merge(body) if body.is_a?(Hash)
22
+ elsif body.is_a?(Hash)
23
+ body = body.to_json
24
+ end
25
+
13
26
  request :post, path, body
14
27
  end
15
28
 
@@ -24,6 +24,30 @@ module ZephyrRuby
24
24
  def create_test_execution_link(test_execution_id, body)
25
25
  post "/testexecutions/#{test_execution_id}/links/issues", body
26
26
  end
27
+
28
+ def update_test_execution(test_execution_id, body)
29
+ put "/testexecutions/#{test_execution_id}", body
30
+ end
31
+
32
+ def get_test_steps(test_execution_id)
33
+ get "/testexecutions/#{test_execution_id}/teststeps"
34
+ end
35
+
36
+ def update_test_steps(test_execution_id, body)
37
+ put "/testexecutions/#{test_execution_id}/teststeps", body
38
+ end
39
+
40
+ def sync_test_execution(test_execution_id)
41
+ post "/testexecutions/#{test_execution_id}/teststeps/sync"
42
+ end
43
+
44
+ def get_test_execution_links(test_execution_id)
45
+ get "/testexecutions/#{test_execution_id}/links"
46
+ end
47
+
48
+ def create_test_execution_issue_link(test_execution_id, body)
49
+ post "/testexecutions/#{test_execution_id}/links/issues", body
50
+ end
27
51
  end
28
52
  end
29
53
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZephyrRuby
4
- VERSION = '0.3.0'
4
+ VERSION = '0.5.0'
5
5
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zephyr_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Davis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-26 00:00:00.000000000 Z
11
+ date: 2024-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -76,6 +76,7 @@ executables: []
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
+ - ".rubocop.yml"
79
80
  - CHANGELOG.md
80
81
  - Gemfile
81
82
  - LICENSE.txt
@@ -99,7 +100,8 @@ files:
99
100
  - lib/zephyr_ruby/resource/test_plans.rb
100
101
  - lib/zephyr_ruby/version.rb
101
102
  - sig/zephyr_ruby.rbs
102
- homepage: https://github.com/chrisdavis180/zephyr_ruby
103
+ - zephyr_ruby-0.4.0.gem
104
+ homepage: https://github.com/cdavis-personal/zephyr_ruby
103
105
  licenses:
104
106
  - MIT
105
107
  metadata: {}
@@ -111,14 +113,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
113
  requirements:
112
114
  - - ">="
113
115
  - !ruby/object:Gem::Version
114
- version: 2.6.0
116
+ version: '3.0'
115
117
  required_rubygems_version: !ruby/object:Gem::Requirement
116
118
  requirements:
117
119
  - - ">="
118
120
  - !ruby/object:Gem::Version
119
121
  version: '0'
120
122
  requirements: []
121
- rubygems_version: 3.2.33
123
+ rubygems_version: 3.2.3
122
124
  signing_key:
123
125
  specification_version: 4
124
126
  summary: Zephyr REST API Client for Ruby