Class: TestdroidApi::Client::Project::TestRun
- Inherits:
-
Object
- Object
- TestdroidApi::Client::Project::TestRun
- Defined in:
- lib/testdroid-api/client/project/test_run.rb,
lib/testdroid-api/client/project/test_run/device_run.rb
Defined Under Namespace
Classes: DeviceRun
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#device_runs ⇒ Array<TestdroidApi::Client::TestRun::DeviceRun>
Returns devices that the run was executed on.
-
#finished? ⇒ Boolean
Did test run finish.
-
#initialize(client, project, config) ⇒ TestRun
constructor
A new instance of TestRun.
-
#junit_results_zip ⇒ Object
Get test run’s junit results as a zip file.
-
#logs_zip ⇒ Object
Get test run’s logs as a zip file.
- #results ⇒ Object
-
#screenshots_zip ⇒ Object
Get test run’s screenshots as a zip file.
-
#update! ⇒ Object
Updates test_run information.
Constructor Details
#initialize(client, project, config) ⇒ TestRun
Returns a new instance of TestRun.
7 8 9 10 11 12 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 7 def initialize(client, project, config) @client = client @project_id = project.id update(config) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 6 def name @name end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
6 7 8 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 6 def project_id @project_id end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 6 def state @state end |
Instance Method Details
#device_runs ⇒ Array<TestdroidApi::Client::TestRun::DeviceRun>
Returns devices that the run was executed on.
30 31 32 33 34 35 36 37 38 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 30 def device_runs res_name = "deviceRuns" endpoint = "projects/#{@project_id}/runs/#{id}/device-runs" results = @client.get_api_request(endpoint, res_name) results.map{|device_run| TestdroidApi::Client::Project::TestRun::DeviceRun.new(@client, self, device_run) } end |
#finished? ⇒ Boolean
Did test run finish
66 67 68 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 66 def finished? state == 'FINISHED' end |
#junit_results_zip ⇒ Object
Get test run’s junit results as a zip file
49 50 51 52 53 54 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 49 def junit_results_zip res_name = 'junits.zip' endpoint = "projects/#{@project_id}/runs/#{id}/junits.zip" @client.get_file(endpoint, res_name) end |
#logs_zip ⇒ Object
Get test run’s logs as a zip file.
57 58 59 60 61 62 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 57 def logs_zip res_name = 'logs.zip' endpoint = "projects/#{@project_id}/runs/#{id}/logs.zip" @client.get_file(endpoint, res_name) end |
#results ⇒ Object
24 25 26 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 24 def results raise NotImplementedError end |
#screenshots_zip ⇒ Object
Get test run’s screenshots as a zip file.
41 42 43 44 45 46 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 41 def screenshots_zip res_name = 'screenshots.zip' endpoint = "projects/#{@project_id}/runs/#{id}/screenshots.zip" @client.get_file(endpoint, res_name) end |
#update! ⇒ Object
Updates test_run information
15 16 17 18 19 20 21 22 |
# File 'lib/testdroid-api/client/project/test_run.rb', line 15 def update! res_name = "run" endpoint = "projects/#{@project_id}/runs/#{id}" config = @client.get_api_request(endpoint, res_name) update(config) end |