If the checkbox element has an ID tag then you can use code below to tick it.


FeatureContext.php


use Behat\MinkExtension\Context\MinkContext;

class FeatureContext extends MinkContext
{
/**
* @Given /^The "([^"]*)" checkbox should be checked$/
*
* @param string $id The id of checkbox field.
*/
public function theCheckboxShouldBeChecked($id)
{
$page = $this->getSession()->getPage();

$isChecked = $page->find('css', 'input[type="checkbox"]:checked#' . $id);

if (! $isChecked) {
$page->find('css', '#' . $id)->click();
}
}
}