I understand from the documentation that calls such as k6.http
run synchronously.
However, does code in groups also run synchronously, both intra-group and inter-group?
An example where I am curious would be:
group("visit type A", function () {
http.get(BASE_URL + "example.html");
const response = http.batch([
["GET", BASE_URL + "topbar.html"],
["GET", BASE_URL + "navbar.html"],
]);
console.log(1);
}
console.log(2);
group("visit type B", function () {
http.get(BASE_URL + "example2.html");
const response = http.batch([
["GET", BASE_URL + "topbar.html"],
["GET", BASE_URL + "navbar.html"],
]);
console.log(3);
}
console.log(4);
I would assume this would work synchronously, based on an answer here.
My intention is to replace these console.log() statements with code which manages internal state of a modelled user (e.g., the total number of items bought in a demo shopping application), conditionally based on responses.