[Feature] Add a skip request function
I have checked the following:
- [X] I've searched existing issues and found nothing related to my issue.
Describe the feature you want to add
It will be useful to skip a request programmatically for example by testing a variable set by a previous request.
It could be useful to build more complex testing scenario.
Mockups or Images of the feature
This feature exists now in Postman
Yes, it is useful indeed, we also use it in postman.
So it could be the following syntax to be close to postman syntax:
// set a local variable to true
// change to false to see all tests get executed
const skipTest = true;
// this test will always be executed
test("Status code is 200", function () {
expect(res.getStatus()).to.equal(200);
});
// this test will be skipped when skipTest is set to true
(skipTest ? test.skip : test)('Response time is less than 200ms', function () {
expect(res.getResponseTime()).to.be.below(200);
});
The skipped tests need to be counted in reports like the failed and passed tests.
Looks like this has been built some months ago and awaiting to be merged into the main release. do we need the community to raise this visibility so that it can get prioritized?
Hi @ben-sai,
As you can see, @martinsefcik has suggested an improvement in the PR. Unfortunately, I haven’t been able to implement it in the past few weeks due to time constraints. However, I believe it would be best to incorporate this improvement before merging, so the feature can be at its best for all of us.
Confirm, important function.
What's the status on this issue? I would like to have a skip functionallity
What's the status on this issue? I would like to have a skip functionallity
It's implemented as bru.runner.skipRequest().
What's the status on this issue? I would like to have a skip functionallity
It's implemented as
bru.runner.skipRequest().
Cool, I guess I need to wait for this to get merged before I can use it without getting the source?
What's the status on this issue? I would like to have a skip functionallity
It's implemented as
bru.runner.skipRequest().Cool, I guess I need to wait for this to get merged before I can use it without getting the source?
No, it's already released in version 1.38.0. The feature was part of https://github.com/usebruno/bruno/pull/3719. This issue can probably be closed @lohxt1.
Can we have the skip function also for CLI please, not only for the built in runner. It would be very useful. I want to be able to decide if a request should be sent or not depending on the outcome of other requests during runtime
Hi, we have a fix in place for the CLI. This will likely go out in the upcoming release. Will post updates here.
Hi, we have a fix in place for the CLI. This will likely go out in the upcoming release. Will post updates here.
Very nice, thank you
Closing this issue as this is resolved.