From d92b6d6b9452cf2a0968fd5843139512717fa83b Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Wed, 13 Mar 2024 11:11:13 +0100 Subject: [PATCH 01/12] fix: remove unused wizard --- Classes/Upgrades/ElementUpgradeWizard.php | 51 ----------------------- 1 file changed, 51 deletions(-) delete mode 100644 Classes/Upgrades/ElementUpgradeWizard.php diff --git a/Classes/Upgrades/ElementUpgradeWizard.php b/Classes/Upgrades/ElementUpgradeWizard.php deleted file mode 100644 index 8ff3f1a..0000000 --- a/Classes/Upgrades/ElementUpgradeWizard.php +++ /dev/null @@ -1,51 +0,0 @@ -getQueryBuilderForTable('tt_content'); - $elements = $qb->select('*') - ->from('tt_content') - ->where($qb->expr()->and( - $qb->expr()->eq('CType', $qb->createNamedParameter('list')), - $qb->expr()->eq('list_type', $qb->createNamedParameter('Xmformcycle')) - )) - ->executeQuery() - ->fetchAllAssociative(); - - return (bool)count($elements); - } - - public function getPrerequisites(): array - { - return ['database up-to-date']; - } -} From 7e4a21406f5056770a2bbbbda04734e72ee711df Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Wed, 13 Mar 2024 11:14:10 +0100 Subject: [PATCH 02/12] feat: set dependencies to allow installation of typo3v11 --- composer.json | 6 +++--- ext_emconf.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 0551715..55c6e9c 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": "^8.1", "ext-fileinfo": "*", - "typo3/cms-core": "^12.0" + "typo3/cms-core": "^11.0 || ^12.0" }, "require-dev": { "bk2k/bootstrap-package": "^14.0", @@ -31,14 +31,14 @@ "codeception/module-phpbrowser": "^3.0", "codeception/module-webdriver": "^4.0", "friendsofphp/php-cs-fixer": "^3.34.1", - "helhum/typo3-console": "^8.1", + "helhum/typo3-console": "^7.1 || ^8.1", "helmich/typo3-typoscript-lint": "^3.2.1", "saschaegerer/phpstan-typo3": "^1.1.2", "ssch/typo3-rector": "^2.0", "symfony/translation": "^6.3 || ^7.0", "typo3/cms-base-distribution": "*", "typo3/cms-lowlevel": "*", - "typo3/testing-framework": "^8.0" + "typo3/testing-framework": "^7.0 || ^8.0" }, "autoload": { "psr-4": { diff --git a/ext_emconf.php b/ext_emconf.php index c097a68..8ab8bc4 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,7 +11,7 @@ 'author_company' => 'XIMA Media GmbH', 'constraints' => [ 'depends' => [ - 'typo3' => '12.0.0-12.5.99', + 'typo3' => '11.5.0-12.5.99', ], 'conflicts' => [], 'suggets' => [], From 60f47f6e034111898f12604f56023a9874093216 Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Wed, 13 Mar 2024 11:14:21 +0100 Subject: [PATCH 03/12] feat: register PageTS --- ext_localconf.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext_localconf.php b/ext_localconf.php index 46778ea..db84f7f 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,5 +1,9 @@ getMajorVersion() < 12) { + ExtensionManagementUtility::addPageTSConfig('@import "EXT:xm_formcycle/Configuration/page.tsconfig"'); +} From fe5201da6ff088d24fc9d7f557804b7751eb6cfa Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Wed, 13 Mar 2024 11:15:35 +0100 Subject: [PATCH 04/12] fix: remove title attr from core:icon viewHelper, use size "small" for spinner icon --- .../Private/Templates/Backend/FormcycleSelection.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Private/Templates/Backend/FormcycleSelection.html b/Resources/Private/Templates/Backend/FormcycleSelection.html index 7f7260b..356997f 100644 --- a/Resources/Private/Templates/Backend/FormcycleSelection.html +++ b/Resources/Private/Templates/Backend/FormcycleSelection.html @@ -7,22 +7,22 @@
- + {f:translate(key: 'button.admin', extensionName:'XmFormcycle')}
- +
From 3281304ee3a858f38c4c46abe01755ee133905bb Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Wed, 13 Mar 2024 11:34:10 +0100 Subject: [PATCH 05/12] feat: add requireJS for backend form element --- Classes/Form/Element/FormcycleSelection.php | 12 ++- .../Backend/FormcycleSelectionElementV11.js | 78 +++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 Resources/Public/JavaScript/Backend/FormcycleSelectionElementV11.js diff --git a/Classes/Form/Element/FormcycleSelection.php b/Classes/Form/Element/FormcycleSelection.php index 5844fdf..8dc4725 100644 --- a/Classes/Form/Element/FormcycleSelection.php +++ b/Classes/Form/Element/FormcycleSelection.php @@ -3,6 +3,7 @@ namespace Xima\XmFormcycle\Form\Element; use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -57,8 +58,15 @@ public function render() $resultArray['html'] = '
' . $hiddenInput . '
' . $view->render() . '
'; $resultArray['stylesheetFiles'][] = 'EXT:xm_formcycle/Resources/Public/Css/Backend/FormcycleSelection.css'; - $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@xima/xm-formcycle/FormcycleSelectionElement.js') - ->instance($this->data['parameterArray']['itemFormElID']); + $versionInformation = GeneralUtility::makeInstance(Typo3Version::class); + if ($versionInformation->getMajorVersion() < 12) { + $resultArray['requireJsModules'][] = JavaScriptModuleInstruction::forRequireJS( + 'TYPO3/CMS/XmFormcycle/Backend/FormcycleSelectionElementV11' + )->instance($this->data['parameterArray']['itemFormElID']); + } else { + $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@xima/xm-formcycle/FormcycleSelectionElement.js') + ->instance($this->data['parameterArray']['itemFormElID']); + } return $resultArray; } diff --git a/Resources/Public/JavaScript/Backend/FormcycleSelectionElementV11.js b/Resources/Public/JavaScript/Backend/FormcycleSelectionElementV11.js new file mode 100644 index 0000000..6c61d40 --- /dev/null +++ b/Resources/Public/JavaScript/Backend/FormcycleSelectionElementV11.js @@ -0,0 +1,78 @@ +define(['TYPO3/CMS/Core/Ajax/AjaxRequest'], function (AjaxRequest) { + + return class { + + constructor(itemFormElID) { + this.hiddenInputElement = document.querySelector('#' + itemFormElID); + + const hasError = document.querySelector('#xm-formcycle-forms .callout-danger'); + if (hasError) { + console.debug('Formcycle configuration has errors, aborting'); + return; + } + + this.init(); + } + + init() { + const formsWrapper = document.querySelector('#xm-available-forms-wrapper'); + if (!formsWrapper) { + this.loadForms(TYPO3.settings.ajaxUrls.xm_formcycle_form_selection); + } else { + this.initFormEvents(); + } + } + + loadForms(url) { + const wrapper = document.querySelector('#xm-formcycle-forms'); + + new AjaxRequest(url) + .get() + .then(async function (response) { + const resolved = await response.resolve(); + wrapper.innerHTML = resolved.html; + }).then(() => { + this.initFormEvents(); + }); + } + + initFormEvents() { + document.querySelectorAll('#xm-available-forms-wrapper .card').forEach(card => { + card.addEventListener('click', (e) => { + e.preventDefault(); + document.querySelectorAll('#xm-available-forms-wrapper .card').forEach(card => { + card.classList.remove('active'); + }); + e.currentTarget.classList.add('active'); + this.hiddenInputElement.value = e.currentTarget.getAttribute('data-form-id'); + }); + }); + + const settingsButton = document.querySelector('#xm-settings'); + const wrapper = document.querySelector('#xm-formcycle-forms'); + settingsButton.addEventListener('click', e => { + e.preventDefault(); + e.currentTarget.classList.toggle('active'); + wrapper.classList.toggle('open-settings'); + }); + + const loadingSpinner = document.querySelector('#xm-loading-spinner'); + const reloadButton = document.querySelector('#xm-reload-available-forms'); + const formsWrapper = document.querySelector('#xm-available-forms-wrapper'); + if (reloadButton) { + reloadButton.addEventListener('click', e => { + e.preventDefault(); + // hide form gallery, display loading spinner + formsWrapper.classList.add('hidden'); + loadingSpinner.classList.remove('hidden'); + this.loadForms(TYPO3.settings.ajaxUrls.xm_formcycle_form_reload); + + // close settings if open + settingsButton.classList.remove('active'); + wrapper.classList.remove('open-settings'); + }); + } + } + + } +}); From c3798583d1399dd8244af1ab060709e9d2711ab9 Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Wed, 13 Mar 2024 12:03:51 +0100 Subject: [PATCH 06/12] fix: use fqcn for data processors, do not use dependency injection --- Classes/DataProcessing/AbstractProcessor.php | 14 ++++++++------ Configuration/TypoScript/setup.typoscript | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Classes/DataProcessing/AbstractProcessor.php b/Classes/DataProcessing/AbstractProcessor.php index 1273c43..2d2d3a6 100644 --- a/Classes/DataProcessing/AbstractProcessor.php +++ b/Classes/DataProcessing/AbstractProcessor.php @@ -3,6 +3,7 @@ namespace Xima\XmFormcycle\DataProcessing; use TYPO3\CMS\Core\Service\FlexFormService; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface; use Xima\XmFormcycle\Dto\ElementSettings; @@ -13,11 +14,7 @@ abstract class AbstractProcessor implements DataProcessorInterface { protected ElementSettings $settings; - public function __construct( - protected readonly FormcycleService $formcycleService, - private readonly FlexFormService $flexFormService - ) { - } + protected FormcycleService $formcycleService; public function process( ContentObjectRenderer $cObj, @@ -25,11 +22,16 @@ public function process( array $processorConfiguration, array $processedData ) { + // construct element settings + $flexFormService = GeneralUtility::makeInstance(FlexFormService::class); $this->settings = ElementSettings::createFromContentElement( - $this->flexFormService, + $flexFormService, $cObj, ); + $this->formcycleService = GeneralUtility::makeInstance(FormcycleService::class); + + // check if concrete processor should be used $currentIntegrationMode = $this->settings->integrationMode ?? $this->formcycleService->getDefaultIntegrationMode(); if ($currentIntegrationMode->forDataProcessing() !== $this->getIntegrationMode()) { return $processedData; diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 4d6b931..04bfe71 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -10,9 +10,9 @@ tt_content.formcycle { templateName = Formcycle dataProcessing { - 1709129505 = formcycle-ajax - 1709129509 = formcycle-iframe - 1709129512 = formcycle-integrated + 1709129505 = Xima\XmFormcycle\DataProcessing\AjaxProcessor + 1709129509 = Xima\XmFormcycle\DataProcessing\iFrameProcessor + 1709129512 = Xima\XmFormcycle\DataProcessing\IntegratedProcessor } } From 4317065fc7a4960351f7eafd956d32aacd9bc867 Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Wed, 13 Mar 2024 18:10:15 +0100 Subject: [PATCH 07/12] fix: text color of card selection in form element --- Resources/Private/Templates/Backend/FormcycleSelection.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Private/Templates/Backend/FormcycleSelection.html b/Resources/Private/Templates/Backend/FormcycleSelection.html index 356997f..a9d3ba2 100644 --- a/Resources/Private/Templates/Backend/FormcycleSelection.html +++ b/Resources/Private/Templates/Backend/FormcycleSelection.html @@ -36,7 +36,7 @@


- +
Preview {form.title}
From 9387e957be69b0098805d473d538eae4fcec4818 Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Thu, 27 Jun 2024 15:54:02 +0300 Subject: [PATCH 08/12] feat: use env variables for init-typo3 command --- .ddev/commands/web/init-typo3 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.ddev/commands/web/init-typo3 b/.ddev/commands/web/init-typo3 index 9422152..f84413c 100755 --- a/.ddev/commands/web/init-typo3 +++ b/.ddev/commands/web/init-typo3 @@ -13,6 +13,7 @@ readonly dbName="db" readonly dbCredentials="-h${dbHost} -u${dbUser} -p${dbPassword}" readonly fixturePath="/var/www/html/Tests/Acceptance/Fixtures" readonly typo3Binary="/var/www/html/vendor/bin/typo3" +readonly typo3cmsBinary="/var/www/html/vendor/bin/typo3cms" function _progress() { printf "%s... " "$1" @@ -42,9 +43,28 @@ export TYPO3_SETUP_ADMIN_PASSWORD=Passw0rd! export TYPO3_SERVER_TYPE=other export TYPO3_PROJECT_NAME="EXT:xm_formcycle" +export TYPO3_INSTALL_DB_DRIVER=mysqli +export TYPO3_INSTALL_DB_USER="$dbUser" +export TYPO3_INSTALL_DB_PASSWORD="$dbPassword" +export TYPO3_INSTALL_DB_PORT=3306 +export TYPO3_INSTALL_DB_HOST="$dbHost" +export TYPO3_INSTALL_DB_DBNAME="$dbName" +export TYPO3_INSTALL_ADMIN_USER=admin +export TYPO3_INSTALL_ADMIN_PASSWORD=Passw0rd! +export TYPO3_INSTALL_SITE_SETUP_TYPE="no" +export TYPO3_INSTALL_WEB_SERVER_CONFIG="apache" +export TYPO3_INSTALL_SITE_NAME="EXT:xm_formcycle" +export TYPO3_INSTALL_DB_UNIX_SOCKET="" + # Set up environment _progress "Setting up TYPO3 installation" -"$typo3Binary" setup --no-interaction --force --quiet +# TYPO3 v11 +if [ -f "$typo3cmsBinary" ]; then + "$typo3cmsBinary" install:setup --force --use-existing-database + "$typo3cmsBinary" configuration:set SYS/trustedHostsPattern ".*" +else + "$typo3Binary" setup --no-interaction --force --quiet +fi _done # Import DB fixtures From 5ad02bbac0b061bdc845bfbd0130c45092505f39 Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Fri, 28 Jun 2024 14:55:09 +0300 Subject: [PATCH 09/12] feat: enable debug and coverage in ddev config --- .ddev/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ddev/config.yaml b/.ddev/config.yaml index d519486..c8e785d 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -19,7 +19,7 @@ nodejs_version: "20" disable_settings_management: true web_environment: - TESTING_DOMAIN=$DDEV_HOSTNAME - - XDEBUG_MODE=coverage + - XDEBUG_MODE=debug,coverage - TYPO3_CONTEXT=Development/DDEV - typo3DatabaseHost=db - typo3DatabaseUsername=root From 33b7576ab317dc861fe5f6af6082f126b49ffbeb Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Fri, 28 Jun 2024 16:15:53 +0300 Subject: [PATCH 10/12] feat: add v11 codeception cest --- Tests/Acceptance/Backend/ElementCest.php | 49 ++++---- Tests/Acceptance/Backend/ElementV11Cest.php | 107 ++++++++++++++++++ Tests/Acceptance/Support/Enums/Selectors.php | 11 ++ .../Acceptance/Support/Enums/SelectorsV11.php | 10 ++ .../Support/Helper/ExtensionConfiguration.php | 4 + 5 files changed, 162 insertions(+), 19 deletions(-) create mode 100644 Tests/Acceptance/Backend/ElementV11Cest.php create mode 100644 Tests/Acceptance/Support/Enums/Selectors.php create mode 100644 Tests/Acceptance/Support/Enums/SelectorsV11.php diff --git a/Tests/Acceptance/Backend/ElementCest.php b/Tests/Acceptance/Backend/ElementCest.php index b19c089..2e545b2 100644 --- a/Tests/Acceptance/Backend/ElementCest.php +++ b/Tests/Acceptance/Backend/ElementCest.php @@ -3,17 +3,29 @@ namespace Xima\XmFormcycle\Tests\Acceptance\Backend; use Codeception\Attribute\Depends; +use Codeception\Scenario; use Xima\XmFormcycle\Tests\Acceptance\Support\AcceptanceTester; +use Xima\XmFormcycle\Tests\Acceptance\Support\Enums\Selectors; use Xima\XmFormcycle\Tests\Acceptance\Support\Helper\ExtensionConfiguration; use Xima\XmFormcycle\Tests\Acceptance\Support\Helper\PageTree; use Xima\XmFormcycle\Tests\Acceptance\Support\Helper\ShadowDom; class ElementCest { - public const CONTENT_WIZARD = 'typo3-backend-new-content-element-wizard'; + private bool $isV11 = false; - public function _before(AcceptanceTester $I) + public function __construct() { + if (file_exists(__DIR__ . '/../../../vendor/bin/typo3cms')) { + $this->isV11 = true; + } + } + + public function _before(AcceptanceTester $I, Scenario $scenario): void + { + if ($this->isV11) { + $scenario->skip(); + } $I->amOnPage('/typo3/'); $I->waitForElementVisible('input[name="username"]'); $I->waitForElementVisible('input[type="password"]'); @@ -34,6 +46,18 @@ public function seeExtensionConfigurationError( $I->seeElement('.callout-danger'); } + private function navigateToElementTab( + AcceptanceTester $I, + PageTree $pageTree, + ): void { + $I->click('Page'); + $I->waitForElementVisible(PageTree::$pageTreeFrameSelector); + $pageTree->clickElement('Main'); + $I->switchToContentFrame(); + $I->click('Element1'); + $I->click('Formcycle'); + } + #[Depends('createElementAndSave')] public function seeFormSelection( AcceptanceTester $I, @@ -47,18 +71,6 @@ public function seeFormSelection( $I->waitForElementVisible('#xm-available-forms-wrapper'); } - private function navigateToElementTab( - AcceptanceTester $I, - PageTree $pageTree, - ): void { - $I->click('Page'); - $I->waitForElementVisible(PageTree::$pageTreeFrameSelector); - $pageTree->clickElement('Main'); - $I->switchToContentFrame(); - $I->click('Element1'); - $I->click('Formcycle'); - } - public function createElementAndSave( AcceptanceTester $I, PageTree $pageTree, @@ -70,17 +82,16 @@ public function createElementAndSave( // open wizard $I->switchToContentFrame(); - $I->click('typo3-backend-new-content-element-wizard-button'); + $I->click(Selectors::CONTENT_WIZARD_BUTTON->value); $I->switchToIFrame(); - $I->waitForElementVisible('typo3-backend-new-content-element-wizard'); + $I->waitForElementVisible(Selectors::CONTENT_WIZARD->value); - $domHelper->clickShadowDomElement(self::CONTENT_WIZARD, 'button.navigation-toggle'); - $domHelper->clickShadowDomElement(self::CONTENT_WIZARD, 'button.navigation-item:nth-child(3)'); + $domHelper->clickShadowDomElement(Selectors::CONTENT_WIZARD->value, Selectors::CONTENT_WIZARD_FORM_TAB->value); // See and select element $I->see('Formcycle'); $I->see('Include a XIMA® FormCycle form'); - $domHelper->clickShadowDomElement(self::CONTENT_WIZARD, 'button[data-identifier="forms_formcycle"]'); + $domHelper->clickShadowDomElement(Selectors::CONTENT_WIZARD->value, Selectors::CONTENT_WIZARD_FORMCYCLE->value); // Fill and save element $I->switchToContentFrame(); diff --git a/Tests/Acceptance/Backend/ElementV11Cest.php b/Tests/Acceptance/Backend/ElementV11Cest.php new file mode 100644 index 0000000..8d3dca8 --- /dev/null +++ b/Tests/Acceptance/Backend/ElementV11Cest.php @@ -0,0 +1,107 @@ +isV11 = true; + } + } + + public function _before(AcceptanceTester $I, Scenario $scenario): void + { + if (!$this->isV11) { + $scenario->skip(); + } + $I->amOnPage('/typo3/'); + $I->waitForElementVisible('input[name="username"]'); + $I->waitForElementVisible('input[type="password"]'); + $I->fillField('input[name="username"]', 'admin'); + $I->fillField('input[type="password"]', 'Passw0rd!'); + $I->click('button[type="submit"]'); + $I->waitForElementNotVisible('form[name="loginform"]'); + $I->seeCookie('be_typo_user'); + } + + #[Depends('createElementAndSave')] + public function seeExtensionConfigurationError( + AcceptanceTester $I, + PageTree $pageTree + ): void { + $this->navigateToElementTab($I, $pageTree); + $I->see('Configuration error'); + $I->seeElement('.callout-danger'); + } + + private function navigateToElementTab( + AcceptanceTester $I, + PageTree $pageTree, + ): void { + $I->click('Page'); + $I->waitForElementVisible(PageTree::$pageTreeFrameSelector); + $pageTree->clickElement('Main'); + $I->switchToContentFrame(); + $I->waitForText('Element1'); + $I->click('Element1'); + $I->waitForText('Formcycle'); + $I->click('Formcycle'); + } + + #[Depends('createElementAndSave')] + public function seeFormSelection( + AcceptanceTester $I, + PageTree $pageTree, + ExtensionConfiguration $extensionConfiguration + ): void { + $extensionConfiguration->write('formcycleUrl', 'https://pro.form.cloud/formcycle'); + $extensionConfiguration->write('formcycleClientId', '2252'); + $this->navigateToElementTab($I, $pageTree); + $I->wait(5); + $I->dontSee('Configuration error'); + $I->seeElement('#xm-formcycle-forms'); + $I->waitForElementVisible('#xm-available-forms-wrapper', 120); + } + + public function createElementAndSave( + AcceptanceTester $I, + PageTree $pageTree + ): void { + $I->click('Page'); + $I->waitForElementVisible(PageTree::$pageTreeFrameSelector); + $pageTree->clickElement('Main'); + + // open wizard + $I->switchToContentFrame(); + $I->waitForText(SelectorsV11::CONTENT_WIZARD_BUTTON->value); + $I->click(SelectorsV11::CONTENT_WIZARD_BUTTON->value); + + $I->switchToMainFrame(); + $I->waitForElementVisible(SelectorsV11::CONTENT_WIZARD->value); + $I->click(SelectorsV11::CONTENT_WIZARD_FORM_TAB->value); + + // See and select element + $I->see('Formcycle'); + $I->see('Include a XIMA® FormCycle form'); + $I->click('Formcycle'); + + // Fill and save element + $I->switchToContentFrame(); + $I->waitForText('General'); + $I->click('General'); + + $I->fillField('input[data-formengine-input-name*="[header]"]', 'Element1'); + $I->click('Save'); + } +} diff --git a/Tests/Acceptance/Support/Enums/Selectors.php b/Tests/Acceptance/Support/Enums/Selectors.php new file mode 100644 index 0000000..b821ee6 --- /dev/null +++ b/Tests/Acceptance/Support/Enums/Selectors.php @@ -0,0 +1,11 @@ + Date: Fri, 28 Jun 2024 16:41:12 +0300 Subject: [PATCH 11/12] fix: remove temp typoscript content element definition --- Configuration/TypoScript/setup.typoscript | 92 ++++++++++++++++------- 1 file changed, 63 insertions(+), 29 deletions(-) diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 6bc2409..e4e79e0 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -1,61 +1,95 @@ -temp.formcycle =< lib.contentElement -temp.formcycle { - templateRootPaths.1 = EXT:xm_formcycle/Resources/Private/Templates/ - templateRootPaths.2 = {$plugin.tx_xmformcycle.view.templateRootPath} - partialRootPaths.1 = EXT:xm_formcycle/Resources/Private/Partials/ - partialRootPaths.2 = {$plugin.tx_xmformcycle.view.partialRootPath} - layoutRootPaths.1 = EXT:xm_formcycle/Resources/Private/Layouts/ - layoutRootPaths.2 = {$plugin.tx_xmformcycle.view.layoutRootPath} - - templateName = Formcycle -} - tt_content.formcycle = COA tt_content.formcycle { 10 = COA_INT 10.stdWrap.if.equals = default 10.stdWrap.if.value.data = flexform : pi_flexform:settings.xf.integrationMode - 10.1 =< temp.formcycle - 10.1.dataProcessing { - 1709129505 = Xima\XmFormcycle\DataProcessing\AjaxProcessor - 1709129509 = Xima\XmFormcycle\DataProcessing\iFrameProcessor - 1709129512 = Xima\XmFormcycle\DataProcessing\IntegratedProcessor + 10.1 =< lib.contentElement + 10.1 { + templateRootPaths.1 = EXT:xm_formcycle/Resources/Private/Templates/ + templateRootPaths.2 = {$plugin.tx_xmformcycle.view.templateRootPath} + partialRootPaths.1 = EXT:xm_formcycle/Resources/Private/Partials/ + partialRootPaths.2 = {$plugin.tx_xmformcycle.view.partialRootPath} + layoutRootPaths.1 = EXT:xm_formcycle/Resources/Private/Layouts/ + layoutRootPaths.2 = {$plugin.tx_xmformcycle.view.layoutRootPath} + templateName = Formcycle + dataProcessing { + 1709129505 = Xima\XmFormcycle\DataProcessing\AjaxProcessor + 1709129509 = Xima\XmFormcycle\DataProcessing\iFrameProcessor + 1709129512 = Xima\XmFormcycle\DataProcessing\IntegratedProcessor + } } 20 = COA_INT 20.stdWrap.if.equals = integrated 20.stdWrap.if.value.data = flexform : pi_flexform:settings.xf.integrationMode - 20.1 =< temp.formcycle - 20.1.dataProcessing { - 1709129512 = Xima\XmFormcycle\DataProcessing\IntegratedProcessor + 20.1 =< lib.contentElement + 20.1 { + templateRootPaths.1 = EXT:xm_formcycle/Resources/Private/Templates/ + templateRootPaths.2 = {$plugin.tx_xmformcycle.view.templateRootPath} + partialRootPaths.1 = EXT:xm_formcycle/Resources/Private/Partials/ + partialRootPaths.2 = {$plugin.tx_xmformcycle.view.partialRootPath} + layoutRootPaths.1 = EXT:xm_formcycle/Resources/Private/Layouts/ + layoutRootPaths.2 = {$plugin.tx_xmformcycle.view.layoutRootPath} + templateName = Formcycle + dataProcessing { + 1709129512 = Xima\XmFormcycle\DataProcessing\IntegratedProcessor + } } 30 = COA 30.stdWrap.if.equals = AJAX (TYPO3) 30.stdWrap.if.value.data = flexform : pi_flexform:settings.xf.integrationMode - 30.1 =< temp.formcycle - 30.1.dataProcessing { - 1709129505 = Xima\XmFormcycle\DataProcessing\AjaxProcessor + 30.1 =< lib.contentElement + 30.1 { + templateRootPaths.1 = EXT:xm_formcycle/Resources/Private/Templates/ + templateRootPaths.2 = {$plugin.tx_xmformcycle.view.templateRootPath} + partialRootPaths.1 = EXT:xm_formcycle/Resources/Private/Partials/ + partialRootPaths.2 = {$plugin.tx_xmformcycle.view.partialRootPath} + layoutRootPaths.1 = EXT:xm_formcycle/Resources/Private/Layouts/ + layoutRootPaths.2 = {$plugin.tx_xmformcycle.view.layoutRootPath} + templateName = Formcycle + dataProcessing { + 1709129505 = Xima\XmFormcycle\DataProcessing\AjaxProcessor + } } 40 = COA 40.stdWrap.if.equals = AJAX (FORMCYCLE) 40.stdWrap.if.value.data = flexform : pi_flexform:settings.xf.integrationMode - 40.1 =< temp.formcycle - 40.1.dataProcessing { - 1709129505 = Xima\XmFormcycle\DataProcessing\AjaxProcessor + 40.1 =< lib.contentElement + 40.1 { + templateRootPaths.1 = EXT:xm_formcycle/Resources/Private/Templates/ + templateRootPaths.2 = {$plugin.tx_xmformcycle.view.templateRootPath} + partialRootPaths.1 = EXT:xm_formcycle/Resources/Private/Partials/ + partialRootPaths.2 = {$plugin.tx_xmformcycle.view.partialRootPath} + layoutRootPaths.1 = EXT:xm_formcycle/Resources/Private/Layouts/ + layoutRootPaths.2 = {$plugin.tx_xmformcycle.view.layoutRootPath} + templateName = Formcycle + dataProcessing { + 1709129505 = Xima\XmFormcycle\DataProcessing\AjaxProcessor + } } 50 = COA 50.stdWrap.if.equals = iFrame 50.stdWrap.if.value.data = flexform : pi_flexform:settings.xf.integrationMode - 50.1 =< temp.formcycle - 50.1.dataProcessing { - 1709129509 = Xima\XmFormcycle\DataProcessing\iFrameProcessor + 50.1 =< lib.contentElement + 50.1 { + templateRootPaths.1 = EXT:xm_formcycle/Resources/Private/Templates/ + templateRootPaths.2 = {$plugin.tx_xmformcycle.view.templateRootPath} + partialRootPaths.1 = EXT:xm_formcycle/Resources/Private/Partials/ + partialRootPaths.2 = {$plugin.tx_xmformcycle.view.partialRootPath} + layoutRootPaths.1 = EXT:xm_formcycle/Resources/Private/Layouts/ + layoutRootPaths.2 = {$plugin.tx_xmformcycle.view.layoutRootPath} + templateName = Formcycle + dataProcessing { + 1709129509 = Xima\XmFormcycle\DataProcessing\iFrameProcessor + } } } + formcycle_ajax = PAGE formcycle_ajax.typeNum = 1464705954 From 77bdd7acaed27aec374ba9519b889e63db8a952b Mon Sep 17 00:00:00 2001 From: Maik Schneider Date: Fri, 28 Jun 2024 16:59:13 +0300 Subject: [PATCH 12/12] fix: adjust waiting timings in tests --- Tests/Acceptance/Backend/ElementCest.php | 5 ++++- Tests/Acceptance/Backend/ElementV11Cest.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/Acceptance/Backend/ElementCest.php b/Tests/Acceptance/Backend/ElementCest.php index 2e545b2..58569d6 100644 --- a/Tests/Acceptance/Backend/ElementCest.php +++ b/Tests/Acceptance/Backend/ElementCest.php @@ -54,7 +54,9 @@ private function navigateToElementTab( $I->waitForElementVisible(PageTree::$pageTreeFrameSelector); $pageTree->clickElement('Main'); $I->switchToContentFrame(); + $I->waitForText('Element1'); $I->click('Element1'); + $I->waitForText('Formcycle'); $I->click('Formcycle'); } @@ -67,8 +69,9 @@ public function seeFormSelection( $extensionConfiguration->write('formcycleUrl', 'https://pro.form.cloud/formcycle'); $extensionConfiguration->write('formcycleClientId', '2252'); $this->navigateToElementTab($I, $pageTree); + $I->wait(1); $I->dontSee('Configuration error'); - $I->waitForElementVisible('#xm-available-forms-wrapper'); + $I->waitForElementVisible('#xm-available-forms-wrapper', 120); } public function createElementAndSave( diff --git a/Tests/Acceptance/Backend/ElementV11Cest.php b/Tests/Acceptance/Backend/ElementV11Cest.php index 8d3dca8..918685e 100644 --- a/Tests/Acceptance/Backend/ElementV11Cest.php +++ b/Tests/Acceptance/Backend/ElementV11Cest.php @@ -68,7 +68,7 @@ public function seeFormSelection( $extensionConfiguration->write('formcycleUrl', 'https://pro.form.cloud/formcycle'); $extensionConfiguration->write('formcycleClientId', '2252'); $this->navigateToElementTab($I, $pageTree); - $I->wait(5); + $I->wait(1); $I->dontSee('Configuration error'); $I->seeElement('#xm-formcycle-forms'); $I->waitForElementVisible('#xm-available-forms-wrapper', 120);