Skip to content

Commit e485d95

Browse files
authored
Add scroll to bottom of page (#14)
1 parent 51f8bb4 commit e485d95

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/BehatContext/WebContext.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,19 @@ public function iScrollToTop()
300300
}
301301
}
302302

303+
304+
/**
305+
* @When I scroll to bottom
306+
*/
307+
public function iScrollToBottom()
308+
{
309+
try {
310+
$this->getSession()->executeScript("(function(){window.scrollTo(0, document.body.scrollHeight);})();");
311+
} catch (Exception $e) {
312+
throw new \Exception("ScrollToBottom failed");
313+
}
314+
}
315+
303316
/**
304317
* @param string $option
305318
* @param string $select

0 commit comments

Comments
 (0)