zephyr_ruby 0.1.0 → 0.5.1
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 +4 -4
- data/.rubocop.yml +6 -0
- data/README.md +3 -8
- data/lib/zephyr_ruby/client.rb +8 -1
- data/lib/zephyr_ruby/connection.rb +15 -2
- data/lib/zephyr_ruby/resource/automations.rb +6 -6
- data/lib/zephyr_ruby/resource/test_executions.rb +20 -0
- data/lib/zephyr_ruby/version.rb +1 -1
- data/zephyr_ruby-0.4.0.gem +0 -0
- data/zephyr_ruby-0.5.0.gem +0 -0
- metadata +12 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a3b3bab61cc2f4029d887a6b628e0efba253fa675fed3bee61d4fbdb8b68911
|
4
|
+
data.tar.gz: 6718dd0d341673673b00ac9c0089eef7f2eecdd13202250b21d52d4115827b3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a0a806a2d95fa89f4cb074dbbc1bdfd12e0c7f04eb83f0f5a36734d084f62f427000e6513da7775653be66c395872aa5a689371062040d17a0b3e67892da83d
|
7
|
+
data.tar.gz: e6335fd4cb30b53b0be7fea62c08211392b7d9c6a8afec71fbba80106a987861faad286a2f6510df72e0d0d9ad3e07c8f2601179ed8e2618c943fb37f5e4dd69
|
data/.rubocop.yml
ADDED
data/README.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# ZephyrRuby
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/zephyr_ruby`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
3
|
## Installation
|
6
4
|
|
7
5
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -14,19 +12,16 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
14
12
|
|
15
13
|
## Usage
|
16
14
|
|
17
|
-
|
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).
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
require 'zephyr_ruby'
|
21
21
|
|
22
22
|
@client = ZephyrRuby::Client.new('YOUR_API_KEY')
|
23
|
-
|
24
|
-
puts @client.list_test_cases
|
25
23
|
```
|
26
24
|
|
27
|
-
## Links to Zephyr Scale REST API Documentation
|
28
|
-
- [Overview](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#section/Introduction)
|
29
|
-
|
30
25
|
## Development
|
31
26
|
|
32
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.
|
data/lib/zephyr_ruby/client.rb
CHANGED
@@ -4,6 +4,7 @@ require_relative 'resource/automations'
|
|
4
4
|
require_relative 'resource/environments'
|
5
5
|
require_relative 'resource/folders'
|
6
6
|
require_relative 'resource/healthcheck'
|
7
|
+
require_relative 'resource/issue_links'
|
7
8
|
require_relative 'resource/links'
|
8
9
|
require_relative 'resource/priorities'
|
9
10
|
require_relative 'resource/projects'
|
@@ -15,6 +16,7 @@ require_relative 'resource/test_plans'
|
|
15
16
|
require_relative 'connection'
|
16
17
|
|
17
18
|
require 'faraday'
|
19
|
+
require 'faraday/multipart'
|
18
20
|
require 'json'
|
19
21
|
|
20
22
|
module ZephyrRuby
|
@@ -24,6 +26,7 @@ module ZephyrRuby
|
|
24
26
|
include ZephyrRuby::Client::Resource::Environments
|
25
27
|
include ZephyrRuby::Client::Resource::Folders
|
26
28
|
include ZephyrRuby::Client::Resource::HealthCheck
|
29
|
+
include ZephyrRuby::Client::Resource::IssueLinks
|
27
30
|
include ZephyrRuby::Client::Resource::Links
|
28
31
|
include ZephyrRuby::Client::Resource::Priorities
|
29
32
|
include ZephyrRuby::Client::Resource::Projects
|
@@ -37,7 +40,11 @@ module ZephyrRuby
|
|
37
40
|
def initialize(api_token)
|
38
41
|
@base_url = 'https://api.zephyrscale.smartbear.com/v2'
|
39
42
|
@api_token = api_token
|
40
|
-
@client = Faraday.new(@base_url
|
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
|
41
48
|
@headers = {
|
42
49
|
'Authorization' => "Bearer #{@api_token}",
|
43
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
|
-
|
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
|
|
@@ -5,16 +5,16 @@ module ZephyrRuby
|
|
5
5
|
module Resource
|
6
6
|
# Operations related to Automations
|
7
7
|
module Automations
|
8
|
-
def create_automation_custom(body)
|
9
|
-
post '/automations/executions/custom', body
|
8
|
+
def create_automation_custom(body, file_path = nil)
|
9
|
+
post '/automations/executions/custom', body, file_path
|
10
10
|
end
|
11
11
|
|
12
|
-
def create_automation_cucumber(body)
|
13
|
-
post '/automations/executions/cucumber', body
|
12
|
+
def create_automation_cucumber(body, file_path = nil)
|
13
|
+
post '/automations/executions/cucumber', body, file_path
|
14
14
|
end
|
15
15
|
|
16
|
-
def create_automation_junit(body)
|
17
|
-
post '/automations/executions/junit', body
|
16
|
+
def create_automation_junit(body, file_path = nil)
|
17
|
+
post '/automations/executions/junit', body, file_path
|
18
18
|
end
|
19
19
|
|
20
20
|
def get_zip_file(params = {})
|
@@ -24,6 +24,26 @@ 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 create_test_execution_issue_link(test_execution_id, body)
|
45
|
+
post "/testexecutions/#{test_execution_id}/links/issues", body
|
46
|
+
end
|
27
47
|
end
|
28
48
|
end
|
29
49
|
end
|
data/lib/zephyr_ruby/version.rb
CHANGED
Binary file
|
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.1
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.7'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 1.7.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '1.7'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 1.7.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: json
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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,9 @@ files:
|
|
99
100
|
- lib/zephyr_ruby/resource/test_plans.rb
|
100
101
|
- lib/zephyr_ruby/version.rb
|
101
102
|
- sig/zephyr_ruby.rbs
|
102
|
-
|
103
|
+
- zephyr_ruby-0.4.0.gem
|
104
|
+
- zephyr_ruby-0.5.0.gem
|
105
|
+
homepage: https://github.com/cdavis-personal/zephyr_ruby
|
103
106
|
licenses:
|
104
107
|
- MIT
|
105
108
|
metadata: {}
|
@@ -111,14 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
114
|
requirements:
|
112
115
|
- - ">="
|
113
116
|
- !ruby/object:Gem::Version
|
114
|
-
version:
|
117
|
+
version: '3.0'
|
115
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
119
|
requirements:
|
117
120
|
- - ">="
|
118
121
|
- !ruby/object:Gem::Version
|
119
122
|
version: '0'
|
120
123
|
requirements: []
|
121
|
-
rubygems_version: 3.2.
|
124
|
+
rubygems_version: 3.2.3
|
122
125
|
signing_key:
|
123
126
|
specification_version: 4
|
124
127
|
summary: Zephyr REST API Client for Ruby
|