Class: CiToolkit::SeeTestClient
- Inherits:
-
Object
- Object
- CiToolkit::SeeTestClient
- 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
-
#faraday_conn ⇒ Object
readonly
Returns the value of attribute faraday_conn.
Instance Method Summary collapse
-
#initialize(bot = CiToolkit::SeeTestBot.new) ⇒ SeeTestClient
constructor
A new instance of SeeTestClient.
- #upload_file(project_name:, unique_name:, full_path_to_file:, content_type: "application/octet-stream") ⇒ Object
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_conn ⇒ Object (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 |