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

This commit is contained in:
Rajesh Taneja 2016-02-04 10:40:23 +08:00
parent e8ef0e4f63
commit f7a73e196e

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.