Class: Kanoah::Client
- Inherits:
-
Object
- Object
- Kanoah::Client
- Includes:
- HTTParty, Helper::TestCase, Services::Authentication, Services::IssueLink, Services::TestCase, Services::TestPlan, Services::TestResult, Services::TestRun
- Defined in:
- lib/client.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#test_run_id ⇒ Object
readonly
Returns the value of attribute test_run_id.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #set_access_token(token) ⇒ Object
Methods included from Helper::TestCase
Methods included from Services::TestRun
#get_run_details, #get_test_runs, #post_new_result_to_run, #post_new_test_run, #update_result_of_run
Methods included from Services::TestResult
Methods included from Services::TestPlan
Methods included from Services::TestCase
#get_test_case_details, #post_new_test_case, #search_test_cases
Methods included from Services::IssueLink
Methods included from Services::Authentication
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/client.rb', line 19 def initialize(={}) self.class.base_uri .fetch(:base_url) { Kanoah.config.base_url } @environment = .fetch(:environment) { Kanoah.config.environment } @test_run_id = .fetch(:test_run_id) { Kanoah.config.test_run_id } @project_id = .fetch(:project_id) { Kanoah.config.project_id } username = .fetch(:username) { Kanoah.config.username } password = .fetch(:password) { Kanoah.config.password } token = Base64.encode64(username+':'+password) set_access_token(token[0..-2]) end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
16 17 18 |
# File 'lib/client.rb', line 16 def project @project end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
16 17 18 |
# File 'lib/client.rb', line 16 def response @response end |
#test_run_id ⇒ Object (readonly)
Returns the value of attribute test_run_id.
16 17 18 |
# File 'lib/client.rb', line 16 def test_run_id @test_run_id end |
Instance Method Details
#set_access_token(token) ⇒ Object
30 31 32 |
# File 'lib/client.rb', line 30 def set_access_token(token) @header = { "Authorization" => "Basic #{token}", "Content-Type" => "application/json"} end |