[FEATURE REQUEST] Edit requests programmatically in Unit Tests (e.g. query variables, request body, headers, ...) #4482
See original GitHub issueI 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?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Edit requests programmatically in Unit Tests (e.g. query ...
I realized I can invoke another API like below, however, is there a way to send in query variables data dynamically? const response2...
Read more >Programatically change the request body in Postman - YouTube
Mutating the request body in Postman is something that many people need when building complex requests. Until April 2021 it was not possible ......
Read more >How to programmatically change the request method in ...
If you need to reuse the same request with different HTTP request methods, there is a solution. Postman lets you define custom methods....
Read more >Unit Testing Controllers in ASP.NET Web API 2 - Microsoft Learn
Here are some things that you should unit test in your Web API controllers: The action returns the correct type of response. Invalid...
Read more >Unit Testing | Insomnia Docs
Create a Test Suite · Import and select your OpenAPI Specification as a Design Document. · Click the Debug tab to ensure that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @sebastianbuechler, we are cataloguing this feedback to try and come up with a feasible plan to improve the test feature completely.
@MrStanDu33 regarding the stalled PR #2994, we will probably not look at it anytime soon, but we’ll update you and the other folks if we do end up kicking off the improving test feature work after we finish other big chunks of work we have in progress (WebSockets support, better login, …). Sorry for the stall, the team is aware the Test feature hasn’t really been a priority in a while, so it’s a bit of a such is life situation right now 😅 🤷
Feel free to report any issues or ideas for improvements you come across in the meantime! Also I’d encourage any of you to drop by and join us on our weekly Insomnia Stream (see details on
#stream
channel over at https://chat.insomnia.rest/, happens every Tuesday at 14:30 UTC), and share more ideas you’d like to see in Insomniare: timelines just want to say I appreciate the feedback and we’re doing the best we possibly can at the moment especially with so many releases recently. I, along with others from the core team, have been trying quite hard recently to get caught up with many of the issues/PRs that are open right now - but it’s a long process.
Thanks again