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.
5 6 7 8 9 |
# File 'lib/testrail/test_run.rb', line 5 def initialize(suite:, id:) @suite = suite @id = id @results = [] end |
Instance Method Details
#add_test_result(section_name:, test_name:, success:, comment: nil) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/testrail/test_run.rb', line 11 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
22 23 24 |
# File 'lib/testrail/test_run.rb', line 22 def close @suite.close_test_run(@id) end |
#failure_count ⇒ Object
26 27 28 |
# File 'lib/testrail/test_run.rb', line 26 def failure_count @results.count { |r| !r.success? } end |
#submit_results ⇒ Object
18 19 20 |
# File 'lib/testrail/test_run.rb', line 18 def submit_results @suite.submit_test_results(run_id: @id, results: @results) end |