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
{{ message }}
Repository navigation
request-mocking.md "Delayed Response" example uses setTimeout, which run-code doesn't provide #471
When the route fires, the handler throws ReferenceError: setTimeout is not defined, and the request never gets fulfilled (it hangs until the client gives up).
Repro (playwright-cli 0.1.21, Chrome 153, macOS):
playwright-cli -s=t open http://127.0.0.1:8767/page.html
playwright-cli -s=t run-code "async page => { await page.route('**/api/slow', async route => { await new Promise(r => setTimeout(r, 300)); route.fulfill({ body: 'loaded' }); }); }"
playwright-cli -s=t --raw eval"async () => { const c = new AbortController(); setTimeout(() => c.abort(), 5000); try { const r = await fetch('/api/slow', { signal: c.signal }); return r.status; } catch (e) { return e.name; } }"# prints ReferenceError: setTimeout is not defined, then "AbortError"
run-code "async page => typeof setTimeout" returns "undefined". The same is true of URL, fetch, Buffer, crypto and AbortController.
Activity
chore: mark v0.1.22 (#473)