Eğer selectboxun ID etiketi var ise aşağıdaki örneği kullanabilirsiniz.


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();
}
}
}