Repository navigation
TR-21906: Display AI automated and generated fields for cases list and get commands - #470
acuanico-tr-galt wants to merge 2 commits into
Conversation
…nd automated test cases via list and get command for cases
|
|
||
| environment.log(f" Priority ID: {case.get('priority_id', 'N/A')}") | ||
| environment.log(f" Type ID: {case.get('type_id', 'N/A')}") | ||
| environment.log(f" AI Generated: {'Yes' if case.get('is_ai_generated') else 'No'}") |
There was a problem hiding this comment.
In the compact list output, optional fields like refs, labels, and milestone_id are shown conditionally — only when they have a value. But the AI fields are shown unconditionally for every case, even when both are False/absent. If a project never uses AI generation, every case output will have two lines of "No". Is this intentional?
| mock_client.api_request_handler.case_handler.get_cases.assert_called_once_with( | ||
| project_id=99, suite_id=None, priority_id=None, filter_text=None, limit=250, offset=0 | ||
| ) | ||
|
|
There was a problem hiding this comment.
Missing test: get --show-all-fields boolean formatting
The elif isinstance(value, bool) branch in the get() show-all-fields code path (lines 126–127) has no test. test_list_cases_show_all_fields_bool_formatting covers the equivalent branch in list, but the get --show-all-fields branch is completely untested. A test analogous to test_list_cases_show_all_fields_bool_formatting but invoking cmd_cases.get with ["--case-id", "123", "--show-all-fields"] is missing.
Solution description
Implemented display of the new TestRail API fields is_ai_generated / is_ai_automated in the trcli cases get and trcli cases list commands.
Changes
trcli/commands/cmd_cases.py:
Also updated README sample output and test_cmd_cases.py for unit tests.
Potential impacts
None.
Steps to test
See Readme Cases Get and List command: 1497 - 1673
PR Tasks