Playwright automates browsers using really nifty APIs built into web browsers.
This program builds on that to automate tasks for QA testing webpages. Thanks to Playwright, it works across all major browsers and operating systems.
The CLI is published to npm as @eighty4/plunder and its API is published to npm as @eighty4/plunder-core.
# run directly from npm
npx @eighty4/plunder -h
# install to path and run
npm i -g @eighty4/plunder@latest
plunder -h
Plunder will take screenshots of a webpage as they would look on phones, tablets or varying pixel density desktops.
Additionally every CSS media query will add a screenshot breakpoint where a screenshot will be taken one pixel before and after the breakpoint.
plunder --out-dir www_qa https://alistapart.com
You can reuse the --out-dir
path for QAing multiple sites and pages
because webpage data will be isolated by website host and webpage path.
By default, Plunder will emulate a variety of modern phones and tablets.
Device presets are available that can be added with --device
or -d
.
This flag is a search param, so -d ipad
will match all modern iPad devices.
# emulate ipad and iphone devices
plunder -o www_qa -d ipad -d iphone https://alistapart.com
# emulate high pixel density
plunder -o www_qa -d hidpi https://alistapart.com
# list modern devices used by default
plunder devices
# see result of an explicit device queries
plunder -d hidpi devices
# an exhustive list of queryable devices
plunder -a devices
plunder links https://alistapart.com
pnpm and Node 23 are required for development.
pnpm i
pnpm -r build && node cli/lib/plunder.js -h
The web report is built with Vite and added to a Plunder capture's output directory by the CLI program. The webapp opens images from the file system via relative paths.
For this to work with Vite's development server running on localhost, the Vite server will bootstrap the app and proxy HTTP requests for screenshots to a Plunder capture's out directory.
This command can be used for rebuilding and running Plunder with the default location for Vite to bootstrap the dev server:
rm -rf webapp/.plunder && pnpm -r build && node cli/lib/plunder.js -o webapp/.plunder https://alistapart.com --device "iPad Mini"
cd webapp && pnpm dev
Bootstrapping happens on startup of the app, so run pnpm dev
anytime you update the Plunder capture's out directory.
To override the default .plunder
path, use PLUNDER_OUT_DIR
env var (this is relative to vite.config.js
):
plunder -o zztop https://zztop.com --device "iPad Mini"
PLUNDER_OUT_DIR=../zztop pnpm dev
The ci_verify.sh
script runs through all the CICD checks done on GitHub Actions:
./ci_verify.sh