From 911503d18c27c4ff522593ef5c1e213b464d5add Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 17 Feb 2022 16:02:45 +0100 Subject: [PATCH] [TASK] Streamline tab-handling in ElementsBasicInput cests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Avoid scrollIntoView which is no longer needed since #96947 * Do not catch exceptions on tab-click in ElementsBasicInputRangeCest which has been introduced in #93629, but actually didn't catch the documented case where the tab was already active (no exception in that case). It was actually only triggered when the tab was scrolled away. Again no longer needed due to #96947. Resolves: #96951 Related: #96947 Related: #93629 Releases: main, 11.5 Change-Id: I787960ea5dd8a6c946e090d90c4c9d2ecb950e68 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73586 Tested-by: core-ci Tested-by: Stefan Bürk Tested-by: Benjamin Franzke Reviewed-by: Stefan Bürk Reviewed-by: Benjamin Franzke --- .../FormEngine/ElementsBasicInputDateCest.php | 4 +--- .../FormEngine/ElementsBasicInputEvalCest.php | 4 +--- .../FormEngine/ElementsBasicInputRangeCest.php | 11 ++--------- .../FormEngine/ElementsBasicInputTextTableCest.php | 3 +-- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputDateCest.php b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputDateCest.php index 6bf567effbcf..b52565bfc9b9 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputDateCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputDateCest.php @@ -49,11 +49,9 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void $I->waitForElementNotVisible('#t3js-ui-block'); $I->waitForText('Edit Form', 3, 'h1'); - // scroll up all the way to get a clean shot to the tab panel - $I->executeJS('document.querySelector(".t3js-tabs").scrollIntoView({block: "end"});'); + // Make sure the test operates on the "inputDateTime" tab $I->click('inputDateTime'); - $I->waitForText('inputDateTime', 3); } /** diff --git a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputEvalCest.php b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputEvalCest.php index d5796725f3d7..a75aab575f60 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputEvalCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputEvalCest.php @@ -47,9 +47,7 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void $I->waitForElementNotVisible('#t3js-ui-block'); $I->waitForText('Edit Form', 3, 'h1'); - // scroll up all the way to get a clean shot to the tab panel - $I->executeJS('document.querySelector(".t3js-tabs").scrollIntoView({block: "end"});'); - + // Make sure the test operates on the "input" tab $I->click('input'); } diff --git a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputRangeCest.php b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputRangeCest.php index 0e837140745b..c9217dcd407f 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputRangeCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputRangeCest.php @@ -18,8 +18,6 @@ namespace TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine; use Codeception\Example; -use Facebook\WebDriver\Exception\ElementClickInterceptedException; -use Facebook\WebDriver\Exception\UnknownServerException; use TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester; use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree; @@ -49,13 +47,8 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void $I->waitForElementNotVisible('#t3js-ui-block'); $I->waitForText('Edit Form', 3, 'h1'); - try { - // make sure the test operates on the input tab - $I->click('input'); - $I->waitForText('input', 3); - } catch (ElementClickInterceptedException|UnknownServerException $exception) { - // nothing to do, the tab is already active - } + // Make sure the test operates on the "input" tab + $I->click('input'); } /** diff --git a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php index ddd349597c72..ed4f5b3e2c66 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php @@ -51,9 +51,8 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void $I->waitForElementNotVisible('#t3js-ui-block'); $I->waitForText('Edit Form', 3, 'h1'); - // scroll up all the way to get a clean shot to the tab panel - $I->executeJS('document.querySelector(".module h1").scrollIntoView({ block: "end" });'); + // Make sure the test operates on the "text" tab $I->click('text'); }