Module: TestRail::Client::Runs

Included in:
API
Defined in:
lib/testrail_api/client/runs.rb

Overview

Methods for the Runs API

Use the following API methods to request details about test runs and to create or modify test runs.

Instance Method Summary collapse

Instance Method Details

#add_run(project_id, data = {}) ⇒ Object

Creates a new test run.

Parameters:

  • project_id (Integer, String)

    The ID of the project the test run should be added to

  • data (Hash) (defaults to: {})

    : A customizable set of options

Options Hash (data):

  • :suite_id (Integer)

    The ID of the test suite for the test run (optional if the project is operating in single suite mode, required otherwise)

  • :name (String)

    The name of the test run

  • :description (String)

    The description of the test run

  • :milestone_id (Integer)

    The ID of the milestone to link to the test run

  • :assignedto_id (Integer)

    The ID of the user the test run should be assigned to

  • :include_all (Boolean)

    True for including all test cases of the test suite and false for a custom case selection (default: true)

  • :case_ids (Array<Integer>)

    An array of case IDs for the custom case selection

Returns:

  • # TODO:

See Also:



41
42
43
# File 'lib/testrail_api/client/runs.rb', line 41

def add_run(project_id, data = {})
  post("add_run/#{project_id}", body: data.to_json)
end

#close_run(run_id) ⇒ Object

Closes an existing test run and archives its tests & results.

:run_id The ID of the test run



60
61
62
# File 'lib/testrail_api/client/runs.rb', line 60

def close_run(run_id)
  post("close_run/#{run_id}")
end

#delete_run(run_id) ⇒ Object

Deletes an existing test run.

:run_id The ID of the test run



69
70
71
# File 'lib/testrail_api/client/runs.rb', line 69

def delete_run(run_id)
  post("delete_run/#{run_id}")
end

#run(run_id) ⇒ Object

Returns an existing test run. Please see get_tests for the list of included tests in this run.

:run_id The ID of the test run



13
14
15
# File 'lib/testrail_api/client/runs.rb', line 13

def run(run_id)
  get("get_run/#{run_id}")
end

#runs(project_id) ⇒ Object

Returns a list of test runs for a project. Only returns those test runs that are not part of a test plan (please see get_plans/get_plan for this).

:project_id The ID of the project



23
24
25
# File 'lib/testrail_api/client/runs.rb', line 23

def runs(project_id)
  get("get_runs/#{project_id}")
end

#update_run(run_id, data = {}) ⇒ Object

Updates an existing test run (partial updates are supported, i.e. you can submit and update specific fields only). With the exception of the suite_id and assignedto_id fields, this method supports the same POST fields as add_run.

:run_id The ID of the test run



51
52
53
# File 'lib/testrail_api/client/runs.rb', line 51

def update_run(run_id, data = {})
  post("update_run/#{run_id}", body: data.to_json)
end