Class: TarantulaUpdater
- Inherits:
-
Object
- Object
- TarantulaUpdater
- Includes:
- HTTParty
- Defined in:
- lib/TarantulaUpdater.rb
Class Method Summary collapse
- .config=(hash) ⇒ Object
- .get_tests(options) ⇒ Object
- .update_testcase_duration(project, execution, testcase, duration) ⇒ Object
- .update_testcase_step(project, execution, testcase, step_position, result, comment) ⇒ Object
Class Method Details
.config=(hash) ⇒ Object
12 13 14 |
# File 'lib/TarantulaUpdater.rb', line 12 def self.config= hash @config = hash end |
.get_tests(options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/TarantulaUpdater.rb', line 16 def self.get_tests = .merge({ "language" => @config["language"] }) params = { :basic_auth => { :username => @config["username"], :password => @config["password"] }, :body => .to_xml(:skip_types => true, :root => "request") } response = self.post(@config["server"]+'/api/get_scenarios', params) raise response.body unless response.code == 200 response end |
.update_testcase_duration(project, execution, testcase, duration) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/TarantulaUpdater.rb', line 46 def self.update_testcase_duration(project, execution, testcase, duration) body = { :project => project, :execution => execution, :testcase => testcase, :duration => duration }.to_xml(:skip_types => true, :root => "request") params = { :basic_auth => { :username => @config["username"], :password => @config["password"] }, :body => body } response = self.post(@config["server"]+'/api/update_testcase_duration', params) raise response.body unless response.code == 200 response end |
.update_testcase_step(project, execution, testcase, step_position, result, comment) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/TarantulaUpdater.rb', line 27 def self.update_testcase_step(project, execution, testcase, step_position, result, comment) body = { :project => project, :execution => execution, :testcase => testcase, :position => step_position, :result => result, :comment => comment, }.to_xml(:skip_types => true, :root => "request") params = { :basic_auth => { :username => @config["username"], :password => @config["password"] }, :body => body } response = self.post(@config["server"]+'/api/update_testcase_step', params) raise response.body unless response.code == 200 response end |