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 {
$function = <<<JS
(function(){
window.scrollTo(0,0);
return 1;
})()
JS;
try {
$this->getSession()->executeScript($function);
$this->getSession()->wait(5000, $function);
}
catch(Exception $e) {
throw new \Exception("scrollToTop failed");
......@@ -1283,10 +1284,11 @@ JS;
(function(){
var elem = document.getElementById("$id");
elem.scrollIntoView(true);
return 1;
})()
JS;
try {
$this->getSession()->executeScript($function);
$this->getSession()->wait(5000, $function);
}
catch(Exception $e) {
throw new \Exception("scrollIntoView failed");
......@@ -1304,10 +1306,11 @@ JS;
(function(){
var elem = document.getElementById("$id");
elem.scrollIntoView(false);
return 1;
})()
JS;
try {
$this->getSession()->executeScript($function);
$this->getSession()->wait(5000, $function);
}
catch(Exception $e) {
throw new \Exception("scrollIntoView failed");
......
Markdown is supported
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