You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched existing issues and found nothing related to my issue.
Describe the bug
SO: Fedora 40
Bruno takes 2 requests to apply the changes made by a script
Step1: Configure an environment with butBody var (it doesn't work in another way)
Step2: Modify script. i.e. change bar2 to bar 3
Step3: Make a request, the server will show the following body: {"foo":"bar","foo2":"bar2"}
Step3: Make another request, the server will show the following body: {"foo":"bar","foo2":"bar3"}
Can confirm this is happening at least since version 1.15.0. It seems like Bruno is not waiting for pre-request scripts to be completed, so if complex data generation takes place in pre-request script then variables won't be set in time for Bruno to use them on request.
I have checked the following:
Describe the bug
SO: Fedora 40
Bruno takes 2 requests to apply the changes made by a script
Step1: Configure an environment with
butBody
var (it doesn't work in another way)Step2: Modify script. i.e. change
bar2
tobar 3
Step3: Make a request, the server will show the following body:
{"foo":"bar","foo2":"bar2"}
Step3: Make another request, the server will show the following body:
{"foo":"bar","foo2":"bar3"}
.bru file to reproduce the bug
meta {
name: local
type: http
seq: 2
}
post {
url: http://localhost:8000
body: json
auth: none
}
body:json {
{{putBody}}
}
script:pre-request {
var body = {}
body.foo = "bar"
body.foo2 = "bar5"
bru.setEnvVar("putBody", JSON.stringify(body));
}
Screenshots/Live demo link
https://drive.google.com/file/d/1F4tUotrimFsV5YBcaocVxjxSIGRVzKxK/view?usp=sharing
The text was updated successfully, but these errors were encountered: