Skip to content

Commit

Permalink
[TASK] Streamline tab-handling in ElementsBasicInput cests
Browse files Browse the repository at this point in the history
* 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 <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
  • Loading branch information
bnf committed Feb 18, 2022
1 parent 1d048aa commit 911503d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
Expand Up @@ -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);
}

/**
Expand Down
Expand Up @@ -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');
}

Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -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');
}

/**
Expand Down
Expand Up @@ -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');
}

Expand Down

0 comments on commit 911503d

Please sign in to comment.