[FEATURE REQUEST] Edit requests programmatically in Unit Tests (e.g. query variables, request body, headers, ...) #4482
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
I am testing my login endpoint in Insomnia Designer with the integrated test tool.
A successful login test looks like this with the selected login request:
```
const response = await insomnia.send();
const body = JSON.parse(response.data);
expect(response.status).to.equal(200);
expect(body).to.have.property("token");
```
Now I want to change the test with invalid credentials in order to check for a response.status 401.
How can I change the payload I send in a test programmatically so that I can send invalid credentials?
Contributor guide
Research direction
Start by tracing the integrated test tool from the selected request through insomnia.send() and identify whether tests can access request query variables, body, or headers. Done means a test can modify request data before sending it and verify the resulting response, including an invalid-login case that returns status 401.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100