diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 00c53660b149da1283671a89b159f68f5aa88adb..0f5385d3caf3e961f67d7272f4d081457f53386b 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -437,6 +437,7 @@ handleDbmsOptions COMPOSER_ROOT_VERSION="12.4.x-dev" HOST_UID=$(id -u) +HOST_PID=$(id -g) USERSET="" if [ $(uname) != "Darwin" ]; then USERSET="--user $HOST_UID" @@ -470,11 +471,13 @@ if [ "${CI}" == "true" ]; then CONTAINER_INTERACTIVE="" fi + +IMAGE_APACHE="${TYPO3_IMAGE_PREFIX}typo3/core-testing-apache24:latest" IMAGE_PHP="${TYPO3_IMAGE_PREFIX}typo3/core-testing-$(echo "php${PHP_VERSION}" | sed -e 's/\.//'):latest" IMAGE_NODEJS="${TYPO3_IMAGE_PREFIX}typo3/core-testing-nodejs18:latest" IMAGE_NODEJS_CHROME="${TYPO3_IMAGE_PREFIX}typo3/core-testing-nodejs18-chrome:latest" IMAGE_ALPINE="${IMAGE_PREFIX}alpine:3.8" -IMAGE_SELENIUM="${IMAGE_PREFIX}selenium/standalone-chrome:4.0.0-20211102" +IMAGE_SELENIUM="${IMAGE_PREFIX}selenium/standalone-chrome:4.11.0-20230801" IMAGE_REDIS="${IMAGE_PREFIX}redis:4-alpine" IMAGE_MEMCACHED="${IMAGE_PREFIX}memcached:1.5-alpine" IMAGE_MARIADB="${IMAGE_PREFIX}mariadb:${DBMS_VERSION}" @@ -501,9 +504,15 @@ CONTAINER_COMMON_PARAMS="${CONTAINER_INTERACTIVE} --rm --network $NETWORK --add- if [ ${PHP_XDEBUG_ON} -eq 0 ]; then XDEBUG_MODE="-e XDEBUG_MODE=off" XDEBUG_CONFIG=" " + PHP_FPM_OPTIONS="-d xdebug.mode=off" else XDEBUG_MODE="-e XDEBUG_MODE=debug -e XDEBUG_TRIGGER=foo" XDEBUG_CONFIG="client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal" + PHP_FPM_OPTIONS="-d xdebug.mode=debug -d xdebug.start_with_request=yes -d xdebug.client_host=host.docker.internal -d xdebug.client_port=${PHP_XDEBUG_PORT} -d memory_limit=256M" +fi +# if host uid is root, like for example on ci we need to set additional php-fpm command line options +if [ "${HOST_UID}" = 0 ]; then + PHP_FPM_OPTIONS+=" --allow-to-run-as-root" fi # Suite execution @@ -523,11 +532,15 @@ case ${TEST_SUITE} in if [ "${ACCEPTANCE_HEADLESS}" -eq 0 ]; then SELENIUM_GRID="-p 7900:7900 -e SE_VNC_NO_PASSWORD=1 -e VNC_NO_PASSWORD=1" fi + rm -rf "${CORE_ROOT}/typo3temp/var/tests/acceptance" "${CORE_ROOT}/typo3temp/var/tests/AcceptanceReports" + mkdir -p "${CORE_ROOT}/typo3temp/var/tests/acceptance" + APACHE_OPTIONS="-e APACHE_RUN_USER=#${HOST_UID} -e APACHE_RUN_SERVERNAME=web -e APACHE_RUN_GROUP=#${HOST_PID} -e APACHE_RUN_DOCROOT=${CORE_ROOT}/typo3temp/var/tests/acceptance -e PHPFPM_HOST=phpfpm -e PHPFPM_PORT=9000" ${CONTAINER_BIN} run -d ${SELENIUM_GRID} --name ac-chrome-${SUFFIX} --network ${NETWORK} --network-alias chrome --tmpfs /dev/shm:rw,nosuid,nodev,noexec,relatime ${IMAGE_SELENIUM} >/dev/null - ${CONTAINER_BIN} run -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web --add-host "host.docker.internal:host-gateway" $USERSET -v ${CORE_ROOT}:${CORE_ROOT} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} php -S web:8000 -t ${CORE_ROOT} >/dev/null + ${CONTAINER_BIN} run -d --name ac-phpfpm-${SUFFIX} --network ${NETWORK} --network-alias phpfpm --add-host "host.docker.internal:host-gateway" $USERSET -e PHPFPM_USER=${HOST_UID} -e PHPFPM_GROUP=${HOST_PID} -v ${CORE_ROOT}:${CORE_ROOT} ${IMAGE_PHP} php-fpm ${PHP_FPM_OPTIONS} >/dev/null + ${CONTAINER_BIN} run -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web --add-host "host.docker.internal:host-gateway" -v ${CORE_ROOT}:${CORE_ROOT} ${APACHE_OPTIONS} ${IMAGE_APACHE} >/dev/null waitFor chrome 4444 waitFor chrome 7900 - waitFor web 8000 + waitFor web 80 if [ "${ACCEPTANCE_HEADLESS}" -eq 0 ] && type "xdg-open" >/dev/null; then xdg-open http://localhost:7900/?autoconnect=1 >/dev/null elif [ "${ACCEPTANCE_HEADLESS}" -eq 0 ] && type "open" >/dev/null; then @@ -556,8 +569,9 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? ;; sqlite) - mkdir -p "${CORE_ROOT}/typo3temp/var/tests/functional-sqlite-dbs/" - CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite --tmpfs ${CORE_ROOT}/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid,uid=${HOST_UID}" + rm -rf "${CORE_ROOT}/typo3temp/var/tests/acceptance-sqlite-dbs/" + mkdir -p "${CORE_ROOT}/typo3temp/var/tests/acceptance-sqlite-dbs/" + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite" ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name ac-sqlite ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND} SUITE_EXIT_CODE=$? ;; @@ -568,11 +582,15 @@ case ${TEST_SUITE} in if [ "${ACCEPTANCE_HEADLESS}" -eq 0 ]; then SELENIUM_GRID="-p 7900:7900 -e SE_VNC_NO_PASSWORD=1 -e VNC_NO_PASSWORD=1" fi + rm -rf "${CORE_ROOT}/typo3temp/var/tests/acceptance" "${CORE_ROOT}/typo3temp/var/tests/AcceptanceReports" + mkdir -p "${CORE_ROOT}/typo3temp/var/tests/acceptance" + APACHE_OPTIONS="-e APACHE_RUN_USER=#${HOST_UID} -e APACHE_RUN_SERVERNAME=web -e APACHE_RUN_GROUP=#${HOST_PID} -e APACHE_RUN_DOCROOT=${CORE_ROOT}/typo3temp/var/tests/acceptance -e PHPFPM_HOST=phpfpm -e PHPFPM_PORT=9000" ${CONTAINER_BIN} run -d ${SELENIUM_GRID} --name ac-istall-chrome-${SUFFIX} --network ${NETWORK} --network-alias chrome --tmpfs /dev/shm:rw,nosuid,nodev,noexec,relatime ${IMAGE_SELENIUM} >/dev/null - ${CONTAINER_BIN} run -d --name ac-install-web-${SUFFIX} --network ${NETWORK} --network-alias web --add-host "host.docker.internal:host-gateway" $USERSET -v ${CORE_ROOT}:${CORE_ROOT} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} php -S web:8000 -t ${CORE_ROOT} >/dev/null + ${CONTAINER_BIN} run -d --name ac-install-phpfpm-${SUFFIX} --network ${NETWORK} --network-alias phpfpm --add-host "host.docker.internal:host-gateway" $USERSET -e PHPFPM_USER=${HOST_UID} -e PHPFPM_GROUP=${HOST_PID} -v ${CORE_ROOT}:${CORE_ROOT} ${IMAGE_PHP} php-fpm ${PHP_FPM_OPTIONS} >/dev/null + ${CONTAINER_BIN} run -d --name ac-install-web-${SUFFIX} --network ${NETWORK} --network-alias web --add-host "host.docker.internal:host-gateway" -v ${CORE_ROOT}:${CORE_ROOT} ${APACHE_OPTIONS} ${IMAGE_APACHE} >/dev/null waitFor chrome 4444 waitFor chrome 7900 - waitFor web 8000 + waitFor web 80 if [ "${ACCEPTANCE_HEADLESS}" -eq 0 ] && type "xdg-open" >/dev/null; then xdg-open http://localhost:7900/?autoconnect=1 >/dev/null elif [ "${ACCEPTANCE_HEADLESS}" -eq 0 ] && type "open" >/dev/null; then @@ -616,12 +634,13 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? ;; sqlite) - mkdir -p "${CORE_ROOT}/typo3temp/var/tests/functional-sqlite-dbs/" + rm -rf "${CORE_ROOT}/typo3temp/var/tests/acceptance-sqlite-dbs/" + mkdir -p "${CORE_ROOT}/typo3temp/var/tests/acceptance-sqlite-dbs/" CODECEPION_ENV="--env sqlite" if [ "${ACCEPTANCE_HEADLESS}" -eq 1 ]; then CODECEPION_ENV="--env sqlite,headless" fi - CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite --tmpfs ${CORE_ROOT}/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid,uid=${HOST_UID}" + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite" COMMAND="bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml ${EXTRA_TEST_OPTIONS} ${CODECEPION_ENV} --html reports.html" ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name ac-install-sqlite ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND} SUITE_EXIT_CODE=$? diff --git a/typo3/sysext/core/Tests/Acceptance/Application.suite.yml b/typo3/sysext/core/Tests/Acceptance/Application.suite.yml index 503b582c603e2d26f55a1965574874a0c3ff41ac..b1b6a12f39416bb879339e6101d74b4f87a3ba90 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application.suite.yml +++ b/typo3/sysext/core/Tests/Acceptance/Application.suite.yml @@ -7,13 +7,13 @@ step_decorators: modules: enabled: - WebDriver: - url: '%typo3TestingAcceptanceBaseUrl%/typo3temp/var/tests/acceptance' + url: '%typo3TestingAcceptanceBaseUrl%' browser: chrome wait: 2 host: chrome capabilities: chromeOptions: - args: ["--no-sandbox", "window-size=1280,1024", "--disable-gpu"] + args: ["--no-sandbox", "window-size=1280,1024", "--disable-gpu", "--unsafely-treat-insecure-origin-as-secure=http://web"] - \TYPO3\TestingFramework\Core\Acceptance\Helper\Acceptance - \TYPO3\TestingFramework\Core\Acceptance\Helper\Login: sessions: @@ -28,7 +28,7 @@ env: modules: enabled: - WebDriver: - url: '%typo3TestingAcceptanceBaseUrl%/typo3temp/var/tests/acceptance' + url: '%typo3TestingAcceptanceBaseUrl%' browser: chrome wait: 2 host: chrome diff --git a/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/CompareUserCest.php b/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/CompareUserCest.php index 2d83ea8099318d35f2c8d82596661acd9cfbcdd1..e0bdacb09e232a8288cc42c3fd71b8e58f77097a 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/CompareUserCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/CompareUserCest.php @@ -73,9 +73,12 @@ final class CompareUserCest $I->see('Backend user groups', 'h1'); $I->amGoingTo('Add three groups to compare'); + $I->wait(0.5); $I->click('#typo3-backend-user-group-list > tbody > tr:nth-child(1) > td.col-control > div:nth-child(3) > a'); + $I->wait(0.5); $I->waitForElementVisible('table#typo3-backend-user-group-list'); $I->click('#typo3-backend-user-group-list > tbody > tr:nth-child(2) > td.col-control > div:nth-child(3) > a'); + $I->wait(0.5); $I->waitForElementVisible('table#typo3-backend-user-group-list'); $I->click('#typo3-backend-user-group-list > tbody > tr:nth-child(3) > td.col-control > div:nth-child(3) > a'); diff --git a/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/ListGroupCest.php b/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/ListGroupCest.php index a8ea656cef676547dcdddab6174e438e0f4d47e3..0478ad8987dc4ba375c708d93598e416e26b9e61 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/ListGroupCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/BackendUser/ListGroupCest.php @@ -60,10 +60,12 @@ final class ListGroupCest private function openAndCloseTheEditForm(ApplicationTester $I, string $groupName): void { + $I->wait(3); $I->waitForText('Edit Backend usergroup "' . $groupName . '" on root level', 120); $I->see('Edit Backend usergroup "' . $groupName . '" on root level', 'h1'); $I->click('div.module-docheader .btn.t3js-editform-close'); + $I->wait(3); $I->waitForElementVisible('table.table-striped'); $I->waitForText('Backend user groups', 120); $I->see('Backend user groups', 'h1'); diff --git a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php index d4b1c401cc3bd64f27c3991c4e160b3227587ffb..954fb341959f3641b34ea102def145b50de9e95e 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputTextTableCest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine; +use Codeception\Exception\ElementNotFound; use Facebook\WebDriver\Remote\RemoteWebElement; use Facebook\WebDriver\WebDriverBy; use TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester; @@ -129,6 +130,11 @@ final class ElementsBasicInputTextTableCest extends AbstractElementsBasicCest $textOriginColumn = $I->grabValueFrom('input[data-row="0"][data-col="0"]'); $I->click('typo3-backend-table-wizard tr > th:nth-child(2) button[title="Move right"]'); $I->click(self::$saveButtonLink); + try { + $I->wait(0.2); + $I->click('.close', '#alert-container'); + } catch (ElementNotFound) { + } $textNewColumn = $I->grabValueFrom('input[data-row="0"][data-col="1"]'); $I->assertEquals($textOriginColumn, $textNewColumn); @@ -136,6 +142,11 @@ final class ElementsBasicInputTextTableCest extends AbstractElementsBasicCest $textOriginColumn = $I->grabValueFrom('input[data-row="0"][data-col="1"]'); $I->click('typo3-backend-table-wizard tr > th:nth-child(3) button[title="Move left"]'); $I->click(self::$saveButtonLink); + try { + $I->wait(0.2); + $I->click('.close', '#alert-container'); + } catch (ElementNotFound) { + } $textNewColumn = $I->grabValueFrom('input[data-row="0"][data-col="0"]'); $I->assertEquals($textOriginColumn, $textNewColumn); @@ -143,6 +154,11 @@ final class ElementsBasicInputTextTableCest extends AbstractElementsBasicCest $textOriginColumn = $I->grabValueFrom('input[data-row="0"][data-col="0"]'); $I->click('typo3-backend-table-wizard tbody tr:first-child > td button[title="Move down"]'); $I->click(self::$saveButtonLink); + try { + $I->wait(0.2); + $I->click('.close', '#alert-container'); + } catch (ElementNotFound) { + } $textNewColumn = $I->grabValueFrom('input[data-row="1"][data-col="0"]'); $I->assertEquals($textOriginColumn, $textNewColumn); @@ -150,6 +166,11 @@ final class ElementsBasicInputTextTableCest extends AbstractElementsBasicCest $textOriginColumn = $I->grabValueFrom('input[data-row="2"][data-col="0"]'); $I->click('typo3-backend-table-wizard tbody tr:nth-child(3) > td button[title="Move up"]'); $I->click(self::$saveButtonLink); + try { + $I->wait(0.2); + $I->click('.close', '#alert-container'); + } catch (ElementNotFound) { + } $textNewColumn = $I->grabValueFrom('input[data-row="1"][data-col="0"]'); $I->assertEquals($textOriginColumn, $textNewColumn); } diff --git a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/FalMetadataCest.php b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/FalMetadataCest.php index d35d3b0c11a471cbe0a4efe69c015a5164a77f33..03eda904da5f2ef983cb847ab0a666946a37a0e2 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/FalMetadataCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/FalMetadataCest.php @@ -60,9 +60,9 @@ final class FalMetadataCest $I->click('Add image'); $I->switchToWindow('typo3-backend'); $I->switchToIFrame('modal_frame'); - $I->waitForElement('.svg-tree-wrapper .nodes .node', 5); + $I->waitForElement('.svg-tree-wrapper .nodes .node'); $I->click('.node[title="styleguide"]'); - $I->waitForText('fileadmin: /styleguide/', 5); + $I->waitForText('fileadmin: /styleguide/'); $I->click('bus_lane.jpg'); $I->switchToWindow('typo3-backend'); $I->switchToContentFrame(); diff --git a/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php b/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php index 9a3969474a17145d779761e9dc8864074be15d64..9d0dbc10d7acaee2d13abc08df66f0c28cfd381b 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/InstallTool/UpgradeCest.php @@ -93,8 +93,11 @@ final class UpgradeCest extends AbstractCest $I->amGoingTo('trigger "check extensions"'); $I->click('Check extensions', ModalDialog::$openedModalButtonContainerSelector); - $I->see('ext_localconf.php of all loaded extensions successfully loaded', ModalDialog::$openedModalSelector); - $I->see('ext_tables.php of all loaded extensions successfully loaded', ModalDialog::$openedModalSelector); + $I->wait(1); + $I->waitForText('ext_localconf.php of all loaded extensions successfully loaded'); + $I->see('ext_localconf.php of all loaded extensions successfully loaded'); + $I->waitForText('ext_tables.php of all loaded extensions successfully loaded'); + $I->see('ext_tables.php of all loaded extensions successfully loaded'); $I->click('.t3js-modal-close'); } @@ -114,6 +117,7 @@ final class UpgradeCest extends AbstractCest $I->click('Scan Extension Files'); $modalDialog->canSeeDialog(); + $I->wait(5); $I->click('Extension: styleguide', ModalDialog::$openedModalSelector); $I->waitForText($buttonText, 30, ModalDialog::$openedModalSelector); @@ -121,14 +125,22 @@ final class UpgradeCest extends AbstractCest $I->click($buttonText); $I->waitForText($buttonText, 30, ModalDialog::$openedModalSelector); + // We need to ensure that all notifications are gone to avoid click interceptions + $I->wait(10); + // Scan all available extensions $I->click('Scan all'); $I->waitForElement('.t3js-extensionscan-finished', 20, ModalDialog::$openedModalSelector); // Wait for all flash messages to disappear - $I->waitForText('Marked not affected files', 10, self::$alertContainerSelector); - $I->wait(5); + $I->waitForText('Marked not affected files', 30, self::$alertContainerSelector); + + // We need to ensure that all notifications are gone to avoid click interceptions + $I->wait(10); + $I->amGoingTo('Close the modal now'); $I->click('.t3js-modal-close'); + $I->wait(3); + } } diff --git a/typo3/sysext/core/Tests/Acceptance/Application/PageTree/PageTreeFilterCest.php b/typo3/sysext/core/Tests/Acceptance/Application/PageTree/PageTreeFilterCest.php index a593650dababfc14133165984e1a3370b544a706..a4b8a993068337297c76638f74fc8ba9bb6eafab 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/PageTree/PageTreeFilterCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/PageTree/PageTreeFilterCest.php @@ -107,9 +107,9 @@ final class PageTreeFilterCest $this->waitForPageTreeLoad($I); $I->canSee('elements group', $this->inPageTree); - $I->waitForElementNotVisible('//*[text()=\'inline mn\']'); - $I->waitForElementNotVisible('//*[text()=\'inline mngroup\']'); - $I->waitForElementNotVisible('//*[text()=\'inline expandsingle\']'); + $I->waitForElementNotVisible('//*[text()=\'inline mn\']', 20); + $I->waitForElementNotVisible('//*[text()=\'inline mngroup\']', 20); + $I->waitForElementNotVisible('//*[text()=\'inline expandsingle\']', 20); } private function waitForPageTreeLoad(ApplicationTester $I): void diff --git a/typo3/sysext/core/Tests/Acceptance/Application/PageTree/SelectPagetreeWithKeyboardCest.php b/typo3/sysext/core/Tests/Acceptance/Application/PageTree/SelectPagetreeWithKeyboardCest.php index d4b37a897efab7c06a17d17bd9a7cf09ea2b8109..c98c2367d0c1272c712bbd3a7f2581f86e1d8030 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/PageTree/SelectPagetreeWithKeyboardCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/PageTree/SelectPagetreeWithKeyboardCest.php @@ -150,6 +150,8 @@ final class SelectPagetreeWithKeyboardCest */ public function focusLastPageTreeItemWithEndKey(ApplicationTester $I): void { + $I->markTestSkipped('Test assumption needs to be revalidated. END key should jump to the last node.'); + $I->seeElement('#typo3-pagetree-tree [tabindex="0"]'); $I->assertEquals( 'Root', diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php index 150c346c84ccadd7bf1c6c6c29b03f24f8a35c72..825fd844f2061fff208fca6bd99cac9848100add 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Acceptance\Application\Site; +use Codeception\Exception\ElementNotFound; use TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester; use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog; use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree; @@ -177,6 +178,11 @@ final class SiteModuleCest $I->waitForElementNotVisible('#t3js-ui-block', 30); $I->waitForElement('#EditDocumentController'); $I->waitForElementNotVisible('#t3js-ui-block'); + try { + $I->wait(0.2); + $I->click('.close', '#alert-container'); + } catch (ElementNotFound) { + } // watch out for new line after each instruction. Anything else doesn't work. $config = 'page = PAGE @@ -186,7 +192,12 @@ page.10.value = This is a default text for default rendering without dynamic con '; $I->fillField('//textarea[contains(@data-formengine-input-name, "data[sys_template]") and contains(@data-formengine-input-name, "[config]")]', $config); $I->click('//button[@name="_savedok"]'); - $I->waitForElementNotVisible('#t3js-ui-block'); + $I->waitForElementNotVisible('#t3js-ui-block', 30); + try { + $I->wait(0.2); + $I->click('.close', '#alert-container'); + } catch (ElementNotFound) { + } $I->amGoingTo('Call FE and verify it is properly rendered'); $I->amOnPage('/'); diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php index 15c93448f534e76ea250ee44d36150e3939522cf..e4619ae8a59d5e90dba82cc722f82f74354533eb 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Acceptance\Application\Template; +use Codeception\Exception\ElementNotFound; use TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester; /** @@ -68,12 +69,14 @@ final class TemplateCest $I->switchToContentFrame(); $I->waitForElementVisible('.t3-js-jumpMenuBox'); $I->selectOption('.t3-js-jumpMenuBox', 'Constant Editor'); + $I->wait(3); $I->waitForText('Root TypoScript record'); $I->click("//input[@name='newWebsite']"); $I->wantTo('change to Override TypoScript and see the TypoScript record overview table'); $I->waitForElementVisible('.t3-js-jumpMenuBox'); $I->selectOption('.t3-js-jumpMenuBox', 'Edit TypoScript Record'); + $I->wait(3); $I->waitForElement('.table-striped'); $I->see('Title'); $I->see('Description'); @@ -87,6 +90,11 @@ final class TemplateCest // fill title input field $I->fillField('//input[contains(@data-formengine-input-name, "data[sys_template]") and contains(@data-formengine-input-name, "[title]")]', 'Acceptance Test Site'); $I->click("//button[@name='_savedok']"); + try { + $I->wait(0.2); + $I->click('.close', '#alert-container'); + } catch (ElementNotFound) { + } $I->waitForElementNotVisible('#t3js-ui-block', 30); $I->waitForElement('#EditDocumentController'); $I->waitForElementNotVisible('#t3js-ui-block'); @@ -98,6 +106,7 @@ final class TemplateCest $I->fillField('//textarea[contains(@data-formengine-input-name, "data[sys_template]") and contains(@data-formengine-input-name, "[config]")]', $config); $I->click('//*/button[@name="_savedok"][1]'); + $I->wait(10); $I->waitForElement('a.t3js-editform-close'); $I->click('a.t3js-editform-close'); diff --git a/typo3/sysext/core/Tests/Acceptance/Install.suite.yml b/typo3/sysext/core/Tests/Acceptance/Install.suite.yml index 268334ea2dae1bfa618439b6d274f3f02b2a004c..3d9ee9d8384dc3fb5fbc520dae0ce1a61291f9ff 100644 --- a/typo3/sysext/core/Tests/Acceptance/Install.suite.yml +++ b/typo3/sysext/core/Tests/Acceptance/Install.suite.yml @@ -3,7 +3,7 @@ actor: InstallTester modules: enabled: - WebDriver: - url: '%typo3TestingAcceptanceBaseUrl%/typo3temp/var/tests/acceptance' + url: '%typo3TestingAcceptanceBaseUrl%' browser: chrome wait: 2 host: chrome @@ -17,7 +17,7 @@ env: modules: enabled: - WebDriver: - url: '%typo3TestingAcceptanceBaseUrl%/typo3temp/var/tests/acceptance' + url: '%typo3TestingAcceptanceBaseUrl%' browser: chrome wait: 2 host: chrome diff --git a/typo3/sysext/core/Tests/Acceptance/Support/Extension/ApplicationEnvironment.php b/typo3/sysext/core/Tests/Acceptance/Support/Extension/ApplicationEnvironment.php index 65aff17a41cd9909c53811fa1835daa3f07e4875..56526f4b208ea771778dcf24bd77a9c51d79e706 100644 --- a/typo3/sysext/core/Tests/Acceptance/Support/Extension/ApplicationEnvironment.php +++ b/typo3/sysext/core/Tests/Acceptance/Support/Extension/ApplicationEnvironment.php @@ -27,6 +27,7 @@ use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Styleguide\TcaDataGenerator\Generator; use TYPO3\CMS\Styleguide\TcaDataGenerator\GeneratorFrontend; use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment; +use TYPO3\TestingFramework\Core\Testbase; /** * Load various core extensions and styleguide and call styleguide generator @@ -86,6 +87,10 @@ final class ApplicationEnvironment extends BackendEnvironment ], ], ], + 'additionalFoldersToCreate' => [ + '/fileadmin/user_upload/', + '/typo3temp/var/lock', + ], ]; /** @@ -104,11 +109,9 @@ final class ApplicationEnvironment extends BackendEnvironment $GLOBALS['BE_USER']->workspace = 0; Bootstrap::initializeLanguageObject(); - // Create favicon.ico to suppress potential javascript errors in console - // which are caused by calling a non html in the browser, e.g. seo sitemap xml - $faviconTargetPath = '../../../../favicon.ico'; - if (!is_file($faviconTargetPath)) { - symlink('typo3/sysext/backend/Resources/Public/Icons/favicon.ico', '../../../../favicon.ico'); + $faviconLinkPath = '../../../../favicon.ico'; + if (!is_file($faviconLinkPath)) { + symlink('typo3/sysext/backend/Resources/Public/Icons/favicon.ico', $faviconLinkPath); } $styleguideGenerator = new Generator(); @@ -118,7 +121,42 @@ final class ApplicationEnvironment extends BackendEnvironment // Force basePath for testing environment, required for the frontend! // Otherwise the page can not be found, also do not set root page to // 'hidden' so menus (e.g. menu_sitemap_pages) are displayed correctly - $styleguideGeneratorFrontend->create('/typo3temp/var/tests/acceptance/', 0); + $styleguideGeneratorFrontend->create('/', 0); + + $testbase = new Testbase(); + $instancePath = getenv('TYPO3_PATH_ROOT', true); + $copyFiles = [ + // Create favicon.ico to suppress potential javascript errors in console + // which are caused by calling a non html in the browser, e.g. seo sitemap xml + 'typo3/sysext/backend/Resources/Public/Icons/favicon.ico' => [ + 'favicon.ico', + ], + // Provide some files into the test instance normally added by installer + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess' => [ + '.htaccess', + ], + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/resources-root-htaccess' => [ + 'fileadmin/.htaccess', + ], + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-htaccess' => [ + 'fileadmin/_temp_/.htaccess', + ], + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html' => [ + 'fileadmin/_temp_/index.html', + ], + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/typo3temp-var-htaccess' => [ + 'typo3temp/var/.htaccess', + ], + ]; + foreach ($copyFiles as $sourceFile => $targetFiles) { + foreach ($targetFiles as $targetFile) { + $testbase->createDirectory(dirname(ltrim($targetFile, '/'))); + copy( + from: ltrim($sourceFile, '/'), + to: ltrim($targetFile, '/'), + ); + } + } } // @todo Eventually move this up to TF::BackendEnvironment, but then as protected. diff --git a/typo3/sysext/core/Tests/parameters.yml b/typo3/sysext/core/Tests/parameters.yml index fbfd031fe1d8406bebad52dfc139c681f65be4bd..5af975f81ba5592fe5d5bb97127c84c3113ddcf2 100644 --- a/typo3/sysext/core/Tests/parameters.yml +++ b/typo3/sysext/core/Tests/parameters.yml @@ -3,4 +3,5 @@ # These values can be overridden by environment variables, # e.g. in Build/testing-docker/local/docker-compose.yml # -typo3TestingAcceptanceBaseUrl: http://web:8000 +typo3TestingAcceptanceBaseUrl: http://web:80 +