Open joeng03 opened 3 months ago
Multiple Output Formats: Allow the --format option to accept an array of formats (e.g., html, json, junit) instead of just one. This enhancement would enable generating reports in different formats within a single run. Currently, to obtain reports in multiple formats, we have to rerun the tests for each format, which can lead to inconsistent results due to test variability.
As of v1.29.0, it is possible to generate multiple reports at the same time:
npx bru run request.bru --reporter-json results.json --reporter-junit results.xml --reporter-html results.html
Post-Test Script Execution: Introduce the ability to pass in a script or function to run after the tests complete, or conditionally execute if certain criteria are met (e.g., if some test cases fail).
I second this. Having the ability to configure custom reporters would be a great addition. For example, in my current project, we need to upload Bruno's test results to Xray. We wrote a small utility script to convert Bruno's JSON report into the format Xray expects. But I think it would be better if we released our script as an npm package so that other people could use it by simply importing it as a custom reporter.
I have checked the following:
Describe the feature you want to add
When working with Bruno on a company project, I identified several areas where the Bruno CLI could benefit from increased flexibility and extensibility. Here are the features I propose:
[ ] Multiple Output Formats: Allow the --format option to accept an array of formats (e.g., html, json, junit) instead of just one. This enhancement would enable generating reports in different formats within a single run. Currently, to obtain reports in multiple formats, we have to rerun the tests for each format, which can lead to inconsistent results due to test variability.
[ ] Post-Test Script Execution: Introduce the ability to pass in a script or function to run after the tests complete, or conditionally execute if certain criteria are met (e.g., if some test cases fail). This feature would allow users to leverage existing information, such as test results and environment variables, for post-processing tasks. Currently, the workaround involves running the tests, outputting a JSON file, and then executing a separate script to process the results, which is cumbersome and inefficient. Moreover, since the CLI calls
process.exit()
immediately when there are failed tests, it is not possible to run asynchronous functions(such as sending alerts to an API endpoint) before the process exits.[ ] Environment Variables as Objects: Allow users to pass environment variables as an object, instead of string. This improvement would facilitate calling the
handler()
function from@usebruno/cli/src/commands/run
and passing sensitive information, such as credentials, securely. This enhancement addresses #2015.Mockups or Images of the feature