* fix: 3123 CLI JUnit Report: classname Uses Request URL Instead of Request Name
* fix: update classname in JUnit report to use request path instead of name
* fix: update testcase classname in JUnit report to use request path instead of request name
* fix: update JUnit report classname to use API paths instead of collection paths
* fix: update classname in JUnit report to use backslashes for Windows compatibility
* fix: update JUnit report file paths to use API paths instead of mock paths
Assigning `defaults.headers.common = { 'User-Agent': ... }` replaced the
entire common headers object, nuking axios's built-in default:
Accept: application/json, text/plain, */*
This caused servers relying on content-negotiation to receive requests
with no Accept header. Fix by extending the existing object with a
property assignment instead.
Add regression tests for both electron and CLI axios instances verifying
that Accept is preserved and User-Agent is set correctly.
Co-authored-by: Pragadesh-45 <temporaryg7904@gmail.com>
* fix: add size and duration fields to CLI bru.runRequest() response
Add `size` and `duration` fields to the response object in CLI to match
GUI behavior, ensuring consistent API for bru.runRequest() across both
environments.
- `duration` is an alias for `responseTime` for GUI compatibility
- `size` is the byte length of the response buffer (0 for errors/skipped)
Fixes#7352
* fix: address PR review feedback for CLI response consistency
- Coerce responseTime header to number (was string from headers.get())
- Add comment explaining duration vs responseTime difference between
GUI (wall-clock) and CLI (approximation using responseTime)
- Add integration tests for duration/size fields across skipped,
success, and network error response paths
* fix: add missing setupProxyAgents mock in response-fields test
The success path calls setupProxyAgents which was missing from the
proxy-util mock, causing CI failure.
---------
Co-authored-by: Chirag Chandrashekhar <cchirag85@gmail.com>
* feat: add support for examples in collection items
- Enhanced the processCollectionItems function to include examples from imported collection items.
- Added a new test case to verify that examples are correctly written to the output file during collection creation.
* fix: coerce response status to number in collection creation tests
Updated the test for createCollectionFromBrunoObject to ensure the response status is compared as a number, improving type consistency in assertions.
* feat: add options to skip request and response bodies in reporter output
- Introduced `--reporter-skip-request-body` and `--reporter-skip-response-body` flags to omit respective bodies from the reporter output.
- Updated examples in the CLI documentation to reflect new options.
- Refactored result sanitization to handle new flags.
* feat: add shorthand option to skip both request and response bodies in reporter output
- Introduced `--reporter-skip-body` as a shorthand for omitting both request and response bodies from the reporter output.
- Updated CLI documentation examples to include the new shorthand option.
- Adjusted result sanitization to accommodate the new option.
* refactor: simplify documentation and tests for reporter-skip-body option
- Updated the description of the `--reporter-skip-body` option to remove redundancy.
- Removed outdated shorthand references from the test suite for clarity.
- Cleaned up examples in the CLI documentation to focus on the current functionality.
* fix: handle optional chaining for request and response properties in result sanitization
- Updated the `sanitizeResultsForReporter` function to use optional chaining when accessing request and response headers and data.
- This change prevents potential errors when these properties are undefined.
* test: enhance reporter-skip-body tests for JSON and HTML outputs
- Added comprehensive tests for the `--reporter-skip-request-body` and `--reporter-skip-response-body` options in both JSON and HTML report formats.
- Verified that the appropriate request and response bodies are included or excluded based on the specified flags.
- Improved test coverage for scenarios where both flags are used simultaneously.
* fix: remove optional chaining for request and response headers in result sanitization
- Updated the `sanitizeResultsForReporter` function to directly assign empty objects to request and response headers, ensuring consistent behavior regardless of their initial state.
- This change simplifies the code and maintains functionality for skipping headers.
* fix: openapi cli import
* chore: seperate bru and opencollection by a flag
* fix: pass down format correctly
* fix: pass format option correctly in collection tests
* Add opencollection version for YAML format
Set opencollection version for YAML format.
---------
Co-authored-by: Sid <siddharth@usebruno.com>
* fix(cli): preserve request type when importing collections
* fix(cli): fail fast on unsupported imported item types
* fix(cli): force BRU format when writing imported files
* chore: apply code rabbit fixes
* chore: adress review comment - keep changes minimal
* add additional test to test bru folder format
* agree with coderabbit, error handling is required
---------
Co-authored-by: Ramesh Sunkara <rs@rsunkara.com>
* feat: add support for skipped files in run command and update HTML report template
* refactor: enhance skipped file handling in run command
* fix: improve error display in HTML report for skipped requests
* test: add unit test for HTML report generation of skipped requests with parsing errors
* test: update HTML report generation tests to check for skipped request summaries
* refactor: extract skipped result creation logic into a separate utility function
* refactor: enhance skipped result processing in run command to include additional metadata
* refactor: rename and enhance createSkippedResults function for improved skipped file processing
* refactor: remove unused stripExtension import from run command
* refactor: rename createSkippedResults to createSkippedFileResults for clarity and consistency
* feat: add file attribute to Junit testsuite report
* test: update tests to include file attribute
* fix: update playwright tests to support the new file attribute
---------
Co-authored-by: Thomas Vackier <thomas.vackier@inthepocket.com>
Co-authored-by: Bijin A B <bijin@usebruno.com>
* Import WSDL to bruno collection
* feat(wsdl-import): remove unused code and minor refactor
---------
Co-authored-by: Bijin Bruno <bijin@usebruno.com>
* feat: enhance json environment file support in bruno-cli
feat: add parseEnvironmentJson function to normalize environment JSON structure
lint fixes
feat: added tests for invalid JSON environment files in CLI and added missing constant defenition.
feat: improve JSON environment file handling and update tests
Trigger test
fix: update CLI command syntax for non-existent JSON environment file test
fix: correct CLI command syntax in test for non-existent JSON environment file
fix: update CLI command syntax in test for non-existent JSON environment file
fix: update test to use temporary path for non-existent JSON environment file
trying to fix the tests
fix tests
refactor: rename ERROR_INVALID_JSON to ERROR_INVALID_FILE and update related error handling in CLI commands and tests
fix: update parseEnvironmentJson to preserve secret flag
test: improved tests
* refactor: move parseEnvironmentJson function to utils/ environment.js file and update imports
* test: update tests
* fix: improve file upload handling in prepare-request to use streaming
* feat: add unit tests
---------
Co-authored-by: Bijin Bruno <bijin@usebruno.com>
* feat: add support for `file` body mode in `bruno-cli` Fixes#4336
* fix: Correct await/async on file reading.
* fix: update test and fix lint errors
---------
Co-authored-by: William Floyd <william.floyd@modopayments.com>
Co-authored-by: Bijin Bruno <bijin@usebruno.com>
Co-authored-by: William Quintal <william95quintalwilliam@outlook.com>
Feat: Enhance run command to accept multiple inputs for requests and folders in Bruno CLI (Improves: #2956) (Fixes: #2955)