mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
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:
parent
36a19ecc26
commit
ddf36bf5aa
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue