class Testrail::Client

Public Class Methods

new(args) click to toggle source
# File lib/tagrail/client.rb, line 17
def initialize(args)
  @projects = nil
  @sections = Hash.new
  @suite   = Hash.new
  @suites   = []

  @client = APIClient.new args[:url]
  %w(user password project_id).each do |key|
    raise Exception.new("TestRail configuration key :#{key} not set. Cannot continue without it.") if args[key.intern].nil?
    @client.send "#{key}=", args[key.intern] if %w(user password).include? key
  end
end

Public Instance Methods

add_result_for_case(run_id, case_id, result) click to toggle source

results

# File lib/tagrail/client.rb, line 41
def add_result_for_case(run_id, case_id, result)
  @client.send_post("add_result_for_case/#{run_id}/#{case_id}", result)
end
add_run(project_id, suite_id, run_name) click to toggle source
# File lib/tagrail/client.rb, line 30
def add_run(project_id, suite_id, run_name)
  @client.send_post("add_run/#{project_id}", { suite_id: suite_id,
                                               name: run_name })
end
get_case(case_id) click to toggle source

cases

# File lib/tagrail/client.rb, line 36
def get_case(case_id)
  @client.send_get("get_case/#{case_id}")
end
get_project(project_id) click to toggle source

projects

# File lib/tagrail/client.rb, line 46
def get_project(project_id)
  @client.send_get("get_project/#{project_id}")
end