===
navigate to test page
%require
===
plwr -S plwr-test open "http://localhost:8599/index.html"
---

===
take full page screenshot
===
plwr -S plwr-test screenshot --path /tmp/plwr-test-full.png
---
Saved {{ bytes:number }} bytes to /tmp/plwr-test-full.png
---
where
* bytes > 1000

===
screenshot file exists
===
test -f /tmp/plwr-test-full.png
---

===
take element screenshot
===
plwr -S plwr-test screenshot --selector h1 --path /tmp/plwr-test-h1.png
---
Saved {{ bytes:number }} bytes to /tmp/plwr-test-h1.png
---
where
* bytes > 100

===
element screenshot is smaller than full page
===
bash -c 'full=$(wc -c < /tmp/plwr-test-full.png); elem=$(wc -c < /tmp/plwr-test-h1.png); echo "$elem $full"; test "$elem" -lt "$full"'
---
