devolo / adaptavist

python package providing functionality for Jira Test Management (tm4j)
MIT License
8 stars 11 forks source link

Unable to add attachments to test execution when test run created by using clone_test_run API #29

Closed shrikantsingh0585 closed 2 years ago

shrikantsingh0585 commented 2 years ago

Used clone_test_run api for cloning a reference test run(test cycle). Then I used edit_test_result_status api for updating the test results. For adding attachments to executed test, when I tried to use add_test_result_attachment api, I get KeyError. However if the test run (test cycle) created manually, I am able to add attachments to test execution using same "_add_test_resultattachment" API.

Shutgun commented 2 years ago

Hi @shrikantsingh0585 , I cannot reproduce this. Do you have any mode details, that might help me? I used the following snippet, assuming a is a working Adaptavist instance:

test_run_key = a.clone_test_run(test_run_key="TEST-C412")
assert a.add_test_result_attachment(test_case_key="TEST-T12", test_run_key=test_run_key, attachment="README.md", filename="README.md")
shrikantsingh0585 commented 2 years ago

Hi @Shutgun, Today I tried again and able to figure out the actual cause. When the test script (test step) is modified but test execution under any test cycle is not updated, this problem is faced. e.g.

  1. I created a test T1 & added some steps in this test.
  2. I created a test run C1 & added test T1 in cycle C1.
  3. Now I modify the test T1 & save it.
  4. When I open T1 in execution mode under test run C1, I see a warning "This test script is outdated because the test case has been changed. [Update this test script]".

So when test case is not updated with latest modifications (as stated in step-4), this issue is observed.