Class: CiToolkit::SeeTestClient

Inherits:
Object
  • Object
show all
Defined in:
lib/ci_toolkit/seetest_client.rb

Overview

A client for Seetest webservice. See API doc for more info: docs.experitest.com/display/PM/How+To+Execute+Rest+API

Constant Summary collapse

SUCCESS =
"SUCCESS"
OKAY =
"OK"
ERROR =
"ERROR"
API_VERSION =
"v1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bot = CiToolkit::SeeTestBot.new) ⇒ SeeTestClient

Returns a new instance of SeeTestClient.



17
18
19
# File 'lib/ci_toolkit/seetest_client.rb', line 17

def initialize(bot = CiToolkit::SeeTestBot.new)
  @faraday_conn = bot.faraday_conn
end

Instance Attribute Details

#faraday_connObject (readonly)

Returns the value of attribute faraday_conn.



15
16
17
# File 'lib/ci_toolkit/seetest_client.rb', line 15

def faraday_conn
  @faraday_conn
end

Instance Method Details

#upload_file(project_name:, unique_name:, full_path_to_file:, content_type: "application/octet-stream") ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ci_toolkit/seetest_client.rb', line 21

def upload_file(
  project_name:,
  unique_name:,
  full_path_to_file:,
  content_type: "application/octet-stream"
)

  response = upload_or_replace(project_name, unique_name, full_path_to_file, content_type)

  unless response["status"] == SUCCESS
    raise StandardError,
          "Upload response from Seetest returned an error. Response body is: '#{response}'"
  end

  response["status"]
end