MDL-55258 behat: Set focus on button before clicking it

Set the focus on button to ensure it is in
viewport before clicking on it.
This commit is contained in:
Rajesh Taneja 2016-07-19 09:23:44 +08:00
parent 36a19ecc26
commit ddf36bf5aa

View file

@ -54,6 +54,10 @@ class behat_forms extends behat_base {
// Ensures the button is present.
$buttonnode = $this->find_button($button);
// Focus on button to ensure it is in viewport, before pressing it.
if ($this->running_javascript()) {
$buttonnode->focus();
}
$buttonnode->press();
}