MDL-52970 behat: For single select only click event is enough

This commit is contained in:
Rajesh Taneja
2016-02-19 15:24:45 +08:00
parent 86ebfb0bb5
commit 36fd5a2e74
+9 -2
View File
@@ -89,8 +89,15 @@ class behat_form_select extends behat_form_field {
return;
}
}
// This is a single select, let's pass the last one specified.
$this->field->selectOption(end($options));
// If not running JS or not a singleselect then use selectOption.
// For singleselect only click event is enough.
if (!$this->running_javascript() ||
!($this->field->hasClass('singleselect') || $this->field->hasClass('urlselect'))) {
// This is a single select, let's pass the last one specified.
$this->field->selectOption(end($options));
}
}
// With JS disabled this is enough and we finish here.