zgen_client 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zgen_client.rb +28 -15
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d866687367e9374c56f191a7f410d645a89ab43a5697561af50f9ee8e40f1ca
4
- data.tar.gz: 7d14715cb85e5487aee2a5226aca370a578fe89aa0fbe36dc99f27e58ace2527
3
+ metadata.gz: 2dfa9dea47569861d4490e658cb09e2b67292d79db6560dfe28039b512a43901
4
+ data.tar.gz: 33178f3e0492fd2c87aed34390444676cc1dde0ffac693f84474f276581e2ea6
5
5
  SHA512:
6
- metadata.gz: 3bbb1d476c77c40d4aa774ffcd8aa41a3ae531e40dfb1b163803d1e92f67d6c8f80dc7c9f95b5778abdb488885beb2aba374f2b67927395baacd6a7bb06ae012
7
- data.tar.gz: d27d5af08e97c24505415ca5b0ba466bf0d962dca6c64ddf1978069c0155dd52e9b01e2f8a82ce28f67a8ffdbce63cbc561f21e87925a55d70c76a242d2c22a3
6
+ metadata.gz: 0f778a6dc0679b3fcd6cdc067997f43920c57ca3a55f6c48a4c3547d254309aa8f235c990bdcfabdda374e86ff18ea0933d417cdb37004a7f3b3c40195a5f458
7
+ data.tar.gz: bbfa857b4985070d03bb872cf6af0e44514002bc2fc2e6d31bfe7ebf28d6e532c6ab75b279be42662a8786ca23b266fcc80aa46ac3cc217179da820e649a910d
data/lib/zgen_client.rb CHANGED
@@ -4,12 +4,23 @@ require "uri"
4
4
  require "json"
5
5
  require "time"
6
6
 
7
- # The Zgen Client main class
7
+ # The Zgen Client main class.
8
8
  class ZgenClient
9
9
  @@users_login_endpoint = "users/login"
10
10
  @@test_execution_endpoint = "v1/Incident/TestCaseExecution"
11
11
  @@attachment_endpoint = "v1/Incident/attachment"
12
12
 
13
+ # Returns a new instance of ZgenClient.
14
+ #
15
+ # @param api_host [String] The host of the Knooly API such as IP address like 192.168.0.1 or knooly{-clientname}.keeggo.com.
16
+ # @param api_port [Integer] The API port per example 80 (default http port) or 443 (default https port).
17
+ # @param user_email [String] The user e-mail used to authenticate on API.
18
+ # @param user_password [String] The user password used to authenticate on API.
19
+ # @param user_customer_name [String] The customer name that is associated with the +user_email+.
20
+ # @param proxy_host [String] Pass the value of the proxy IP address if there is a proxy between you and the API. (Not required)
21
+ # @param proxy_port [Integer] The proxy port like 8080. (Not required)
22
+ # @param timeout [Integer] The amount of time in seconds for the client to read, write and connect to the API before timing out. (Not required)
23
+ # @param is_https [true, false] true, if the API address URL starts with https, otherwise false. (Not required)
13
24
  def initialize(api_host:, api_port:, user_email:, user_password:, user_customer_name:, proxy_host: nil, proxy_port: nil, timeout: 30, is_https: false)
14
25
  @api_host = api_host
15
26
  @api_port = api_port
@@ -25,17 +36,18 @@ class ZgenClient
25
36
  end
26
37
 
27
38
  # Create a test case result with the information passed from a test case.
28
- # @param project_id [Integer] the project id
29
- # @param execution_code [String] the execution code
30
- # @param cycle_start_date [String] The initial date of the project cycle
31
- # @param test_result_ok [true, false] true if the test passed
32
- # @param date [String] Date of test execution. Format: 2022-02-09 00:00:00
33
- # @param test_result_comments [String] Comments to assign to test result
34
- # @param tags [Array<String>] List of tags
35
- # @param incident_id [Integer] Incident id
36
- # @param status [String] Status
37
- # @param status_date [String] Status date
38
- # @return [String] Test result id
39
+ #
40
+ # @param project_id [Integer] The project id is generated when a project is registered in Knooly. For more information access +Help Knooly > Projetos > Criando um projeto de teste+ on Knooly documentation.
41
+ # @param execution_code [String] The execution code assigned to the scenario. This field is used in automated test integration and is available in scenario name. For more information access +Help Knooly > Projetos > Adicionando cobertura ao projeto+ on Knooly documentation.
42
+ # @param cycle_start_date [String] The initial date of the project cycle. It can be obtained from Knooly. For more information access +Help Knooly > Projetos > Definindo os ciclos de execução+ on Knooly documentation.
43
+ # @param test_result_ok [true, false] True if the scenario execution result was passed, otherwise false.
44
+ # @param date [String] Date of scenario test execution (generated in runtime). Format: 2022-02-09 00:00:00.
45
+ # @param test_result_comments [String] Comments to assign to test result. (Not required)
46
+ # @param tags [Array<String>] List of tags. (Not required)
47
+ # @param incident_id [Integer] Incident id. (Not required)
48
+ # @param status [String] Status. (Not required)
49
+ # @param status_date [String] Status date. (Not required)
50
+ # @return [String] Test result id.
39
51
  def post_test_execution(project_id:, execution_code:, cycle_start_date:, test_result_ok:, date:, test_result_comments: "", tags: [], incident_id: nil, status: nil, status_date: nil)
40
52
  url = "#{build_base_url()}/#{@@test_execution_endpoint}"
41
53
  headers = { :Authorization => "Bearer #{get_token()}", content_type: "application/json" }
@@ -44,9 +56,10 @@ class ZgenClient
44
56
  JSON.parse(response.body)["testResultID"]
45
57
  end
46
58
 
47
- # An attachment is persisted to the result of a test case.
48
- # @param test_result_id [String] Test result id
49
- # @param evidence [File] Evidence file
59
+ # Send an attachment as the evidence of a test execution result that was previosly saved using {#post_test_execution}.
60
+ #
61
+ # @param test_result_id [String] Test result id returned from the method {#post_test_execution}
62
+ # @param evidence [File] The attachment file to send. It can be an image, pdf or video file per example.
50
63
  # @return [String] Attachment id
51
64
  def post_attachment(test_result_id:, evidence:)
52
65
  url = "#{build_base_url()}/#{@@attachment_endpoint}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zgen_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Silva Sousa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-10 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.2.32
73
+ rubygems_version: 3.3.7
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Zgen Client