feat(web): collect multiple downloads from one trigger
Merged
RU
18d ago+344+344+012345678901234567890123456789-67-67-01234567890123456789
- Adds
browser.waitForDownloads(trigger, { count, timeout? }): runs the trigger once and saves the firstcountdownloads in start order, each attached as adownloadartifact. waitForDownloadandwaitForDownloadsshare onecollectDownloads()(packages/web/src/browser.ts). One budget bounds start, completion and save, so a stalled single download now fails at its timeout instead of hanging.- On timeout or cancel it removes the listener, aborts saving, cancels started downloads, and attaches nothing late. Trigger errors keep their own classification.
const files = await browser.waitForDownloads(() => screen.getByRole('button', { name: 'Export all' }).click(), { count: 2 });
Verified
Ran it locally: yes
routes.test.ts(local Chromium) andprovider-downloads.test.ts(remote provider disk): 1 and 2 files from one trigger, stalled HTTP body and stalled provider read fail withdid not finishat the timeout, pending trigger cancels started downloads and attaches nothing, listener removed on every failure. On main the single-download stall cases hang past the timeout.- Full
packages/websuite: 609 passed.