testrail-python icon indicating copy to clipboard operation
testrail-python copied to clipboard

Unable to change custom fields for test case result

Open spiperac opened this issue 8 years ago • 4 comments

I cannot do something like:

result._content['platform'] = 'blahblah', 

probably because request fields are statically defined in api.py:

@UpdateCache(_shared_state['_results'])
def add_results(self, results, run_id):
    fields = ['status_id',
              'test_id',
              'comment',
              'version',
              'elapsed',
              'defects',
              'assignedto_id']

spiperac avatar Nov 15 '17 12:11 spiperac

Custom fields are not yet supported. This is something that I hope to have soon as I need it as well. In the mean time you could use _post in apy.py directly.

travispavek avatar Nov 15 '17 14:11 travispavek

Hi @travispavek

First, I'd like to ask and make sure that custom fields are still not yet supported. If that's correct, can you elaborate on what you mean by "use _post in apy.py directly" ?

ctramm avatar Oct 30 '18 19:10 ctramm

@ldfalcon17 You can add results into custom field like:

                result = tr.result()
                result.test = test
                result.status = test_status
                result.comment = test_comment
                ....
                result._content['platform'] = 'linux' # Custom parameter

spiperac avatar Nov 05 '18 14:11 spiperac

Thanks @spiperac

Your response helped a ton.

ctramm avatar Nov 05 '18 22:11 ctramm