Commit aef7cdb3 authored by Rebecca Blundell's avatar Rebecca Blundell
Browse files

Bug 1708335 - add wait til scroll finishes to scroll steps

This is an experiment to see if this will make the scroll steps less
likely to cause false fails.

behatnotneeded

Change-Id: I7a73b26a60922c25a0f5d4a131eedba205626cbe
parent f502ca15
...@@ -1262,10 +1262,11 @@ class BehatGeneral extends BehatBase { ...@@ -1262,10 +1262,11 @@ class BehatGeneral extends BehatBase {
$function = <<<JS $function = <<<JS
(function(){ (function(){
window.scrollTo(0,0); window.scrollTo(0,0);
return 1;
})() })()
JS; JS;
try { try {
$this->getSession()->executeScript($function); $this->getSession()->wait(5000, $function);
} }
catch(Exception $e) { catch(Exception $e) {
throw new \Exception("scrollToTop failed"); throw new \Exception("scrollToTop failed");
...@@ -1283,10 +1284,11 @@ JS; ...@@ -1283,10 +1284,11 @@ JS;
(function(){ (function(){
var elem = document.getElementById("$id"); var elem = document.getElementById("$id");
elem.scrollIntoView(true); elem.scrollIntoView(true);
return 1;
})() })()
JS; JS;
try { try {
$this->getSession()->executeScript($function); $this->getSession()->wait(5000, $function);
} }
catch(Exception $e) { catch(Exception $e) {
throw new \Exception("scrollIntoView failed"); throw new \Exception("scrollIntoView failed");
...@@ -1304,10 +1306,11 @@ JS; ...@@ -1304,10 +1306,11 @@ JS;
(function(){ (function(){
var elem = document.getElementById("$id"); var elem = document.getElementById("$id");
elem.scrollIntoView(false); elem.scrollIntoView(false);
return 1;
})() })()
JS; JS;
try { try {
$this->getSession()->executeScript($function); $this->getSession()->wait(5000, $function);
} }
catch(Exception $e) { catch(Exception $e) {
throw new \Exception("scrollIntoView failed"); throw new \Exception("scrollIntoView failed");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment