Class: QAT::Reporter::Opentest::Publisher::Hosted
- Defined in:
- lib/qat/reporter/opentest/publisher/hosted.rb
Instance Attribute Summary
Attributes inherited from Base
#actor_tags, #base_url, #bearer, #environment, #evidences, #session_id, #session_label, #tests
Instance Method Summary collapse
- #auth_token ⇒ Object
-
#create_session ⇒ Object
Create a session in openTest.
-
#session_details ⇒ Object
Get session details by sessionID.
-
#session_logs(format) ⇒ Object
Get session log by sessionID.
Methods inherited from Base
Constructor Details
This class inherits a constructor from QAT::Reporter::Opentest::Publisher::Base
Instance Method Details
#auth_token ⇒ Object
11 12 13 14 15 16 |
# File 'lib/qat/reporter/opentest/publisher/hosted.rb', line 11 def auth_token return @auth_token if @auth_token @auth_token = { Authorization: "Bearer #{bearer}" } end |
#create_session ⇒ Object
Create a session in openTest
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/qat/reporter/opentest/publisher/hosted.rb', line 20 def create_session payload = { actorTags: , environment: environment, maxIterations: 1, sessionLabel: session_label, tests: tests } headers = { 'Content-Type': 'application/json', 'X-Username': 'qat' }.merge(auth_token) puts payload.to_json Client.new(base_url).post("/api/session?showImages=#{evidences}", payload.to_json, headers) end |
#session_details ⇒ Object
Get session details by sessionID
39 40 41 42 |
# File 'lib/qat/reporter/opentest/publisher/hosted.rb', line 39 def session_details headers = { 'Content-Type': 'application/json' }.merge(auth_token) Client.new(base_url).get("/api/session/#{session_id}", headers) end |
#session_logs(format) ⇒ Object
Get session log by sessionID
46 47 48 49 |
# File 'lib/qat/reporter/opentest/publisher/hosted.rb', line 46 def session_logs(format) headers = { 'Content-Type': 'application/json' }.merge(auth_token) Client.new(base_url).get("/api/session/#{session_id}/log?format=#{format}", headers) end |