diff --git a/enrol/tests/behat/behat_enrol.php b/enrol/tests/behat/behat_enrol.php index 6218b31b8dd..2c65a61b6b8 100644 --- a/enrol/tests/behat/behat_enrol.php +++ b/enrol/tests/behat/behat_enrol.php @@ -65,7 +65,9 @@ class behat_enrol extends behat_base { $this->execute("behat_forms::i_set_the_following_fields_to_these_values", $table); // Ensure we get button in focus, before pressing button. - $this->execute("behat_general::i_take_focus_off_field", array(get_string('addinstance', 'enrol'), "button")); + if ($this->running_javascript()) { + $this->execute("behat_general::i_take_focus_off_field", array(get_string('addinstance', 'enrol'), "button")); + } // Save changes. $this->execute("behat_forms::press_button", get_string('addinstance', 'enrol'));