This step asserts that a specific checkbox is not checked. The selector parameter is a CSS selector string - such as #newsletter, .terms, or [name=marketing] - 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 … is checked, but it should not be. when the checkbox is checked.
This is the negative form of the selector first, present tense phrasing family. It is equivalent to using Then the "selector" checkbox is not checked - the step is documented separately to make it easy to locate the not-checked variant in search results. Use it after an action that should have unchecked a box, or to confirm a box is off by default when the page loads.
Accepted phrasings
Then the "<selector>" checkbox is not checked
And the "<selector>" checkbox is not checked
Examples
Then the "#newsletter" checkbox is not checked
And the "#marketing-opt-in" checkbox is not checked
Then the ".terms" checkbox is not checked
And the "[name=analytics]" checkbox is not checked
In a real scenario
Scenario: Optional notifications are off by default for new accounts
Given I am logged in as "newuser@example.org"
And I go to "/account/settings"
Then I should see "Notification preferences"
And the "#promo-emails" checkbox is not checked
And the "#partner-offers" checkbox is not checked
And the "#sms-alerts" checkbox is not checked