Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.53k stars 1.95k forks source link

[FEATURE REQUEST] Edit requests programmatically in Unit Tests (e.g. query variables, request body, headers, ...) #4482 #3128

Open sebastianbuechler opened 3 years ago

sebastianbuechler commented 3 years ago

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?

apisaint commented 3 years ago

See open PR for this functionality https://github.com/Kong/insomnia/pull/2994

sebastianbuechler commented 3 years ago

See open PR for this functionality https://github.com/Kong/insomnia/pull/2994

Thanks, looks like PRs are not handled timely.

apisaint commented 3 years ago

Thanks, looks like PRs are not handled timely.

It is what it is, from what I've read the team is working on a major release at the moment, it should be in the next few releases so it's okay

dimitropoulos commented 3 years ago

re: 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

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MrStanDu33 commented 2 years ago

Any update on this thread ? 🤔

I can see the PR being staling for like 11+ months

Could be such a nice feature !

filfreire commented 2 years ago

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 Insomnia

mugi-luffy commented 1 year ago

any updates on this?

filfreire commented 1 year ago

@mugi-luffy there's a good chance this will get done this year. In terms of roadmap it won't get done this quarter, but we have this change and a lot of other Test feature related changes planned for this year.

cc @wongstein

Baklap4 commented 1 year ago

This is currently a big drawback of using the test part of Insomnia (cli) as we cannot use this within our pipelines currently.

Any chance this can get high(er) priority? If it helps, the functionality we're looking for is to change the routing which are currently supplied by either the environment or a prompt with a default value.

Is there currently an open draft PR?

misaya98 commented 9 months ago

any updates on this? pre-requests and query enviroment variables are very important . any update on this ?

ghost commented 9 months ago

Also following up as this is a critical ability for testing with Insomnia.

Baklap4 commented 5 months ago

Any updates for this? Changing requests seems like a critical ability for automating the testing of our api's... ever since closing of https://github.com/Kong/insomnia/pull/2994 we heard nothing anymore... Also an update on the documentation would help aswell since there's still a mention of a debug tab.... which isn't there anymore on the latest version image

image

hmundle commented 16 hours ago

Without this edit requests programmatically in Unit Tests, this is a show stopper for Insomnia in our company. Please add this feature urgently and correct the documentation as well.