This step asserts that a specific checkbox should be checked. The selector parameter is a CSS selector string - such as #privacy-policy, .terms, or [name=agree] - or the exact text of the checkbox's label, its name, its id or its value (since 2.0.12). The step looks for the checkbox for up to 5 seconds; one that is not found fails the step with what was looked for, the page and a hint. It fails with The checkbox "…" is not checked. when the checkbox is not checked.
This is the selector first, modal phrasing using should be checked. It is functionally identical to Then the "selector" checkbox is checked - both call the same underlying assertion. Use whichever wording matches the tone of the surrounding steps. In BDD suites where assertions are written as obligations ("the form should be valid"), the should be phrasing often feels more natural.
Accepted phrasings
Then the "<selector>" checkbox should be checked
And the "<selector>" checkbox should be checked
Then the "<selector>" checkbox should not be checked
And the "<selector>" checkbox should not be checked
Examples
Then the "#privacy-policy" checkbox should be checked
Then the "#newsletter" checkbox should not be checked
And the "#agree" checkbox should be checked
Then the ".terms" checkbox should not be checked
In a real scenario
Scenario: Verify role assignment defaults after saving configuration
Given I am logged in as "admin@example.org"
And I go to "/admin/people/roleassign"
And wait
Then I should see "Role assign"
And the "#edit-editor" checkbox should be checked
And the "#edit-content-admin" checkbox should be checked
And the "#edit-site-admin" checkbox should be checked
And the "#edit-guest" checkbox should not be checked