Module: TestRail::Client::Tests

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

Overview

Methods for the Tests API Use the following API methods to request details about tests.

Instance Method Summary collapse

Instance Method Details

#test(test_id) ⇒ Object

Returns an existing test by its ID

Parameters:

  • test_id (Integer, String)

    The ID of the test

Returns:

  • an existing test by its ID

See Also:



14
15
16
# File 'lib/testrail_api/client/tests.rb', line 14

def test(test_id)
  get("get_test/#{test_id}")
end

#test_by_title(run_id, test_title) ⇒ Object

TODO: add documentation



19
20
21
# File 'lib/testrail_api/client/tests.rb', line 19

def test_by_title(run_id, test_title)
  tests(run_id).find { |test| test['title'].casecmp(test_title) == 0 }
end

#test_id_by_title(run_id, test_title) ⇒ Object

TODO: add documentation



24
25
26
# File 'lib/testrail_api/client/tests.rb', line 24

def test_id_by_title(run_id, test_title)
  test_by_title(run_id, test_title)['id']
end

#tests(run_id) ⇒ Object

Returns a list of tests for a test run.

TODO: finish method and documentation

Parameters:

  • run_id (Integer, String)

    The ID of the test run

  • [String] (Hash)

    a customizable set of options

Returns:

  • an existing test by its ID

See Also:



36
37
38
# File 'lib/testrail_api/client/tests.rb', line 36

def tests(run_id)
  get("get_tests/#{run_id}")
end