Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestRail 6.7: testRail.cases().list() returns first 250 cases instead of all cases in the suite #60

Open
alex-i-rybkin opened this issue Dec 14, 2020 · 1 comment

Comments

@alex-i-rybkin
Copy link

alex-i-rybkin commented Dec 14, 2020

Need to add adequate support for TestRail 6.7+.
This version of TestRail adds pagination to the testrail API: https://blog.gurock.com/announcing-testrail-6-7/
It is expected for testRail.cases().list() to return a complete set of cases in the requested suite.
Actually, it returns the first 250 cases by the current implementation and pagination needs to be handled somehow inside the library

We’ve also introduced pagination for bulk requests in the API. In the future, when you make a bulk request using a TestRail API endpoint such as get_cases, you’ll see that the response structure has changed so that it returns an object with additional pagination fields and an array of up to 250 entities.

All bulk API endpoints will contain the new structure and the pagination links. If your request results in a response that exceeds the maximum number of objects allowed, you will receive the first 250 of them and a link to the next set of results in the response body.

{"offset": 0,
 "limit": 250,
 "size": 250,
 "_links":{
 "next": "/api/v2/get_cases/1&limit=250&offset=250",
 "prev": null
 },
 "cases":[
 { "id": 1, "title": "..", .. },
 { "id": 2, "title": "..", .. },
 ..
 ]
 }
You can apply an offset to your request, or further limit the number of entities returned by adding offset and limit parameters to the request URL:

GET index.php?/api/v2/get_cases/:project_id \
 &suite_id=:suite_id
 limit=:limit
 &offset=:offset
The full list of bulk API endpoints that include this change are below:

get_cases
get_runs
get_results
get_tests
get_results_for_case
get_results_for_run
get_plans
get_projects
get_sections
get_milestones
get_history_for_case
get_attachments_for_case
get_attachments_for_run
get_attachments_for_plan
@RazmikDev
Copy link

Hi, there ✋ ! Is anyone working on the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants