Module: WrataApi::QueueMethods
- Included in:
- WrataApi
- Defined in:
- lib/wrata_api/queue_methos.rb
Overview
Methods for working with queue
Instance Method Summary collapse
-
#add_tests_to_queue(test_list, options = {}) ⇒ Nothing
Add several tests to queue.
-
#add_to_queue(tests_to_add, options = {}) ⇒ Nothing
Add test to queue.
-
#clear_tests_list ⇒ Nothing
Clear test in queue.
-
#queue_item_default_values(options) ⇒ Hash
Add default value to queue item.
-
#tests_in_queue ⇒ Array<Hash>
Get list of tests in queue.
Instance Method Details
#add_tests_to_queue(test_list, options = {}) ⇒ Nothing
Add several tests to queue
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/wrata_api/queue_methos.rb', line 52 def add_tests_to_queue(test_list, = {}) uri = URI.parse("#{@uri}/queue/add_tests") = queue_item_default_values() body = { 'test_paths[]' => test_list, 'branch' => [:branch], 'location' => [:location], 'spec_browser' => [:browser] } perform_post(uri, body) end |
#add_to_queue(tests_to_add, options = {}) ⇒ Nothing
Add test to queue
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/wrata_api/queue_methos.rb', line 25 def add_to_queue(tests_to_add, = {}) uri = URI.parse("#{@uri}/queue/add_test") = queue_item_default_values() body = { 'test_path' => tests_to_add, 'branch' => [:branch], 'location' => [:location], 'spec_browser' => [:browser] } perform_post(uri, body) end |
#clear_tests_list ⇒ Nothing
Clear test in queue
8 9 10 11 |
# File 'lib/wrata_api/queue_methos.rb', line 8 def clear_tests_list uri = URI.parse("#{@uri}/queue/clear_tests") perform_post(uri) end |
#queue_item_default_values(options) ⇒ Hash
Add default value to queue item
41 42 43 44 45 46 |
# File 'lib/wrata_api/queue_methos.rb', line 41 def queue_item_default_values() [:branch] ||= 'develop' [:location] ||= 'info us' [:browser] ||= 'default' end |
#tests_in_queue ⇒ Array<Hash>
Get list of tests in queue
15 16 17 18 19 |
# File 'lib/wrata_api/queue_methos.rb', line 15 def tests_in_queue uri = URI.parse("#{@uri}/runner/updated_data") response = perform_get(uri) response['queue_data']['tests'] end |