Read a chunked ReadableStream token-by-token and assert completion, or abort it mid-stream
A ReadableStream emits one word every ~140ms then closes โ you must consume it incrementally instead of awaiting the whole response
GET /api/lab/stream returns a chunked text/plain body. Awaiting the full response (or waitForResponse) blocks until the last byte arrives โ to observe progress you read response.body.getReader() in a loop.
GET /api/lab/stream
text/plain
waitForResponse
response.body.getReader()
Status: idle
Begin reading, watch the typewriter fill, or abort mid-stream
Automation hints
waitForResponse("/api/lab/stream")
response.text()
#stream-start
#stream-output
textContent.length
#stream-output[data-complete="true"]
done
#stream-stop
AbortController
data-complete
"false"
#stream-status
aborted
#stream-status[data-status]
streaming
complete