-
+
-
-
+
+
+
diff --git a/Tests/Acceptance/Backend/ContentDefenderCest.php b/Tests/Acceptance/Backend/ContentDefenderCest.php
index efcb31e9..fa31f489 100644
--- a/Tests/Acceptance/Backend/ContentDefenderCest.php
+++ b/Tests/Acceptance/Backend/ContentDefenderCest.php
@@ -43,10 +43,8 @@ public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsD
$I->wait(0.5);
$I->switchToContentFrame();
$dataColPos = $I->getDataColPos(300, 200);
- $I->waitForElement('#element-tt_content-300 [data-colpos="' . $dataColPos . '"]');
- $newContentElementLabel = $I->getNewContentElementLabel();
-
- $I->click($newContentElementLabel, '#element-tt_content-300 [data-colpos="' . $dataColPos . '"]');
+ $colPosSelector = '#element-tt_content-300 [data-colpos="' . $dataColPos . '"]';
+ $I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
@@ -72,9 +70,8 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizard(Backe
$I->wait(0.5);
$I->switchToContentFrame();
$dataColPos = $I->getDataColPos(800, 200);
- $I->waitForElement('#element-tt_content-800 [data-colpos="' . $dataColPos . '"]');
- $newContentElementLabel = $I->getNewContentElementLabel();
- $I->click($newContentElementLabel, '#element-tt_content-800 [data-colpos="' . $dataColPos . '"]');
+ $colPosSelector = '#element-tt_content-800 [data-colpos="' . $dataColPos . '"]';
+ $I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
@@ -153,9 +150,8 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewEl
$I->wait(0.5);
$I->switchToContentFrame();
$dataColPos = $I->getDataColPos(801, 200);
- $I->waitForElement('#element-tt_content-801 [data-colpos="' . $dataColPos . '"]');
- $newContentElementLabel = $I->getNewContentElementLabel();
- $I->click($newContentElementLabel, '#element-tt_content-801 [data-colpos="' . $dataColPos . '"]');
+ $colPosSelector = '#element-tt_content-801 [data-colpos="' . $dataColPos . '"]';
+ $I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
@@ -253,9 +249,8 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer(
$I->wait(0.5);
$I->switchToContentFrame();
$dataColPos = $I->getDataColPos(402, 202);
- $I->waitForElement('#element-tt_content-402 [data-colpos="' . $dataColPos . '"]');
- $newContentElementLabel = $I->getNewContentElementLabel();
- $I->click($newContentElementLabel, '#element-tt_content-402 [data-colpos="' . $dataColPos . '"]');
+ $colPosSelector = '#element-tt_content-402 [data-colpos="' . $dataColPos . '"]';
+ $I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
diff --git a/Tests/Acceptance/Backend/LayoutCest.php b/Tests/Acceptance/Backend/LayoutCest.php
index e34de03b..e5e77c2e 100644
--- a/Tests/Acceptance/Backend/LayoutCest.php
+++ b/Tests/Acceptance/Backend/LayoutCest.php
@@ -264,9 +264,8 @@ public function newElementInHeaderColumnHasExpectedColPosAndParentSelected(Backe
$I->switchToContentFrame();
// header
$dataColPos = $I->getDataColPos(700, 200);
- $I->waitForElement('#element-tt_content-700 [data-colpos="' . $dataColPos . '"]');
- $newContentElementLabel = $I->getNewContentElementLabel();
- $I->click($newContentElementLabel, '#element-tt_content-700 [data-colpos="' . $dataColPos . '"]');
+ $colPosSelector = '#element-tt_content-700 [data-colpos="' . $dataColPos . '"]';
+ $I->clickNewContentElement($colPosSelector);
// "[data-colpos="700-200"]" can be attribute of "td" or "div" tag, depends if Fluid based page module is enabled
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
@@ -311,8 +310,7 @@ public function canCreateContentElementInContainer(BackendTester $I, PageTree $p
$I->waitForElement($containerColumn);
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
$I->dontSeeElement($contentInContainerColumn);
- $newContentElementLabel = $I->getNewContentElementLabel();
- $I->click($newContentElementLabel, $containerColumn);
+ $I->clickNewContentElement($containerColumn);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
if ($typo3Version->getMajorVersion() < 12) {
@@ -369,8 +367,8 @@ public function canCreateContentElementInTranslatedContainerInFreeMode(BackendTe
$selector = '#element-tt_content-' . $uid . ' div:nth-child(1) div:nth-child(2)';
$I->dontSee('german', $selector);
$dataColPos = $I->getDataColPos($uid, 200);
- $newContentElementLabel = $I->getNewContentElementLabel();
- $I->click($newContentElementLabel, '#element-tt_content-' . $uid . ' [data-colpos="' . $dataColPos . '"]');
+ $colPosSelector = '#element-tt_content-' . $uid . ' [data-colpos="' . $dataColPos . '"]';
+ $I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
diff --git a/Tests/Acceptance/Support/BackendTester.php b/Tests/Acceptance/Support/BackendTester.php
index a5f43f77..2853eae6 100644
--- a/Tests/Acceptance/Support/BackendTester.php
+++ b/Tests/Acceptance/Support/BackendTester.php
@@ -53,6 +53,16 @@ public function getDataColPos(int $containerId, int $colPos): string
return (string)($containerId . '-' . $colPos);
}
+ public function clickNewContentElement(string $colPosSelector): void
+ {
+ $this->waitForElement($colPosSelector);
+ if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 12) {
+ $this->click('Content', $colPosSelector);
+ return;
+ }
+ $this->click($colPosSelector . ' typo3-backend-new-content-element-wizard-button');
+ }
+
public function getNewContentElementLabel(): string
{
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 12) {