Kong / Kong/insomnia

Designer Tests not using latest "Response Body Attribute" due to not updating the History

Open
#2,515 5 comments 6 reactions 0 assignees View on GitHub
A-design B-bug N-investigation needs-triage PA-testing
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

**Describe the bug**
When making use of the Response => Body Attribute tag, all works perfect when executing the requests manually in the DEBUG tab of the designer. When using these created requests to build up a test suite, and chaining the requests, the request that is executed, does not update the history of the request, and in turn, the next request in the chain uses a "stale" response.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a simple request that creates user, and returns the UUID of the new user:
```
POST {{ base_url }}/users
{
"Name": "John",
"Surname": "Doe"
}
```
2. Create a second request to retrieve the newly created user by using the response of the first request:
```
GET {{ base_url }}/users/{% response 'body', '{ID OF THE POST REQUEST}', 'b64::JC5VVUlE::46b', 'never', 60 %}
```
3. Manually execute the first request in the DEBUG tab and note the UUID in the response (let's say the UUID response was "1234"
4. Go to the TEST tab and setup a test suite that will first create a user, and then retrieve it
5. Run the tests, and you will notice that the UUID that is sent in the GET request is still "1234" even though the response of the POST in the test execution was "5678"

**Expected behavior**
Tests that are executed in Test Suites, updates the history of the requests in order for the "Response => Body Attribute" tag to function correctly

**Desktop (please complete the following information):**
- OS: Windows 10 Pro Version 1909 (Build 18363.1016)
- Installation Method: npm
- Designer Version: v2020.4.0-beta.4
- Node Version: 13.8.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the chained requests in the Designer TEST tab using the Response => Body Attribute tag, comparing the manually executed response with the test-suite response. Trace how test execution records request history, then verify that the second request uses the latest POST response rather than the stale DEBUG response.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.