Class: TestdroidApi::Client::Project::TestRun::DeviceRun
- Inherits:
-
Object
- Object
- TestdroidApi::Client::Project::TestRun::DeviceRun
- Defined in:
- lib/testdroid-api/client/project/test_run/device_run.rb
Instance Attribute Summary collapse
-
#device_id ⇒ Object
readonly
Returns the value of attribute device_id.
-
#fail_message ⇒ Object
readonly
Returns the value of attribute fail_message.
-
#finished ⇒ Object
readonly
Returns the value of attribute finished.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#junit_url ⇒ Object
readonly
Returns the value of attribute junit_url.
-
#logs_url ⇒ Object
readonly
Returns the value of attribute logs_url.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#screenshots_url ⇒ Object
readonly
Returns the value of attribute screenshots_url.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#finished? ⇒ Boolean
Did test run finish.
-
#initialize(client, run, config) ⇒ DeviceRun
constructor
A new instance of DeviceRun.
-
#junit_results ⇒ Object
Get device run’s test results as JUnit XML.
-
#logs ⇒ Object
Get device run’s logs.
- #results ⇒ Object
-
#screenshot(screenshot_id) ⇒ Object
Get device’s run screenshot.
-
#screenshots ⇒ Object
Returns screenshots’ ids for device run.
-
#screenshots_zip ⇒ Object
Get device run’s screenshots as a zip file.
-
#update! ⇒ Object
Updates device run information.
Constructor Details
#initialize(client, run, config) ⇒ DeviceRun
Returns a new instance of DeviceRun.
10 11 12 13 14 15 16 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 10 def initialize(client, run, config) @client = client @project_id = run.project_id @run_id = run.id update(config) end |
Instance Attribute Details
#device_id ⇒ Object (readonly)
Returns the value of attribute device_id.
7 8 9 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 7 def device_id @device_id end |
#fail_message ⇒ Object (readonly)
Returns the value of attribute fail_message.
7 8 9 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 7 def @fail_message end |
#finished ⇒ Object (readonly)
Returns the value of attribute finished.
7 8 9 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 7 def finished @finished end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 7 def id @id end |
#junit_url ⇒ Object (readonly)
Returns the value of attribute junit_url.
8 9 10 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 8 def junit_url @junit_url end |
#logs_url ⇒ Object (readonly)
Returns the value of attribute logs_url.
8 9 10 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 8 def logs_url @logs_url end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 7 def name @name end |
#screenshots_url ⇒ Object (readonly)
Returns the value of attribute screenshots_url.
8 9 10 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 8 def screenshots_url @screenshots_url end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 7 def state @state end |
Instance Method Details
#finished? ⇒ Boolean
Did test run finish
70 71 72 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 70 def finished? finished end |
#junit_results ⇒ Object
Get device run’s test results as JUnit XML
29 30 31 32 33 34 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 29 def junit_results res_name = 'junit XML' endpoint = "projects/#{@project_id}/runs/#{@run_id}/device-runs/#{id}_junit.xml" @client.get_file(endpoint, res_name) end |
#logs ⇒ Object
Get device run’s logs
37 38 39 40 41 42 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 37 def logs res_name = 'log' endpoint = "projects/#{@project_id}/runs/#{@run_id}/device-runs/#{id}_log.txt" @client.get_file(endpoint, res_name) end |
#results ⇒ Object
74 75 76 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 74 def results raise NotImplementedError end |
#screenshot(screenshot_id) ⇒ Object
Get device’s run screenshot.
62 63 64 65 66 67 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 62 def screenshot(screenshot_id) res_name = 'screenshot' endpoint = "projects/#{@project_id}/runs/#{@run_id}/device-runs/#{id}/screenshots/#{screenshot_id}" @client.get_file(endpoint, res_name) end |
#screenshots ⇒ Object
Returns screenshots’ ids for device run.
53 54 55 56 57 58 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 53 def screenshots res_name = 'deviceRunScreenshots' endpoint = "projects/#{@project_id}/runs/#{@run_id}/device-runs/#{id}/screenshots" @client.get_api_request(endpoint, res_name) end |
#screenshots_zip ⇒ Object
Get device run’s screenshots as a zip file.
45 46 47 48 49 50 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 45 def screenshots_zip res_name = 'screenshots.zip' endpoint = "projects/#{@project_id}/runs/#{@run_id}/device-runs/#{id}/screenshots.zip" @client.get_file(endpoint, res_name) end |
#update! ⇒ Object
Updates device run information
19 20 21 22 23 24 25 26 |
# File 'lib/testdroid-api/client/project/test_run/device_run.rb', line 19 def update! res_name = 'deviceRun' endpoint = "projects/#{@project_id}/runs/#{@run_id}/device-runs/#{id}" config = @client.get_api_request(endpoint, res_name) update(config) end |