hubcap check — Check a checkbox
When to use
Check a checkbox. Idempotent — does nothing if already checked. Use uncheck to uncheck.
Usage
hubcap check <selector> Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
| selector | string | yes | CSS selector of the checkbox to check |
Flags
None.
Output
| Field | Type | Description |
|---|---|---|
| checked | boolean | Whether the checkbox is now checked |
| selector | string | The selector that was used |
{"checked":true,"selector":"#agree-tos"} Errors
| Condition | Exit code | Stderr |
|---|---|---|
| Element not found | 1 | error: JS exception: Uncaught |
| Chrome not connected | 2 | error: connecting to Chrome: ... |
| Timeout | 3 | error: timeout |
Examples
Check the terms-of-service checkbox:
hubcap check '#agree-tos' Check a checkbox, then submit the form:
hubcap check '#agree-tos' && hubcap click '#submit'