devolo/adaptavist

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

Closed this issue · 2 comments

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_result_attachment" API.

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")

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.