Sample files for automated testing
Small, deterministic fixtures for Playwright, Selenium, Cypress and unit tests.
Automated tests need fixtures that never change. A file that differs between runs makes failures impossible to reproduce, and a file fetched from the network on every run makes the suite slow and fragile.
Download the samples you need once, commit them next to your tests, and refer to them by path. The small sizes exist for this purpose: a 1 KB or 10 KB file adds almost nothing to a repository.
Recommended files
| File | Size | Why this one | Download |
|---|---|---|---|
| 10 KB PDF samplesample-pdf-10kb.pdf | 10 KB10,240 bytes | Small valid PDF for upload tests | Download PDF |
| 1 KB PNG samplesample-png-1kb.png | 1 KB1,024 bytes | Tiny valid image | Download PNG |
| 10 KB CSV samplesample-csv-10kb.csv | 10 KB10,240 bytes | About a hundred rows for import tests | Download CSV |
| 1 KB JSON samplesample-json-1kb.json | 1 KB1,024 bytes | Minimal structured fixture | Download JSON |
| One-pixel PNG (1 × 1)sample-pixel-1x1.png | 69 B69 bytes | Smallest possible image | Download PNG |
Checklist
Vendor your fixtures
Copy files into the repository, for example under tests/fixtures. Do not download them during the test run.
Prefer the smallest file that proves the point
Use 1 KB and 10 KB samples for behaviour tests and keep large files for a separate, slower suite.
Assert on content, not only on success
After an upload, check the stored size or checksum rather than just the success message.
Generate very large files at run time
For sizes above a few megabytes, create the file in a setup step instead of committing it.
Guides
- File upload and download testing with Playwright
setInputFiles, file choosers, in-memory files, download assertions and API uploads, with working examples.
- File upload testing with Selenium WebDriver
Uploading with send_keys in Python and Java, remote grids, hidden inputs, multiple files and downloads.
- How to create test files of any size
Commands for Linux, macOS and Windows that produce a file of an exact byte count, and when to use each.
Related use cases
Frequently asked questions
- Can my tests download fixtures from this site at run time?
- They can, but they should not. A test that depends on a third-party site fails when the network does. Commit the files, or cache them in your CI system.
- How do I upload a file in Playwright?
- Call setInputFiles on the file input locator with the path to the fixture. The Playwright guide on this site has complete examples.