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

===
wait for checkbox to load
%require
===
plwr -S plwr-test wait '#agree'
---

===
checkbox starts unchecked
===
plwr -S plwr-test eval "document.getElementById('agree').checked ? 'yes' : 'no'"
---
no

===
check the checkbox
===
plwr -S plwr-test check '#agree'
---

===
checkbox is now checked
===
plwr -S plwr-test eval "document.getElementById('agree').checked ? 'yes' : 'no'"
---
yes

===
check idempotent - already checked stays checked
===
plwr -S plwr-test check '#agree'
---

===
still checked after redundant check
===
plwr -S plwr-test eval "document.getElementById('agree').checked ? 'yes' : 'no'"
---
yes

===
newsletter starts checked
===
plwr -S plwr-test eval "document.getElementById('newsletter').checked ? 'yes' : 'no'"
---
yes

===
uncheck newsletter
===
plwr -S plwr-test uncheck '#newsletter'
---

===
newsletter now unchecked
===
plwr -S plwr-test eval "document.getElementById('newsletter').checked ? 'yes' : 'no'"
---
no

===
uncheck idempotent - already unchecked stays unchecked
===
plwr -S plwr-test uncheck '#newsletter'
---

===
still unchecked after redundant uncheck
===
plwr -S plwr-test eval "document.getElementById('newsletter').checked ? 'yes' : 'no'"
---
no

===
check a radio button
===
plwr -S plwr-test check '#plan-free'
---

===
radio is checked
===
plwr -S plwr-test eval "document.getElementById('plan-free').checked ? 'yes' : 'no'"
---
yes

===
check different radio in same group
===
plwr -S plwr-test check '#plan-pro'
---

===
new radio is checked
===
plwr -S plwr-test eval "document.getElementById('plan-pro').checked ? 'yes' : 'no'"
---
yes

===
old radio is unchecked
===
plwr -S plwr-test eval "document.getElementById('plan-free').checked ? 'yes' : 'no'"
---
no

===
uncheck the agree checkbox
===
plwr -S plwr-test uncheck '#agree'
---

===
agree now unchecked
===
plwr -S plwr-test eval "document.getElementById('agree').checked ? 'yes' : 'no'"
---
no

===
re-check agree
===
plwr -S plwr-test check '#agree'
---

===
agree checked again
===
plwr -S plwr-test eval "document.getElementById('agree').checked ? 'yes' : 'no'"
---
yes
