Class: TestRail::TestRun
- Inherits:
-
Object
- Object
- TestRail::TestRun
- Defined in:
- lib/testrail/test_run.rb
Instance Method Summary collapse
- #add_test_result(section_name:, test_name:, success:, comment: nil) ⇒ Object
- #close ⇒ Object
- #failure_count ⇒ Object
-
#initialize(suite:, id:) ⇒ TestRun
constructor
A new instance of TestRun.
- #submit_results ⇒ Object
Constructor Details
#initialize(suite:, id:) ⇒ TestRun
Returns a new instance of TestRun.
19 20 21 22 23 |
# File 'lib/testrail/test_run.rb', line 19 def initialize(suite:, id:) @suite = suite @id = id @results = [] end |
Instance Method Details
#add_test_result(section_name:, test_name:, success:, comment: nil) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/testrail/test_run.rb', line 25 def add_test_result(section_name:, test_name:, success:, comment: nil) @results << @suite .get_or_create_section(section_name) .get_or_create_test_case(test_name) .create_result(success: success, comment: comment) end |
#close ⇒ Object
36 37 38 |
# File 'lib/testrail/test_run.rb', line 36 def close @suite.close_test_run(@id) end |
#failure_count ⇒ Object
40 41 42 |
# File 'lib/testrail/test_run.rb', line 40 def failure_count @results.count { |r| !r.success? } end |
#submit_results ⇒ Object
32 33 34 |
# File 'lib/testrail/test_run.rb', line 32 def submit_results @suite.submit_test_results(run_id: @id, results: @results) end |