insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

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

Open sebastianbuechler opened this issue 3 years ago • 13 comments

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?

sebastianbuechler avatar Feb 27 '21 14:02 sebastianbuechler

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

apisaint avatar Mar 01 '21 11:03 apisaint

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

Thanks, looks like PRs are not handled timely.

sebastianbuechler avatar Mar 01 '21 12:03 sebastianbuechler

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

apisaint avatar Mar 01 '21 17:03 apisaint

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

dimitropoulos avatar Mar 31 '21 18:03 dimitropoulos

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.

stale[bot] avatar May 31 '21 02:05 stale[bot]

Any update on this thread ? 🤔

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

Could be such a nice feature !

MrStanDu33 avatar May 08 '22 16:05 MrStanDu33

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

filfreire avatar Jul 25 '22 14:07 filfreire

any updates on this?

mugi-luffy avatar Jan 22 '23 21:01 mugi-luffy

@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

filfreire avatar Jan 24 '23 12:01 filfreire

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?

Baklap4 avatar Feb 15 '23 10:02 Baklap4

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

misaya98 avatar Jan 04 '24 03:01 misaya98

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

ghost avatar Jan 12 '24 17:01 ghost

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

Baklap4 avatar May 03 '24 12:05 Baklap4