bruno icon indicating copy to clipboard operation
bruno copied to clipboard

[Feature] Add a skip request function

Open davidsebag0705 opened this issue 1 year ago • 3 comments

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

davidsebag0705 avatar Apr 18 '24 07:04 davidsebag0705

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.

end3rbyte avatar Apr 19 '24 13:04 end3rbyte

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?

bstupid avatar Aug 19 '24 15:08 bstupid

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.

JorgeTrovisco avatar Aug 19 '24 21:08 JorgeTrovisco

Confirm, important function.

SPIRIT-00 avatar Aug 26 '24 09:08 SPIRIT-00

What's the status on this issue? I would like to have a skip functionallity

hartmark avatar Jan 27 '25 11:01 hartmark

What's the status on this issue? I would like to have a skip functionallity

It's implemented as bru.runner.skipRequest().

Its-treason avatar Jan 27 '25 11:01 Its-treason

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?

hartmark avatar Jan 27 '25 13:01 hartmark

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.

Its-treason avatar Jan 27 '25 14:01 Its-treason

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

frille7070 avatar Feb 10 '25 11:02 frille7070

Hi, we have a fix in place for the CLI. This will likely go out in the upcoming release. Will post updates here.

sreelakshmi-bruno avatar Feb 17 '25 15:02 sreelakshmi-bruno

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

frille7070 avatar Feb 18 '25 07:02 frille7070

Closing this issue as this is resolved.

anusree-bruno avatar May 27 '25 10:05 anusree-bruno