nassauwinter / zephyr-python-api

Python wrappers for Zephyr Scale API
Apache License 2.0
1 stars 4 forks source link

Updated update_test_result #19

Closed jay-2597 closed 5 months ago

jay-2597 commented 5 months ago

Updated -- update_test_result

put instead of post result so that new execution id is not created every time updating test result.

jay-2597 commented 5 months ago

@nassauwinter @crapitea Please review request -- Updated -- update_test_result

put instead of post result so that new execution id is not created every time updating test result.

nassauwinter commented 5 months ago

Hi @jay-2597! Thank you for your contribution.

The official method from Zephyr Scale Server API is POST. PUT is not supported/documented. So I suggest to leave update_test_result method as is.

Anyway, could you please add a new method for that endpoint? Name it like modify_test_result with explicit statement in its docstring that the method is not supported/documented in official documentation; it works and makes it possible to modify a test result.

jay-2597 commented 5 months ago

@nassauwinter @crapitea ,

put & post method both is documented in documentation of zephyr scale server api can you follow the link as below endpoint:

https://support.smartbear.com/zephyr-scale-server/api-docs/v1/

Endpoint: /testrun/{testRunKey}/testcase/{testCaseKey}/testresult

As create_test_result already makes use of POST mechanism to create and update the test result (status), I believe that update_test_result should just update test result(status) not add a new execution ID.

Please confirm if this is logical else i would be glad to add a new function altogether.

nassauwinter commented 5 months ago

@jay-2597,

My mistake. Here is a bug in update_test_result. Look at the create_test_result and update_test_result: both use post while update_test_result expected to use put. Would you modify your PR to fix that?