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

===
wait for h1
===
plwr -S plwr-test wait h1
---

===
wait-not for nonexistent element
===
plwr -S plwr-test wait-not .does-not-exist -T 1000
---

===
exists returns 0 for existing element
===
plwr -S plwr-test exists h1
---

===
exists returns 1 for missing element
===
! plwr -S plwr-test exists .does-not-exist
---

===
get text content of h1
===
plwr -S plwr-test text h1
---
Test Page

===
get attribute value
===
plwr -S plwr-test attr a href
---
/form.html

===
attr returns nothing for missing attribute
===
plwr -S plwr-test attr h1 data-nonexistent
---

===
count matching elements
===
plwr -S plwr-test count p
---
2

===
tree dumps element as JSON
===
plwr -S plwr-test tree h1
---
{
  "tag": "h1",
  "text": "Test Page"
}
