MDL-43394 behat: Fix checkbox action

This commit is contained in:
Aaron Barnes
2013-12-23 15:40:06 +13:00
parent edd9bb451c
commit 832530e2eb
@@ -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();