Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Add test result with custom date


#1

Hello.
Is there any way to set custom date in test results when they are being uploaded by “add_results_for_cases” command of TestRail API?

Because we need to upload already done test results onto TestRail server.
and get reports with plots of activities.


#2

I have asked this before and was told no. But I will upvote that the API should be able to do this since the date of running the API will Never be when the case was run.


#3

Hi there!

The timestamp of test results is always based on when the results were added via the API. We are happy to look into options to allow users to override this, although this could be problematic in many cases. You can still record such details as part of a custom field though.


#4

Hello.
Thanks for your answer.

I have some additional questions:

  1. Is there any way to use custom fields value in the “get results” request such as GET index.php?/api/v2/get_results_for_run/1&custom_date=“12/11/2015”?

  2. How to draw custom “Activity” in a report with the “custom date” instead of the “default date”? (if it is possible).

  3. Is there a request which allows to get the last two results for each test case in test run?

With best regards,
Valentyn.


#5

Hello Valentyn,

Happy to help with your questions:

  1. A server-side filter for custom fields is currently not possible with get_results_for_run but you can always filter on the client side. If the custom_date and creation date in TestRail are connected somehow, you could also look into using an additional created_after/created_before filter as part of the API request.

  2. The chart always uses the built-in creation date

  3. There’s currently no dedicated API method for this and it might be easier to use the XML exports in this case. You can alternatively also use get_results_for_run again but you might need to paginate through the results if you have many results (returns 250 results per requests at max).

I hope this helps!

Cheers,
Tobias


#6

I think it is pretty clear here Gurock designed the db scheme incorrectly and mixed meta data (date result was created) with actual data (date test case was run and results obtained.)

It is also pretty clear the solution is straight forward. Add the missing data field and by default make them the same on result creation unless an actual run date is given.

I retrieved my pw for this account to see if this issue has been fixed yet as I need to update my integration s/w to get CI/CD results into test rail.

Well it seems I am being forced to live feed my results into test rail as they happen. Which is a real poor design as many times runs have issues that need to be fixed BEFORE results are actually recorded.