원클릭으로
quarto-preview-test
// Use when testing preview functionality, verifying live reload, or validating preview fixes. Covers starting preview with port/logging, browser verification via /agent-browser, and checking logs/filesystem for artifacts.
// Use when testing preview functionality, verifying live reload, or validating preview fixes. Covers starting preview with port/logging, browser verification via /agent-browser, and checking logs/filesystem for artifacts.
| name | quarto-preview-test |
| description | Use when testing preview functionality, verifying live reload, or validating preview fixes. Covers starting preview with port/logging, browser verification via /agent-browser, and checking logs/filesystem for artifacts. |
Interactive testing of quarto preview with automated browser verification.
| Tool | When to use |
|---|---|
/agent-browser | Preferred. Token-efficient browser automation. Navigate, verify content, screenshot. |
| Chrome DevTools MCP | Deep debugging: console messages, network requests, DOM inspection. |
jq / grep | Parse debug log output. |
./configure.sh or ./configure.cmd)tests/configure-test-env.sh or tests/configure-test-env.ps1)/agent-browser CLI installed (preferred), OR Chrome + Chrome DevTools MCP connectedPreview needs the test venv for Jupyter tests. Activate it first (tests/.venv), matching how run-tests.sh / run-tests.ps1 do it.
# Linux/macOS
source tests/.venv/bin/activate
./package/dist/bin/quarto preview <file-or-dir> --no-browser --port 4444
# Windows (Git Bash)
source tests/.venv/Scripts/activate
./package/dist/bin/quarto.cmd preview <file-or-dir> --no-browser --port 4444
Use --no-browser to control browser connection. Use --port for a predictable URL.
./package/dist/bin/quarto preview <file> --no-browser --port 4444 --log-level debug 2>&1 | tee preview.log
# Linux/macOS (after venv activation)
./package/dist/bin/quarto preview <file> --no-browser --port 4444 &
PREVIEW_PID=$!
# ... run verification ...
kill $PREVIEW_PID
# Windows (Git Bash, after venv activation)
./package/dist/bin/quarto.cmd preview <file> --no-browser --port 4444 &
PREVIEW_PID=$!
# ... run verification ...
kill $PREVIEW_PID
The core test pattern:
--no-browser --port 4444/agent-browser to navigate to http://localhost:4444/ and verify contentIn browser (via /agent-browser): Page loads, content matches source, updates reflect edits.
In terminal/logs: No BadResource errors, no crashes, preview stays responsive.
On filesystem: No orphaned temp files, cleanup happens on exit.
On Windows, kill from Git Bash does not trigger Quarto's onCleanup handler (SIGINT doesn't propagate to Windows processes the same way). Cleanup-on-exit verification requires an interactive terminal with Ctrl+C. For automated testing, verify artifacts during preview instead.
Preview behaves differently depending on input:
| Input | Code path |
|---|---|
| Single file (no project) | preview() -> renderForPreview() |
| File within a project | May redirect to project preview via serveProject() |
| Project directory | serveProject() -> watchProject() |
See llm-docs/preview-architecture.md for the full architecture.
tests/smoke/ insteadquarto renderThe full test matrix lives in tests/docs/manual/preview/README.md. Test fixtures live alongside it in tests/docs/manual/preview/.
When invoked with test IDs (e.g., /quarto-preview-test T17 T18):
tests/docs/manual/preview/README.md#### T17:)tests/docs/manual/preview/When invoked with a topic description instead of IDs (e.g., /quarto-preview-test root URL or "run preview tests for single-file"):
tests/docs/manual/preview/README.mdFound these matching tests:
- T17: Single-file preview — root URL accessible (#14298)
- T18: Single-file preview — named output URL also accessible
Run these? [Y/n]
When invoked without test IDs or topic (e.g., /quarto-preview-test), use the general Edit-Verify Cycle workflow described above for ad-hoc preview testing. The test matrix is for targeted regression testing.
Compare dev build against installed release to distinguish regressions:
quarto --version # installed
./package/dist/bin/quarto --version # dev
If both show the same issue, it's pre-existing.