Skip to main content
Community
Q&A

Best approach for testing file downloads in Playwright?

Ajitesh Mohanta
Ajitesh MohantaAmbassador
2w ago 755 0
I need to test that a CSV export button downloads the correct file with the right data. Our app generates the file server-side and streams it. I've tried `page.waitForEvent('download')` and it works sometimes, but I'm not sure how to: - Assert on the file contents (not just that a download happened) - Handle cases where the download URL is a redirect chain - Make this reliable in headless CI Any patterns or utility functions you'd recommend?

No replies yet. Be the first to answer this question!

Join the discussion

Sign in to join the discussion

Sign in
Best approach for testing file downloads in Playwright? — Community | QABash