Sha256: 9834f1355f72c4498b12b5b7ceb8a2687ebbfd0fb838341d641a0f4fd67a2ee5

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env ruby

require "./lib/resttestrail/version"
require "./lib/resttestrail/testrailerror"
require "./lib/resttestrail/config"
require "./lib/resttestrail/client"
require 'pry'

module Resttestrail
  # Your code goes here...
  Resttestrail.config.host = "testrail-app1.snc1"
  Resttestrail.config.port = 80
  Resttestrail.config.project_id = 26
  Resttestrail.config.username = "bizops-testeng1@groupon.com"
  Resttestrail.config.password = "password"
  suite_id = 1261
  test_case_id = 197611

  puts "host = #{Resttestrail.config.host}, port = #{Resttestrail.config.port}"

  begin
    client = Resttestrail::Client.instance
    run_id = client.add_run("an amazing run #{Time.new.strftime("%H_%M_%S_%N")}", suite_id)
    puts "run id = #{run_id}"

    run_test_case_id = client.add_result_for_case(run_id, test_case_id, Resttestrail::Requests::TEST_STATUS_PASSED, 24, nil)
    puts "new test_case_id = #{run_test_case_id}"

    new_run = client.get_run(run_id)
    puts "run data= #{new_run}"

    client.delete_run(run_id)
    puts "run deleted"

    puts "Finished!!"
  rescue TestrailError => e
    puts "Exception:"
    puts "Message = #{e.message}"
    puts "Hash = #{e.object}"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
resttestrail-0.0.5 integration_spec/resttestrail.rb
resttestrail-0.0.4 integration_spec/resttestrail.rb
resttestrail-0.0.3 integration_spec/resttestrail.rb
resttestrail-0.0.2 integration_spec/resttestrail.rb