From 42302cbc6841da1be1b981607c4235757e3377e5 Mon Sep 17 00:00:00 2001
From: Nikita Hovratov <nikita.h@live.de>
Date: Wed, 24 Nov 2021 20:16:21 +0100
Subject: [PATCH] [BUGFIX] Fix scrolling to bottom in UpgradeCest test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The JavaScript method "scrollIntoView" does not work
for elements inside a modal or similar. It only
scrolls the main page.

A quick and easy alternative is to set "scrollTop"
to a very high value.

Resolves: #96070
Releases: master, 11.5
Change-Id: Ic5cea96177442acc57ea78cfa66b698c0dfd0f81
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72280
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Tests/Acceptance/Application/InstallTool/UpgradeCest.php    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php b/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php
index 85f228886456..50feb469aa07 100644
--- a/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php
+++ b/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php
@@ -88,9 +88,9 @@ class UpgradeCest extends AbstractCest
         $I->dontSee($textCurrentFirstPanelHeading, '#version-1');
 
         $I->amGoingTo('mark an item as unread');
+        $I->executeJS('document.querySelector(".t3js-modal-body").scrollTop = 100000;');
         $I->click('#heading-read');
         $I->waitForElement('#collapseRead', 5, ModalDialog::$openedModalSelector);
-        $I->executeJS('document.querySelector("#collapseRead").scrollIntoView();');
         $I->see($textCurrentFirstPanelHeading, '#collapseRead');
         $I->click('#collapseRead .t3js-changelog-list > div:first-child .t3js-upgradeDocs-unmarkRead');
         $I->see($textCurrentFirstPanelHeading, '#version-1');
-- 
GitLab