From 64d9facd19248dd323482fbe2619048b6413e6c6 Mon Sep 17 00:00:00 2001 From: Markus Klein Date: Tue, 17 Dec 2024 16:55:24 +0100 Subject: [PATCH 1/8] [DOC] Fix docs for Email4Link RTE integration The configuration for CKEditor5 has changed with TYPO3 v12 --- Documentation/Technical/Identification/Index.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/Technical/Identification/Index.md b/Documentation/Technical/Identification/Index.md index 7e8ea673..793f1a31 100644 --- a/Documentation/Technical/Identification/Index.md +++ b/Documentation/Technical/Identification/Index.md @@ -305,15 +305,14 @@ imports: - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" } editor: - externalPlugins: - luxEmail4Link: - resource: 'EXT:lux/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4Link/plugin.js' - config: extraAllowedContent: 'a[data-*];' contentsCss: ['EXT:lux/Resources/Public/Css/Modules.min.css'] + importModules: + - 'EXT:lux/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4Link/plugin.js' + toolbarGroups: - { name: 'styles', groups: [ 'styles' ] } - { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] } From 94bf1ff84479ef688159dd68bcfbe7dcdb0cb87e Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Wed, 18 Dec 2024 09:01:31 +0100 Subject: [PATCH 2/8] [TASK] Remove outdated CKEditor 4 plugin --- .../luxEmail4LinkOld/dialogs/dialog.js | 99 ------------------- .../luxEmail4LinkOld/icons/email4link.svg | 1 - .../luxEmail4LinkOld/lang/de.js | 10 -- .../luxEmail4LinkOld/lang/en.js | 10 -- .../luxEmail4LinkOld/plugin.js | 72 -------------- 5 files changed, 192 deletions(-) delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js delete mode 100644 Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js deleted file mode 100644 index ce78abb0..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/dialogs/dialog.js +++ /dev/null @@ -1,99 +0,0 @@ -CKEDITOR.dialog.add('luxEmail4LinkDialog', function (editor) { - /** - * pendant to jQuery function "closest" - * - * @param elementType - * @param currentSelection - * @returns {*} - */ - var getParentElement = function (elementType, currentSelection) { - var parentElements = currentSelection.getParents(); - for (var i = 0; i < parentElements.length; i++) { - if (parentElements[i].getName() === elementType) { - return parentElements[i]; - } - } - return null; - }; - - /** - * @returns {boolean} - */ - var isLuxenterpriseExisting = function() { - var http = new XMLHttpRequest(); - http.open('HEAD', '/typo3conf/ext/luxenterprise/Resources/Public/Icons/lux.svg', false); - http.send(); - return http.status !== 404; - } - - return { - title: editor.lang.luxEmail4Link.dialog, - minWidth: 800, - minHeight: 500, - contents: [ - { - id: 'general', - label: 'Settings', - elements: [ - { - type: 'text', - id: 'title', - label: editor.lang.luxEmail4Link.dialogTitle, - validate: CKEDITOR.dialog.validate.notEmpty(editor.lang.luxEmail4Link.validationNotEmpty), - required: true, - commit: function (data) { - data.title = this.getValue(); - } - }, - { - type: 'textarea', - id: 'text', - minHeight: 300, - label: editor.lang.luxEmail4Link.dialogText, - commit: function (data) { - data.text = this.getValue(); - } - }, - { - type: 'checkbox', - id: 'sendEmail', - label: editor.lang.luxEmail4Link.dialogSendEmail, - commit: function (data) { - data.sendEmail = this.getValue(); - } - }, - { - type: 'html', - html: '

' + editor.lang.luxEmail4Link.dialogExplanation + '

' - }, - { - type: 'html', - html: '

' + editor.lang.luxEmail4Link.dialogPoweredBy + '

' - } - ] - } - ], - - // If editor submits the dialog - onOk: function () { - var data = {}; - this.commitContent(data); - var parent = getParentElement('a', editor.getSelection().getStartElement()); - parent.setAttribute('data-lux-email4link-title', data.title); - parent.setAttribute('data-lux-email4link-text', data.text); - parent.setAttribute('data-lux-email4link-sendEmail', data.sendEmail); - }, - - // On opening dialog box - onShow: function () { - var parent = getParentElement('a', editor.getSelection().getStartElement()); - this.setValueOf('general', 'title', parent.getAttribute('data-lux-email4link-title') || ''); - this.setValueOf('general', 'text', parent.getAttribute('data-lux-email4link-text') || ''); - var sendEmailStatus = parent.getAttribute('data-lux-email4link-sendEmail') || ''; - this.setValueOf('general', 'sendEmail', sendEmailStatus === 'true'); - if (isLuxenterpriseExisting()) { - document.getElementById('poweredbylux').style.display = 'none'; - } - } - }; -}); diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg deleted file mode 100644 index c1c83068..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/icons/email4link.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js deleted file mode 100644 index 74620ec5..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/de.js +++ /dev/null @@ -1,10 +0,0 @@ -CKEDITOR.plugins.setLang('luxEmail4Link', 'de', { - button: 'Link in email4link wandeln', - dialog: 'Besucher um E-Mail-Adresse für Link bitten', - dialogTitle: 'Überschrift', - dialogText: 'Informationstext für Besucher', - dialogSendEmail: 'Dokument per E-Mail versenden (nur Links auf Dateien)', - dialogExplanation: 'Hinweis: Mit dem Feature "email4link" erhöhen Sie die Identifikationsrate Ihrer Leads.', - dialogPoweredBy: '"Powered by Lux" mit luxenterprise ausblenden', - validationNotEmpty: 'Feld darf nicht leer sein' -}); diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js deleted file mode 100644 index ee523e32..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/lang/en.js +++ /dev/null @@ -1,10 +0,0 @@ -CKEDITOR.plugins.setLang('luxEmail4Link', 'en', { - button: 'Convert a link to email4link', - dialog: 'Ask visitor for his/her email address to get the link', - dialogTitle: 'Title', - dialogText: 'Text as information for the visitor', - dialogSendEmail: 'Send document as email (only for filelinks)', - dialogExplanation: 'Note: To increase rate of identification, you can use the feature "email4link".', - dialogPoweredBy: 'Hide "Powered by Lux" with luxenterprise', - validationNotEmpty: 'Feld darf nicht leer sein' -}); diff --git a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js b/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js deleted file mode 100644 index 830cb5b0..00000000 --- a/Resources/Public/JavaScript/Static/CkEditorPlugins/luxEmail4LinkOld/plugin.js +++ /dev/null @@ -1,72 +0,0 @@ -CKEDITOR.plugins.add('luxEmail4Link', { - lang: [ - 'en', 'de' - ], - init: function(editor) { - - /** - * Add buttons - * - * @param context - * @returns {void} - */ - var addButtons = function (context) { - editor.ui.addButton('Email4Link', { - label: editor.lang.luxEmail4Link.button, - command: 'luxEmail4Link', - toolbar: 'links', - icon: context.path + 'icons/email4link.svg' - }); - }; - - /** - * Add click events to buttons - * - * @param context - * @returns {void} - */ - var addButtonListeners = function(context) { - editor.addCommand('luxEmail4Link', new CKEDITOR.dialogCommand('luxEmail4LinkDialog')); - CKEDITOR.dialog.add('luxEmail4LinkDialog', context.path + 'dialogs/dialog.js'); - }; - - addButtons(this); - addButtonListeners(this); - - // Disable button on start - editor.on('instanceReady', function(event) { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_DISABLED); - }); - - // Enable or disable button depending on selection - editor.on('selectionChange', function(event) { - var parent = getParentElement('a', editor.getSelection().getStartElement()); - if (parent !== null) { - if (parent.getAttribute('data-lux-email4link-title') === null) { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_OFF); - } else { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_ON); - } - } else { - editor.getCommand('luxEmail4Link').setState(CKEDITOR.TRISTATE_DISABLED); - } - }); - - /** - * pendant to jQuery function "closest" - * - * @param elementType - * @param currentSelection - * @returns {*} - */ - var getParentElement = function(elementType, currentSelection) { - var parentElements = currentSelection.getParents(); - for (var i = 0; i < parentElements.length; i++) { - if (parentElements[i].getName() === elementType) { - return parentElements[i]; - } - } - return null; - }; - } -}); From 0ced4238ec564b38a623856e665f6171178a3509 Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Fri, 20 Dec 2024 11:06:29 +0100 Subject: [PATCH 3/8] [TASK] Add codeception test setup --- .env | 10 +++++ .gitignore | 2 + .project/docker/php/Dockerfile | 11 ++++++ .project/tests/.php-cs-fixer.php | 3 +- Makefile | 22 +++++++++++ .../Acceptance/_support/AcceptanceTester.php | 25 +++++++++++++ Tests/Acceptance/acceptance.suite.yml | 18 +++++++++ Tests/Acceptance/acceptance/FirstCest.php | 14 +++++++ codeception.yml | 10 +++++ composer.json | 31 +++++++++------- docker-compose.selenium.yml | 37 +++++++++++++++++++ 11 files changed, 169 insertions(+), 14 deletions(-) create mode 100755 Tests/Acceptance/_support/AcceptanceTester.php create mode 100644 Tests/Acceptance/acceptance.suite.yml create mode 100644 Tests/Acceptance/acceptance/FirstCest.php create mode 100644 codeception.yml create mode 100644 docker-compose.selenium.yml diff --git a/.env b/.env index e3c1acce..2d893618 100644 --- a/.env +++ b/.env @@ -35,3 +35,13 @@ TYPO3_INSTALL_ADMIN_PASSWORD=Password123! TYPO3_INSTALL_SITE_NAME="Lux" TYPO3_INSTALL_SITE_SETUP_TYPE=no TYPO3_INSTALL_WEB_SERVER_CONFIG=apache + +# CodeCeption +SELENIARM_PORT_4442=61000 +SELENIARM_PORT_4443=61001 +SELENIARM_PORT_4444=61002 +PORT_CHROME=61003 +PORT_FIREFOX=61004 +VNC_PORT_CHROME=61005 +VNC_PORT_FIREFOX=61006 +TEST_URL='https://local.lux.de' diff --git a/.gitignore b/.gitignore index 958cfe8b..5a50f162 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ var/ /config/ /.phpunit.cache/ /.env.local +/Tests/Acceptance/_output/* +/Tests/Acceptance/_support/_generated/ diff --git a/.project/docker/php/Dockerfile b/.project/docker/php/Dockerfile index f94b05da..7eddf3ec 100644 --- a/.project/docker/php/Dockerfile +++ b/.project/docker/php/Dockerfile @@ -1,3 +1,14 @@ FROM in2code/php-dev:8.2-fpm COPY zz_xdebug.ini /usr/local/etc/php/conf.d/zz_xdebug.ini + +USER root + +# Install CURL extension +RUN apt-get update && apt-get install -y \ + libcurl4-openssl-dev \ + && docker-php-ext-install curl \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +USER www-data diff --git a/.project/tests/.php-cs-fixer.php b/.project/tests/.php-cs-fixer.php index e2c1e184..0752a57b 100644 --- a/.project/tests/.php-cs-fixer.php +++ b/.project/tests/.php-cs-fixer.php @@ -40,7 +40,8 @@ __DIR__ . '/../../Tests', __DIR__ . '/../../Configuration', ] - ); + ) + ->notPath('#^Acceptance/#'); // Return a Code Sniffing configuration using // all sniffers needed for PSR-2 // and additionally: diff --git a/Makefile b/Makefile index aff33b8a..16e69e52 100644 --- a/Makefile +++ b/Makefile @@ -212,6 +212,28 @@ ifeq ($(shell uname -s), Darwin) docker-compose exec -u root php chown -R app:app /app/$(TYPO3_CACHE_DIR)/; endif +## Run acceptance tests +test-acceptance: .selenium-start + echo "$(EMOJI_robot) Running acceptance tests" + docker-compose exec php bash -c "\ + sleep 2 && \ + ./.Build/bin/codecept clean && \ + ./.Build/bin/codecept build && \ + ./.Build/bin/codecept run acceptance" + echo "$(EMOJI_broom) Cleaning up selenium services"; \ + make .selenium-stop; \ + exit $${EXIT_CODE:-0} + +## Start Selenium services for testing +.selenium-start: + echo "$(EMOJI_rocket) Starting Selenium services for testing" + docker compose -f docker-compose.yml -f docker-compose.selenium.yml up -d seleniarm-hub chrome firefox + +## Stop Selenium services for testing +.selenium-stop: + echo "$(EMOJI_stop) Stopping Selenium services" + docker compose -f docker-compose.selenium.yml stop seleniarm-hub chrome firefox + include .env # SETTINGS diff --git a/Tests/Acceptance/_support/AcceptanceTester.php b/Tests/Acceptance/_support/AcceptanceTester.php new file mode 100755 index 00000000..cf989fd8 --- /dev/null +++ b/Tests/Acceptance/_support/AcceptanceTester.php @@ -0,0 +1,25 @@ +amOnPage('/'); + $I->see('Marketing'); + } +} diff --git a/codeception.yml b/codeception.yml new file mode 100644 index 00000000..6c16c1db --- /dev/null +++ b/codeception.yml @@ -0,0 +1,10 @@ +namespace: In2code\Lux\Tests +paths: + tests: Tests/Acceptance + output: Tests/Acceptance/_output + data: Tests/Acceptance/_data + support: Tests/Acceptance/_support + envs: Tests/Acceptance/_envs +extensions: + enabled: + - Codeception\Extension\RunFailed diff --git a/composer.json b/composer.json index ae840b68..848e8ab2 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,23 @@ "typo3/cms-dashboard": "*" }, "require-dev": { + "codeception/codeception": "^5.1", + "codeception/module-asserts": "^3.0", + "codeception/module-phpbrowser": "^3.0", + "codeception/module-webdriver": "^4.0", + "friendsofphp/php-cs-fixer": "^3.10", + "georgringer/news": "^12.0", + "helmich/typo3-typoscript-lint": "^3.1", + "helhum/typo3-console": "^8.2", + "mikey179/vfsstream": "^1.6", + "phpmd/phpmd": "^2.8", + "symfony/config": ">6.2.0", + "squizlabs/php_codesniffer": "^3.5", + "typo3/cms-adminpanel": "^13.3", + "typo3/cms-belog": "^13.3", + "typo3/cms-beuser": "^13.3", "typo3/cms-core": "^13.3", + "typo3/cms-dashboard": "^13.3", "typo3/cms-extbase": "^13.3", "typo3/cms-extensionmanager": "^13.3", "typo3/cms-felogin": "^13.3", @@ -49,26 +65,14 @@ "typo3/cms-frontend": "^13.3", "typo3/cms-info": "^13.3", "typo3/cms-install": "^13.3", + "typo3/cms-lowlevel": "^13.3", "typo3/cms-recordlist": "^13.3", "typo3/cms-rte-ckeditor": "^13.3", "typo3/cms-scheduler": "^13.3", "typo3/cms-setup": "^13.3", "typo3/cms-t3editor": "^13.3", "typo3/cms-tstemplate": "^13.3", - "typo3/cms-lowlevel": "^13.3", - "typo3/cms-adminpanel": "^13.3", - "typo3/cms-belog": "^13.3", - "typo3/cms-beuser": "^13.3", - "typo3/cms-dashboard": "^13.3", "typo3/testing-framework": "^8.2", - "symfony/config": ">6.2.0", - "mikey179/vfsstream": "^1.6", - "squizlabs/php_codesniffer": "^3.5", - "phpmd/phpmd": "^2.8", - "friendsofphp/php-cs-fixer": "^3.10", - "helmich/typo3-typoscript-lint": "^3.1", - "helhum/typo3-console": "^8.2", - "georgringer/news": "^12.0", "typo3/cms-indexed-search": "^13.4", "typo3/cms-form": "^13.4" }, @@ -100,6 +104,7 @@ }, "extra": { "typo3/cms": { + "app-dir": ".Build", "cms-package-dir": "{$vendor-dir}/typo3/cms", "web-dir": ".Build/public", "extension-key": "lux", diff --git a/docker-compose.selenium.yml b/docker-compose.selenium.yml new file mode 100644 index 00000000..389b9404 --- /dev/null +++ b/docker-compose.selenium.yml @@ -0,0 +1,37 @@ +version: "3.7" + +services: + chrome: + image: seleniarm/node-chromium:4.1.2-20220227 + volumes: + - /dev/shm:/dev/shm + depends_on: + - seleniarm-hub + environment: + - SE_EVENT_BUS_HOST=seleniarm-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + ports: + - ${PORT_CHROME}:5900 + - ${VNC_PORT_CHROME}:5900 # for vnc + + firefox: + image: seleniarm/node-firefox:4.1.2-20220227 + volumes: + - /dev/shm:/dev/shm + depends_on: + - seleniarm-hub + environment: + - SE_EVENT_BUS_HOST=seleniarm-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + ports: + - ${PORT_FIREFOX}:5900 + - ${VNC_PORT_FIREFOX}:5900 # for vnc + + seleniarm-hub: + image: seleniarm/hub:4.1.2-20220227 + ports: + - ${SELENIARM_PORT_4442}:4442 + - ${SELENIARM_PORT_4443}:4443 + - ${SELENIARM_PORT_4444}:4444 From dd1ed1177b1a48344d52b7587698e533a92d6441 Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Fri, 20 Dec 2024 13:32:26 +0100 Subject: [PATCH 4/8] [TASK] Add existing tests to makefile --- Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 16e69e52..9c7bdad0 100644 --- a/Makefile +++ b/Makefile @@ -212,9 +212,29 @@ ifeq ($(shell uname -s), Darwin) docker-compose exec -u root php chown -R app:app /app/$(TYPO3_CACHE_DIR)/; endif +## Test: PHP CS Fixer +test-phpcs: + echo "$(EMOJI_robot) Test: Start PHP CS Fixer tests" + docker-compose exec php composer test:php:cs + +## Test: PHP Linter +test-phplint: + echo "$(EMOJI_robot) Test: Start PHP Linter tests" + docker-compose exec php composer test:php:lint + +## Test: TypoScript Linter +test-tslint: + echo "$(EMOJI_robot) Test: Start TypoScript Linter tests" + docker-compose exec php composer test:ts:lint + +## Test: Unit +test-unit: + echo "$(EMOJI_robot) Test: Start unit tests" + docker-compose exec php composer test:unit + ## Run acceptance tests test-acceptance: .selenium-start - echo "$(EMOJI_robot) Running acceptance tests" + echo "$(EMOJI_robot) Test: Start acceptance tests" docker-compose exec php bash -c "\ sleep 2 && \ ./.Build/bin/codecept clean && \ From ad61cc5c49b8919595dfb19a94506dedf6489963 Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Fri, 20 Dec 2024 14:15:42 +0100 Subject: [PATCH 5/8] [TASK] Add first test in backend --- .../_support/Helper/BackendTester.php | 15 +++++++++++++ Tests/Acceptance/acceptance.suite.yml | 1 + .../acceptance/Backend/BackendLoginCest.php | 21 +++++++++++++++++++ .../SimpleHomepageCest.php} | 4 ++-- 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 Tests/Acceptance/_support/Helper/BackendTester.php create mode 100644 Tests/Acceptance/acceptance/Backend/BackendLoginCest.php rename Tests/Acceptance/acceptance/{FirstCest.php => Frontend/SimpleHomepageCest.php} (70%) diff --git a/Tests/Acceptance/_support/Helper/BackendTester.php b/Tests/Acceptance/_support/Helper/BackendTester.php new file mode 100644 index 00000000..049cbb8f --- /dev/null +++ b/Tests/Acceptance/_support/Helper/BackendTester.php @@ -0,0 +1,15 @@ +amOnPage('/typo3/'); + $I->fillField('#t3-username', $username); + $I->fillField('#t3-password', $password); + $I->click('Login'); + $I->waitForElement('#typo3-cms-backend-backend-toolbaritems-systeminformationtoolbaritem'); + } +} diff --git a/Tests/Acceptance/acceptance.suite.yml b/Tests/Acceptance/acceptance.suite.yml index 396bddcc..cc31a024 100644 --- a/Tests/Acceptance/acceptance.suite.yml +++ b/Tests/Acceptance/acceptance.suite.yml @@ -15,4 +15,5 @@ modules: acceptInsecureCerts: true 'goog:chromeOptions': args: ["--no-sandbox", "--headless", "--disable-gpu", "--ignore-certificate-errors"] + - \In2code\Lux\Tests\Helper\BackendTester step_decorators: ~ diff --git a/Tests/Acceptance/acceptance/Backend/BackendLoginCest.php b/Tests/Acceptance/acceptance/Backend/BackendLoginCest.php new file mode 100644 index 00000000..d5d8a371 --- /dev/null +++ b/Tests/Acceptance/acceptance/Backend/BackendLoginCest.php @@ -0,0 +1,21 @@ +loginToBackend($I); + } + + public function loginToBackendSuccessfully(AcceptanceTester $I) + { + $I->see('LUX'); + $I->see('Analyse'); + $I->see('Leads'); + $I->see('Kampagnen'); + } +} diff --git a/Tests/Acceptance/acceptance/FirstCest.php b/Tests/Acceptance/acceptance/Frontend/SimpleHomepageCest.php similarity index 70% rename from Tests/Acceptance/acceptance/FirstCest.php rename to Tests/Acceptance/acceptance/Frontend/SimpleHomepageCest.php index b6991540..26a8337b 100644 --- a/Tests/Acceptance/acceptance/FirstCest.php +++ b/Tests/Acceptance/acceptance/Frontend/SimpleHomepageCest.php @@ -1,10 +1,10 @@ Date: Fri, 20 Dec 2024 16:41:25 +0100 Subject: [PATCH 6/8] [TASK] Adjust some configuration for the tests --- Makefile | 2 +- .../_support/Helper/MiscellaneousHelper.php | 46 +++++++++++++++++++ Tests/Acceptance/acceptance.suite.yml | 2 +- .../Backend/AnalyseDashboardCest.php | 36 +++++++++++++++ ...dLoginCest.php => ModulesExistingCest.php} | 2 +- 5 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 Tests/Acceptance/_support/Helper/MiscellaneousHelper.php create mode 100644 Tests/Acceptance/acceptance/Backend/AnalyseDashboardCest.php rename Tests/Acceptance/acceptance/Backend/{BackendLoginCest.php => ModulesExistingCest.php} (93%) diff --git a/Makefile b/Makefile index 9c7bdad0..b954f2ed 100644 --- a/Makefile +++ b/Makefile @@ -239,7 +239,7 @@ test-acceptance: .selenium-start sleep 2 && \ ./.Build/bin/codecept clean && \ ./.Build/bin/codecept build && \ - ./.Build/bin/codecept run acceptance" + ./.Build/bin/codecept run acceptance --debug" echo "$(EMOJI_broom) Cleaning up selenium services"; \ make .selenium-stop; \ exit $${EXIT_CODE:-0} diff --git a/Tests/Acceptance/_support/Helper/MiscellaneousHelper.php b/Tests/Acceptance/_support/Helper/MiscellaneousHelper.php new file mode 100644 index 00000000..6e6be6c1 --- /dev/null +++ b/Tests/Acceptance/_support/Helper/MiscellaneousHelper.php @@ -0,0 +1,46 @@ +getModule('WebDriver') + ->moduleContainer + ->getModule('VisualCeption') + ->_reconfigure(['fullScreenShot' => true]); + } + + /** + * This function allows to disable the fullScreenShot feature + * for a specific test. + * + * The configuration is only valid vor the test where the function is called. + * After the test the configuration is restored to the default. + * + * + * @throws \Codeception\Exception\ModuleConfigException + * @throws \Codeception\Exception\ModuleException + */ + public function disableFullScreenShot() + { + $this + ->getModule('WebDriver') + ->moduleContainer + ->getModule('VisualCeption') + ->_reconfigure(['fullScreenShot' => false]); + } +} diff --git a/Tests/Acceptance/acceptance.suite.yml b/Tests/Acceptance/acceptance.suite.yml index cc31a024..6163af55 100644 --- a/Tests/Acceptance/acceptance.suite.yml +++ b/Tests/Acceptance/acceptance.suite.yml @@ -7,9 +7,9 @@ modules: host: seleniarm-hub port: 4444 path: '/wd/hub' + window_size: 1920x1080 connection_timeout: 5 restart: true - window_size: maximize capabilities: browserName: "chrome" acceptInsecureCerts: true diff --git a/Tests/Acceptance/acceptance/Backend/AnalyseDashboardCest.php b/Tests/Acceptance/acceptance/Backend/AnalyseDashboardCest.php new file mode 100644 index 00000000..6b6003ef --- /dev/null +++ b/Tests/Acceptance/acceptance/Backend/AnalyseDashboardCest.php @@ -0,0 +1,36 @@ +loginToBackend($I); + } + + public function loginToBackendSuccessfully(AcceptanceTester $I) + { + $I->click('Analyse'); + + // Warte auf den Container, in dem die AJAX-Inhalte geladen werden + $I->waitForElement('.panel-heading', 30); + + // Alternative Methoden zum Warten: + $I->waitForText('Top 10', 30); // Wartet bis zu 30 Sekunden auf den Text + // ODER + $I->waitForAjax(30); // Wartet auf AJAX-Requests + + // Jetzt erst nach dem Text suchen + $I->see('Top 10'); + + // Optional: Debug-Hilfen + $I->makeScreenshot('after_ajax_load'); + + // Weitere Tests... + //$I->see('Seitenaufrufe'); + //$I->selectOption('#time', ['value' => '1']); + } +} diff --git a/Tests/Acceptance/acceptance/Backend/BackendLoginCest.php b/Tests/Acceptance/acceptance/Backend/ModulesExistingCest.php similarity index 93% rename from Tests/Acceptance/acceptance/Backend/BackendLoginCest.php rename to Tests/Acceptance/acceptance/Backend/ModulesExistingCest.php index d5d8a371..d827dde1 100644 --- a/Tests/Acceptance/acceptance/Backend/BackendLoginCest.php +++ b/Tests/Acceptance/acceptance/Backend/ModulesExistingCest.php @@ -4,7 +4,7 @@ use In2code\Lux\Tests\AcceptanceTester; -class BackendLoginCest +class ModulesExistingCest { public function _before(AcceptanceTester $I) { From edeb208bc9c2bf043377e1ffa96b9da00ddd3c62 Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Tue, 14 Jan 2025 11:18:32 +0100 Subject: [PATCH 7/8] [BUGFIX] Prevent possible exception when calling cleanup:deletedrecords on CLI Error message: Uncaught TYPO3 Exception In2code\Lux\TCA\VisitorTitle::getEmail(): Argument #1 ($properties) must be of type array, null given, called in .../vendor/in2code/lux/Classes/TCA/VisitorTitle.php on line 13 thrown in file .../vendor/in2code/lux/Classes/TCA/VisitorTitle.php in line 16 --- Classes/TCA/VisitorTitle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/TCA/VisitorTitle.php b/Classes/TCA/VisitorTitle.php index c1c0742d..d20b6985 100644 --- a/Classes/TCA/VisitorTitle.php +++ b/Classes/TCA/VisitorTitle.php @@ -10,7 +10,7 @@ class VisitorTitle public function getContactTitle(array &$parameters, $parentObject): void { unset($parentObject); - $parameters['title'] = $this->getEmail($parameters['row']) . ' (uid' . $parameters['row']['uid'] . ')'; + $parameters['title'] = $this->getEmail($parameters['row'] ?? []) . ' (uid' . $parameters['row']['uid'] . ')'; } protected function getEmail(array $properties): string From 8125843136e30884b648b48c7d551f29da71dfe0 Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Tue, 14 Jan 2025 11:21:51 +0100 Subject: [PATCH 8/8] [TASK] Release preparations --- Documentation/Technical/Changelog/Index.md | 1 + ext_emconf.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/Technical/Changelog/Index.md b/Documentation/Technical/Changelog/Index.md index feee6440..cc2b60f3 100644 --- a/Documentation/Technical/Changelog/Index.md +++ b/Documentation/Technical/Changelog/Index.md @@ -9,6 +9,7 @@ | Version | Date | State | TYPO3 | Description | |------------|------------|----------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 38.2.0 | 2024-01-14 | Task | `12.4 + 13.4` | Small bugfix for command cleanup:deletedrecods, added first codeception test and framework, removed unneeded files, documentation update | | 38.1.0 | 2024-12-08 | Task | `12.4 + 13.4` | Fix identification of logged in frontendusers, update some LUXletter related stuff (if LUX + LUXletter is in use), code cleanup | | 38.0.1 | 2024-11-26 | Bugfix | `12.4 + 13.4` | Update TYPO3 dependencies in old ext_emconf file | | 38.0.0 | 2024-11-25 | Feature | `12.4 + 13.4` | Add TYPO3 13 support, drop TYPO3 11 support, add darkmode styling, add LUX to TYPO3 livesearch in backend | diff --git a/ext_emconf.php b/ext_emconf.php index 94ece1c8..08d92662 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -4,7 +4,7 @@ 'description' => 'Living User Experience - LUX - the Marketing Automation tool for TYPO3. Turn your visitors to leads. Identification and profiling of your visitors within your TYPO3 website.', 'category' => 'plugin', - 'version' => '38.1.0', + 'version' => '38.2.0', 'author' => 'Alex Kellner', 'author_email' => 'alexander.kellner@in2code.de', 'author_company' => 'in2code.de',