Merge branch 'wip-mdl-55258-m' of https://github.com/rajeshtaneja/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 19 Jul 2016 10:13:00 +0000 (12:13 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 19 Jul 2016 10:13:00 +0000 (12:13 +0200)
lib/tests/behat/behat_forms.php

index 2345962..d681d2c 100644 (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();
     }