CLI and CI/CD automation: curl, wget, PowerShell, Playwright and Python recipes

Copy-ready commands for fetching hosted sample files, verifying SHA-256 checksums automatically in continuous integration pipelines, and synthesizing deterministic fixtures locally when offline.

1. Fetching and verifying hosted sample files with curl and wget

All hosted fixtures under /pub-files/, /mock-data/, /files.json, and /checksums.txt have direct, permanent static URLs that work with curl, wget, and HTTP Range requests. Rather than repeating boilerplate download snippets on every single format page, we centralize all command-line patterns here:

# Download a single hosted sample file with curl (-f fails on HTTP errors, -L follows redirects, -O keeps filename)
curl -fLO https://www.sampletestfiles.com/assets/gen/seeds/tier1-parquet-sample-parquet-sales-100-parquet.seed

# Download with wget into a dedicated test-fixtures directory
wget -P ./test-fixtures https://www.sampletestfiles.com/assets/gen/seeds/tier1-sqlite-sample-sqlite-company-sqlite.seed

# Fetch checksums.txt and verify all downloaded files in the current directory in one step
curl -fsSLO https://www.sampletestfiles.com/checksums.txt
sha256sum -c --ignore-missing checksums.txt

2. Windows PowerShell automation (Invoke-WebRequest & Get-FileHash)

In Windows PowerShell 5.1 and PowerShell 7+, use Invoke-WebRequest paired with Get-FileHash to download and assert cryptographic integrity inside a CI script:

$Url = "https://www.sampletestfiles.com/assets/gen/seeds/datasets-sales-100rows-csv.seed"
$Out = "$PSScriptRoot\sales-100rows.csv"
Invoke-WebRequest -Uri $Url -OutFile $Out -UseBasicParsing
$Hash = (Get-FileHash -Path $Out -Algorithm SHA256).Hash.ToLower()
Write-Host "Downloaded $Out (SHA-256: $Hash)"

3. Querying /files.json programmatically in Python or Node.js

The root manifest /files.json lists every sample file on the site along with its format, MIME type, exact byte length, and 64-character hexadecimal SHA-256 digest:

import hashlib
import urllib.request
import json

with urllib.request.urlopen("https://www.sampletestfiles.com/files.json") as resp:
    manifest = json.load(resp)

# Filter for direct static files under /pub-files/
direct = [f for f in manifest["files"] if f.get("delivery") == "direct-static"]
print(f"Found {len(direct)} direct static fixtures in manifest.")

4. Automated upload testing in Playwright, Cypress and Selenium

Once you have saved your required sample files into your repository's tests/fixtures/ directory, attach them directly to file inputs in your end-to-end tests:

Frequently asked questions

Can I fetch the 100 MB or 1 GB sized files with curl?
Files in /pub-files/ and /mock-data/ are direct static assets that work directly with curl and wget. By contrast, the 1 KB to 1 GB sized variants on /sample-files/<format>/<size>/ are synthesized in the visitor's browser via our Web Worker / Service Worker generator, so for CLI scripts you should either download them once in a browser or use the local commands documented on /methodology/.
Is /files.json served with CORS headers?
Yes. /_headers sets Access-Control-Allow-Origin: * on both /files.json and /mock-data/*.

Operational transparency, verification and developer reference

For technical questions or feedback regarding SampleTestFiles, contact contact@sjwebtechwork.com. Every sample file, dataset, and diagnostic utility on this site follows strict reproducibility and privacy rules: