phpDocumentor TestlinkAPI
[ class tree: TestlinkAPI ] [ index: TestlinkAPI ] [ all elements ]

ruby client sample

  1. #!/usr/bin/env ruby
  2.  
  3. # Testlink API Sample Ruby Client implementation
  4. require 'xmlrpc/client'
  5.  
  6. class TestlinkAPIClient  
  7.   # substitute your server URL Here
  8.   SERVER_URL = "http://qa/testlink_sandbox/api/xmlrpc.php"
  9.   
  10.   def initialize(dev_key)
  11.     @server = XMLRPC::Client.new2(SERVER_URL)
  12.     @devKey = dev_key
  13.   end
  14.   
  15.   def reportTCResult(tcid, tpid, status)
  16.     args = {"devKey"=>@devKey, "tcid"=>tcid, "tpid"=>tpid, "status"=>status}
  17.     @server.call("tl.reportTCResult", args)
  18.   end
  19. end
  20.  
  21. # substitute your Dev Key Here
  22. client = TestlinkAPIClient.new("f2a979d533cdd9761434bba60a88e4d8")
  23. # Substitute for tcid and tpid that apply to your project
  24. result = client.reportTCResult(1132, 56646, "f")
  25. # Typically you'd want to validate the result here and probably do something more useful with it
  26. puts "result was: %s" %(result)

Documentation generated on Fri, 17 Feb 2012 16:07:50 -0500 by phpDocumentor 1.4.4