Replies: 1 comment 3 replies
-
weird use case, but yes it works @shouldLoop={{true}}
# @loop while shouldLoop
GET https://httpbin.org/anything?foo={{$randomInt 1 9}}
{{@response
async function writeStream(){
const randomVal = response.parsedBody.args.foo;
if(randomVal && +randomVal > 7){ // replace with response.statusCode === 200
exports.shouldLoop= false;
// asserts
}
await sleep(1000);
}
exports.waitPromise = writeStream();
}} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to make a http request and poll (or loop in some way) until the response (a
status
field within the response) goes into completed state. Is this doable easily? Once completed, then run the asserts.Beta Was this translation helpful? Give feedback.
All reactions