Skip to content

Commit ef49b13

Browse files
Merge branch '4.6'
2 parents bf2f5ce + c09f95c commit ef49b13

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/Behat/Component/Pagination.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ public function clickNextButton(): void
2222
{
2323
$currentPage = (int) $this->getHTMLPage()->find($this->getLocator('currentPage'))->getText();
2424
// scroll to the bottom to avoid "Go to top" button
25-
$this->getHTMLPage()->executeJavaScript("document.querySelector('.ibexa-back-to-top-scroll-container').scrollTo(0, document.querySelector('.ibexa-back-to-top-scroll-container').scrollHeight)");
25+
$this->getHTMLPage()->executeJavaScript(<<<'JS'
26+
document.querySelector('.ibexa-back-to-top-scroll-container') && document.querySelector('.ibexa-back-to-top-scroll-container').scrollTo(0, document.querySelector('.ibexa-back-to-top-scroll-container').scrollHeight);
27+
JS);
2628
$this->getHTMLPage()
2729
->setTimeout(3)
28-
->find(new VisibleCSSLocator('backToTopWithTitle', '.ibexa-back-to-top__title--visible'))
29-
->assert()->textEquals('Go to top');
30+
->findAll(new VisibleCSSLocator('backToTopWithTitle', '.ibexa-back-to-top__title--visible'));
3031
$this->getHTMLPage()->find($this->getLocator('nextButton'))->click();
3132
$this->getHTMLPage()->setTimeout(10)->waitUntil(function () use ($currentPage): bool {
3233
$activePge = (int) $this->getHTMLPage()->find($this->getLocator('currentPage'))->getText();

0 commit comments

Comments
 (0)