MDL-43394 behat: Fix checkbox action

This commit is contained in:
Aaron Barnes
2013-12-23 16:00:06 +13:00
parent 5d2169e053
commit a6cf46f473
@@ -47,6 +47,11 @@ class behat_form_checkbox extends behat_form_field {
*/
public function set_value($value) {
if (!$this->running_javascript()) {
$this->field->check();
return;
}
if (!empty($value) && !$this->field->isChecked()) {
// Check it if it should be checked and it is not.
$this->field->click();