Commit Graph

186 Commits

Author SHA1 Message Date
Pooja
fbc77fc725 feat: introduce res.getSize() helper (header/body/total) (#5018)
* feat: introduce `res.getSize()` helper (header/body/total)

* fix: unit test

* rm: request-duration from collection runner header

* change: api for getSize

* fix

* improve: getSize method

* add: todo comment

---------

Co-authored-by: lohit <lohit@usebruno.com>
2025-07-08 21:00:05 +05:30
Raino Pikkarainen
82f5f9ee88 Add dataBuffer to response to be available in test scripts (#1881)
Co-authored-by: Raino Pikkarainen <raino.pikkarainen@twoday.com>
2025-07-08 19:32:01 +05:30
lohit
e5d194f455 Merge branch 'main' into fix/-reset-test-results-&-script-error-state-on-each-new-request-run 2025-07-04 18:53:37 +05:30
pooja-bruno
68f4e8770f fix: reset test results state on each new request run 2025-07-04 15:44:25 +05:30
pooja-bruno
054bf1cd19 fix: error console 2025-07-04 15:39:29 +05:30
pooja-bruno
47bedec590 add: script error console in cli 2025-07-04 15:39:29 +05:30
Pooja
c6c3931446 feat: support onFail api to catch errors in pre req (#4581)
support `onFail` api to catch errors in pre req

---------

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
Co-authored-by: lohit <lohit@usebruno.com>
2025-06-27 19:42:00 +05:30
naman-bruno
f2aedf780d Fix: showing test script errors (#4902)
* fix: catch errors in tests
2025-06-14 22:20:24 +05:30
lohit
f03047a2f9 feat: bru.sendRequest api (#4867)
* feat: bru.sendRequest api

* updated the postman-translations logic to handle `pm.sendRequest` to `bru.sendRequest` translations, and added unit tests

* ~ removed `maxRedirects` and `proxy` values for sendRequest axios-instance
~ fixed the imports for the `send-request-transformer` function
~ `sendRequest` and `runRequest` will return same response object in both safe and developer mode
~ sendRequest function optimization

* revert sendRequest to async function, added a testcase for sendRequest with url string

* sendRequest callback errors handling

* updated tests and added await for the callbacks

---------

Co-authored-by: lohit <lohit@usebruno.com>
2025-06-14 22:18:31 +05:30
Pooja
fc697bf81b feat: support chai in scripts (#4552)
feat: support chai in scripts
2025-06-10 22:41:11 +05:30
sanish chirayath
9a35302d4b Feature: implemented bru.interpolate (#4122)
* feat: enhance variable highlighting in CodeMirror and update interpolation method

* feat: add interpolate function to bru shim and corresponding tests

- Implemented the `interpolate` function in the bru shim to handle variable interpolation.
- Added a new test case for the `interpolate` function to verify its functionality with mock variables.

* feat: enhance interpolate function to support object interpolation

* feat: add translation support for pm.variables.replaceIn to bru.interpolate

* revert: eslint config changes

* revert: eslint config changes

* fix: update method call to use correct interpolation function in Bru class

* refactor: added jsdoc to codemirror highlighting code

* fix: higlighting for multiline editor
2025-05-22 15:37:15 +05:30
lohit
2a44691cb3 Merge pull request #4590 from poojabela/feat/add-getName-api-for-script
feat: add `req.getName` & `bru.getCollectionName` api
2025-05-16 20:21:35 +05:30
Pooja Belaramani
2852c07ec7 feat: support tv4 as a inbuilt lib (#4589) 2025-05-07 17:44:29 +05:30
poojabela
e0fb379511 add: bru.collectionName api 2025-04-30 17:25:42 +05:30
poojabela
cb92e46f8d feat: add req.getName api 2025-04-30 15:14:36 +05:30
anusree-bruno
f0d1e6936e Include globalEnvironmentVariables in runPostResponseVars result 2025-04-17 16:18:08 +05:30
Andreas Wirth
9a21eec1b9 Bugfix: Add cheerio and xml2js modules to post-response scripts (#4516)
* Bugfix: Add cheerio and xml2js modules to post-response scripts
* chore: improved cheerio and xml2js test
---------

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
2025-04-17 01:31:53 +05:30
Carlos Florêncio
0591530d44 add scripts context to response scripts 2025-04-02 13:22:21 +05:30
sanish-bruno
592679538b Fix: res.setBody fails for Object in Developer-mode
vm2 returns a recursive Proxy for accessing the return value which
cannot be serialized for IPC using `structuredClone`.

Co-authored-by: ramki-bruno <ramki@usebruno.com>
2025-04-02 13:18:58 +05:30
lohxt1
eead96ca26 Merge remote-tracking branch 'upstream/main' into feat/oauth2-improvements 2025-03-16 14:02:12 +05:30
lohit
9bde3c44f7 filename support for requests and folders (#4111) 2025-03-14 20:07:33 +05:30
Anoop M D
eefb0f836b fix: revert pr #4225 that broke tests 2025-03-13 03:22:09 +05:30
Anoop M D
7e16304426 chore: updated bruno lib versions 2025-03-13 02:16:44 +05:30
Pragadesh-45
2385c4d5c1 feat: add statusText support to BrunoResponse on safe mode
Enhance BrunoResponse with statusText functionality:
- Added `getStatusText()` method to BrunoResponse class
- Updated QuickJS shim to support statusText
2025-03-13 01:37:10 +05:30
Anoop M D
1be0b97895 chore: deps update - axios, jsonpath-plus, @aws-sdk/credential-providers, express 2025-03-13 01:27:37 +05:30
Pragadesh-45
6a85635c49 Fix: Inconsistent JSON parsing and formatting in res.body and Res-preview (#4103)
* Fix: Revert selective JSON parsing where string response is not parsed

- Revert "Merge pull request #3706 from Pragadesh-45/fix/response-format-updates"
  - e897dc1eb0
- Revert "Merge pull request #3676 from pooja-bruno/fix/string-json-response"
  - 1f2bee1f90

* Fix: Revert interpreting Assert RHS-value wrapped in quotes literally

- Revert "Merge pull request #3806 from Pragadesh-45/fix/handle-assert-results"
  - 63d3cb380d
- Revert "Merge pull request #3805 from Pragadesh-45/fix/handle-assert-results"
  - 6abd063749

* Fix: Inconsistent JSON formatting in preview when encoded value is a string

* Fix: Prettify JSON for Res-preview without parsing to avoid JS specific roundings

* Fix(testbench): req.body is always Buffer after the binary req body related changes

* Added `/api/echo/custom` where response can be configured using request itself

* Added tests for validating Assert and Response-preview

Co-authored-by: Pragadesh-45 <temporaryg7904@gmail.com>

* Handle char-encoding in Response-preview and added more tests

* Updated API endpoint in tests to use httpfaker api

* QuickJS (Safe Mode) exec logic to handle template literals similar to Developer Mode

* Safe Mode bru.runRequest to return statusText similar to Developer Mode

---------

Co-authored-by: ramki-bruno <ramki@usebruno.com>
Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
2025-03-13 00:49:57 +05:30
Anoop M D
4c1765e9f9 feat(#2896): add support for cheerio and xml2json as inbuilt library 2025-02-10 18:55:20 +05:30
lohit
0633d45a10 upgraded axios libarary (#3899) 2025-01-28 18:55:59 +05:30
Pragadesh-45
16e27d2ca4 feat: make BrunoResponse callable to access body data using expressions fixes (#481) (#3710)
* feat: make `BrunoResponse` callable to access body data using expressions
2025-01-28 14:57:00 +05:30
lohit
f38c7ae03a oauth2 ui/ux improvements (#3868) 2025-01-23 22:06:50 +05:30
Anoop M D
8f754142c7 Merge branch 'pr-2077' into feat/oauth2-improvements 2025-01-23 16:45:51 +05:30
Pragadesh-45
cf2cb0736e fix: remove commented-out removeQuotes() function 2025-01-15 20:42:02 +05:30
Pragadesh-45
dbf1cad124 fix: remove removeQuotes() 2025-01-15 19:57:06 +05:30
lohit
14ecc09cde Merge pull request #3719 from lohxt1/feat/bru-runner-fns
feat: bru util fns -- skipRequest, stopExecution, getTestResults, getAssertionResults, runRequest
2025-01-02 18:02:42 +05:30
lohxt1
99302e3a1d fix: pr review updates 2025-01-02 17:54:29 +05:30
lohxt1
7b86febc87 feat: summarize test and assertion results for getTestResults and getAssertionResults fns 2025-01-01 18:06:13 +05:30
lohxt1
cd722a2bd9 feat: bru.runner.setNextRequest 2025-01-01 17:12:57 +05:30
lohxt1
75a9959d47 feat: add quick-js shims for bru runner fns 2025-01-01 15:37:42 +05:30
lohxt1
f09fd19ca0 chore: updates 2024-12-30 16:38:41 +05:30
lohxt1
f578c188fb chore: updates 2024-12-30 16:32:46 +05:30
lohxt1
0d2b449b27 chore: aikido -- library version upgrades 2024-12-30 16:26:38 +05:30
lohxt1
f72d643e02 feat: updates 2024-12-18 18:57:23 +05:30
lohit
380047e025 Merge pull request #1043 from nelup20/bugfix/521-error_accessing_response_property_with_context_as_key
fix(#521): Allow "context" as the name of a key/var in a JS expression
2024-12-15 20:01:33 +05:30
lohit
434ae6c70f _BrunoNewFunctionInnerContext to __bruno__functionInnerContext 2024-12-15 20:00:57 +05:30
lohit
22612a7dbe _BrunoNewFunctionInnerContext to __bruno__functionInnerContext 2024-12-15 20:00:13 +05:30
lohit
d37e9aaafa Merge pull request #3522 from sanjai0py/feat/add-isNotEmpty-assertion
feat: add 'isNotEmpty' assertion operator
2024-12-15 17:28:23 +05:30
lohit
5a9bda2a0f use to.not.be.empty 2024-12-15 17:27:47 +05:30
Sanjai Kumar
4a4481a26f feat: add 'isNotEmpty' assertion operator 2024-11-21 12:00:25 +05:30
lohxt1
6442e3ceca feat: deleteEnvVar safe mode shim 2024-11-20 18:29:19 +05:30
Pragadesh-45
23c22a96bc Feat/import translation for deprecated pm import (#3388)
* feat: add translation for pm `tests[]`
* feat: add bru.deleteEnvVar function and update translations

---------

Co-authored-by: Pragadesh-45 <temporary7904@gmail.com>
2024-11-20 17:58:59 +05:30