bruno
bruno copied to clipboard
Add context to request execution
I have the need to now the execution context of the request:
- Name of the Request executed
- Path of the .bru name
- Execution mode: single, runner, cli
- Associated documentation of the request
This will allow me to take some decisions in scripts, such as how to name logs, where to find data associated to every request, apply or exclude some tests depending on the way it is launched, etc.
Pre Request script example
console.log("-------- executionMode ----------")
console.log(bru.getVar("executionMode"))
console.log("-------- pathname ----------")
console.log(bru.getVar("currentItem").pathname)
console.log("-------- filename ----------")
console.log(bru.getVar("currentItem").filename)
Outputs
I am preparing a PR with this solution