Method: TestRail::Client::Cases#cases

Defined in:
lib/testrail_api/client/cases.rb

#cases(project_id, suite_id, filters = {}) ⇒ Object

Returns a list of test cases for a test suite or specific section in a test suite.

The response includes an array of test cases. Each test case in this list follows the same format as TestRail#Client#Cases#case

Parameters:

  • project_id (Integer, String)

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

  • suite_id (Integer, String)

    The ID of the test suite (optional if the project is operating in single suite mode)

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

    A customizable set of filters

Options Hash (filters):

  • :section_id (Integer, String)

    The ID of the section

  • :created_after (Integer, String)

    Only return test cases created after this date (as UNIX timestamp).

  • :created_before (Integer, String)

    Only return test cases created before this date (as UNIX timestamp).

  • :created_by (Array<Integer>)

    A comma-separated list of creators (user IDs) to filter by.

  • :milestone_id (Array<Integer>)

    A comma-separated list of milestone IDs to filter by (not available if the milestone field is disabled for the project).

  • :priority_id (Array<Integer>)

    A comma-separated list of priority IDs to filter by.

  • :type_id (Array<Integer>)

    A comma-separated list of case type IDs to filter by.

  • :updated_after (Integer, String)

    Only return test cases updated after this date (as UNIX timestamp).

  • :updated_before (Integer, String)

    Only return test cases updated before this date (as UNIX timestamp).

  • :updated_by (Array<Integer>)

    A comma-separated list of users who updated test cases to filter by.

Returns:

  • a list of test cases for a test suite or specific section in a test suite.

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/testrail_api/client/cases.rb', line 37

def cases(project_id, suite_id, filters = {})
  get("get_cases/#{project_id}&suite_id=#{suite_id}",
      params: {
          section_id:     filters[:section_id],
          created_after:  filters[:created_after],
          created_before: filters[:created_before],
          created_by:     filters[:created_by].to_list,
          milestone_id:   filters[:milestone_id].to_list,
          priority_id:    filters[:priority_id].to_list,
          type_id:        filters[:type_id].to_list,
          updated_after:  filters[:updated_after],
          updated_before: filters[:updated_before],
          updated_by:     filters[:updated_by].to_list
      })
end