Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36a19ec
)
MDL-55258 behat: Set focus on button before clicking it
author
Rajesh Taneja
<rajesh@moodle.com>
Tue, 19 Jul 2016 01:23:44 +0000
(09:23 +0800)
committer
Rajesh Taneja
<rajesh@moodle.com>
Tue, 19 Jul 2016 01:23:44 +0000
(09:23 +0800)
Set the focus on button to ensure it is in
viewport before clicking on it.
lib/tests/behat/behat_forms.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/tests/behat/behat_forms.php
b/lib/tests/behat/behat_forms.php
index
2345962
..
d681d2c
100644
(file)
--- a/
lib/tests/behat/behat_forms.php
+++ b/
lib/tests/behat/behat_forms.php
@@
-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();
}