فهرست منبع

Fix #152: Add bulkAddResultsByCase

George S. Baugh 7 سال پیش
والد
کامیت
ca4a805a44
2فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 1 0
      Changes
  2. 14 0
      lib/TestRail/API.pm

+ 1 - 0
Changes

@@ -3,6 +3,7 @@ Revision history for Perl module TestRail::API
 0.044 2018-10-9 TEODESIAN
     - Add getCaseFields and addCaseField methods to TestRail::API
     - Correct argument POD for createRunInPlan
+    - Add bulkAddResultsByCase
 
 0.043 2018-6-16 TEODESIAN
     - Better error messaging when bad custom result fields are configured in Test::Rail::Parser

+ 14 - 0
lib/TestRail/API.pm

@@ -2386,6 +2386,20 @@ sub bulkAddResults {
     return $self->_doRequest("index.php?/api/v2/add_results/$run_id", 'POST', { 'results' => $results });
 }
 
+=head2 bulkAddResultsByCase(run_id,results)
+
+Basically the same as bulkAddResults, but instead of a test_id for each entry you use a case_id.
+
+=cut
+
+sub bulkAddResultsByCase {
+    state $check = compile(Object, Int, ArrayRef[HashRef]);
+    my ($self,$run_id, $results) = $check->(@_);
+
+    return $self->_doRequest("index.php?/api/v2/add_results_for_cases/$run_id", 'POST', { 'results' => $results });
+}
+
+
 =head2 B<getTestResults(test_id,limit,offset)>
 
 Get the recorded results for desired test, limiting output to 'limit' entries.