Help Index
Watir Website
Does Testuff have an automation API?
Yep! It allows your automation to update test results in Testuff. Automation can also be used to automatically export your data.
How does it work?
Via HTTP POST over SSL. Each company has a custom URL and a unique token for identification. Each test has a unique ID. Test results are POSTed to the relevant URL and include as parameters the token, test ID, lab name, and test result. Following the request, Testuff updates the test result accordingly. Read more about the automation URL on the automation page.
Sample: Watir
require 'watir'
ie = Watir::IE.new
ie.goto("http://google.com")
ie.text_field(:name, "q").flash
ie.text_field(:name, "q").set("Testuff")
ie.button(:name, "btnG").click
require 'net/http'
require 'net/https'
# Replace host name with values from Testuff API settings screen
http = Net::HTTP.new('serviceX.testuff.com',443)
http.use_ssl = true
# Replace company_id and token with values from the
# Testuff API settings screen
path = '/company_id/automation?token=01234567890abcdefghijkl'
# replace test ID with correct value from Testuff
data = 'status=passed&lab_name=sanity&test_id=abcdefghijklmnop&tester_name=john&comment=comment text'
resp, data = http.post(path, data)
# Output response code to the screen (we should get 201)
puts 'Code = ' + resp.code
puts 'Message = ' + resp.message
