The Manual That Always Shipped Stale Screenshots
One Playwright fullPage capture per page replaces the pile of viewport screenshots that always lagged behind the shipped UI.
TL;DR
Scroll-and-stitch screenshots kept going stale, and adding more shots just produced cropped fragments nobody could follow. The fix was Playwright's fullPage option: one tall image per manual page, with element screenshots kept for single components. Captions now live in a manifest, and any section not fully visible triggers recapture instead of a caption apology.
Last month I regenerated the manual for KotaPortal's dashboard pages and found the screenshots no longer matched the shipped UI. Buttons had moved into tabs. Tables the manual still showed had become cards on the real page. Each section carried two or three viewport-height images stacked in sequence, and reading a section meant mentally stitching fragments back into one page.
More shots made it worse
My first guess: if two shots per section are confusing, add more shots, one per scroll position. The result was worse. The cuts landed wherever the viewport happened to stop, so sections came out half-cropped. A summary card split across two images proves nothing to a reader following along. I had turned the manual into a stack of fragments and called it documentation.
One image per page
The actual fix is a single option on the full page screenshot call. Playwright's screenshot accepts fullPage, which "takes a screenshot of the full scrollable page, instead of the currently visible viewport" [1]. The docs describe the result as the page rendered "as if you had a very tall screen" [2]. That phrasing corrected my mental model: this is not a zoomed-out viewport capture. The page renders at normal width and the image simply gets taller. A long dashboard produces a very tall PNG, and for a manual that is acceptable.
await page.goto('https://example.com/dashboard');
// one image for one manual page
await page.screenshot({ path: 'manual/dashboard.png', fullPage: true });
// single component still uses element screenshot
await page.locator('.chart-card').screenshot({ path: 'manual/chart-card.png' });Single components keep their own capture path. A chart that deserves its own image still uses locator.screenshot(); fullPage replaces the scroll-and-stitch routine, not element shots.
A capture contract
fullPage solved the stitching, but a screenshot only works as proof if the reader can check it against what they see. The capture contract for the manual is now one rule: every documented section must be fully visible in its image. Missing or cropped means recapture, not a caption apology.
One deliberate pause stays in the script. Playwright "automatically waits for actionability checks to pass before performing each action" [3], which covers clicks and navigation. A screenshot is not an action on an element, so the auto-wait does not guarantee the visible proof is in frame. A confirmation dialog appearing 300 milliseconds after a click, or a toast, can still miss the capture. The script waits for that dialog explicitly before screenshotting.
Captions as data
Captions stopped being text under an image and became data in a manifest:
page: dashboard
image: dashboard.png
sections:
- id: ringkasan-penjualan
caption: Kartu ringkasan di bagian paling atas
- id: grafik-mingguan
caption: Grafik mingguan dengan filter tanggal
- id: tabel-pesanan
caption: Tabel pesanan terbaru beserta statusnyaThe generator renders the caption and logic list above the image, not below it. A reader gets the map of a section before the picture. The manifest doubles as the contract checklist: a section id in the manifest with no matching area in the tall image fails review before the manual ships.
The stale manual was never a screenshot tooling problem. It was a missing contract problem, and fullPage made keeping that contract cheap enough to actually keep.
---
Sources
[1] https://playwright.dev/docs/api/class-page [2] https://playwright.dev/docs/screenshots [3] https://playwright.dev/docs/writing-tests