From 832530e2eb4f2bfe754ffa9f0ca3458837b1d054 Mon Sep 17 00:00:00 2001 From: Aaron Barnes Date: Mon, 16 Dec 2013 17:08:08 +1300 Subject: [PATCH] MDL-43394 behat: Fix checkbox action --- lib/behat/form_field/behat_form_checkbox.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/behat/form_field/behat_form_checkbox.php b/lib/behat/form_field/behat_form_checkbox.php index 73f9b61d213..fb220d1cf35 100644 --- a/lib/behat/form_field/behat_form_checkbox.php +++ b/lib/behat/form_field/behat_form_checkbox.php @@ -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();