Commit 1103863b authored by Jochen Roth's avatar Jochen Roth Committed by Benni Mack
Browse files

[BUGFIX] Fix the upgrade docs panel and add tests

Docs panel will open on click and show its content
again and add tests for all cards in this module
to make sure it is and will stay fully functional.

Resolves: #94472
Releases: master
Change-Id: I6a30e64b3b2a4988550b6f18e50dc1ca51cc3f22
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69688

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 0a24d1e9
...@@ -35,6 +35,8 @@ class AbstractCest ...@@ -35,6 +35,8 @@ class AbstractCest
public function _after(BackendTester $I) public function _after(BackendTester $I)
{ {
$I->click('Logout'); $I->click('Logout');
// Make sure logout has finished
$I->waitForText('The Install Tool is locked', 20);
$I->amGoingTo('clean up created files'); $I->amGoingTo('clean up created files');
unlink(Environment::getProjectPath() . '/' . self::ADDITIONAL_CONFIGURATION_FILEPATH); unlink(Environment::getProjectPath() . '/' . self::ADDITIONAL_CONFIGURATION_FILEPATH);
......
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\InstallTool;
use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog;
class UpgradeCest extends AbstractCest
{
public static string $alertContainerSelector = '#alert-container';
public function _before(BackendTester $I)
{
parent::_before($I);
$this->logIntoInstallTool($I);
$I->click('Upgrade');
$I->see('Upgrade', 'h1');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeUpgradeCore(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Update Core');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the core updater');
$I->see('TYPO3 CMS core to its latest minor release');
$I->click('.t3js-modal-close');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeUpgradeWizard(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Run Upgrade Wizard');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the upgrade wizard and set charset to utf8');
$I->see('Upgrade Wizard', ModalDialog::$openedModalSelector);
$I->click('Set default charset to utf8', ModalDialog::$openedModalSelector);
$I->waitForText('Default connection database has been set to utf8', 5, ModalDialog::$openedModalSelector);
$I->see('No wizards are marked as done', ModalDialog::$openedModalSelector);
$I->click('.t3js-modal-close');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeViewUpgradeDocumentation(BackendTester $I, ModalDialog $modalDialog)
{
$versionPanel = '#version-0 .t3js-changelog-list > div:first-child';
$I->click('View Upgrade Documentation');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the view upgrade documentation');
$I->see('View Upgrade Documentation', ModalDialog::$openedModalSelector);
$I->amGoingTo('mark an item as read');
$I->click('Version: master', '.panel-title');
$I->waitForElement('#version-0', 5, ModalDialog::$openedModalSelector);
$textCurrentFirstPanelHeading = $I->grabTextFrom($versionPanel . ' .panel-heading');
$I->click($versionPanel . ' a[data-bs-toggle="collapse"]');
$I->click($versionPanel . ' .t3js-upgradeDocs-markRead');
$textNewFirstPanelHeading = $I->grabTextFrom($versionPanel . ' .panel-heading');
$I->assertNotEquals($textCurrentFirstPanelHeading, $textNewFirstPanelHeading);
$I->amGoingTo('mark an item as unread');
$I->click('#heading-read');
$I->waitForElement('#collapseRead', 5, ModalDialog::$openedModalSelector);
$I->executeJS('document.querySelector("#collapseRead").scrollIntoView();');
$I->see($textCurrentFirstPanelHeading, '#collapseRead');
$I->click('#collapseRead .t3js-changelog-list > div:first-child .t3js-upgradeDocs-unmarkRead');
$I->see($textCurrentFirstPanelHeading, '#version-0');
$I->click('.t3js-modal-close');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
*/
public function seeCheckTca(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Check TCA');
$modalDialog->canSeeDialog();
$I->see('No TCA changes in ext_tables.php files.', ModalDialog::$openedModalSelector);
$I->click('.t3js-modal-close');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
*/
public function seeCheckForBrokenExtensions(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Check Extension Compatibility');
$modalDialog->canSeeDialog();
$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->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->click('.t3js-modal-close');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
*/
public function seeCheckTcaMigrations(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Check TCA Migrations');
$modalDialog->canSeeDialog();
$I->see('Checks whether the current TCA needs migrations and displays the new migration paths which need to be adjusted manually', ModalDialog::$openedModalSelector);
$I->click('.t3js-modal-close');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
*/
public function seeScanExtensionFiles(BackendTester $I, ModalDialog $modalDialog)
{
$buttonText = 'Rescan';
$I->click('Scan Extension Files');
$modalDialog->canSeeDialog();
$I->click('Extension: styleguide', ModalDialog::$openedModalSelector);
$I->waitForText($buttonText, 30, ModalDialog::$openedModalSelector);
// Trigger scan for single extension
$I->click($buttonText);
$I->waitForText($buttonText, 30, ModalDialog::$openedModalSelector);
// Scan all available extensions
$I->click('Scan all');
$I->waitForElement('.panel-success', 20, ModalDialog::$openedModalSelector);
// Wait for all flash messages to disappear
$I->waitForText('Marked not affected files', 10, self::$alertContainerSelector);
$I->wait(5);
$I->click('.t3js-modal-close');
}
}
...@@ -619,7 +619,7 @@ class UpgradeController extends AbstractController ...@@ -619,7 +619,7 @@ class UpgradeController extends AbstractController
*/ */
public function extensionScannerMarkFullyScannedRestFilesAction(ServerRequestInterface $request): ResponseInterface public function extensionScannerMarkFullyScannedRestFilesAction(ServerRequestInterface $request): ResponseInterface
{ {
$foundRestFileHashes = (array)$request->getParsedBody()['install']['hashes']; $foundRestFileHashes = (array)($request->getParsedBody()['install']['hashes'] ?? []);
// First un-mark files marked as scanned-ok // First un-mark files marked as scanned-ok
$registry = new Registry(); $registry = new Registry();
$registry->removeAllByNamespace('extensionScannerNotAffected'); $registry->removeAllByNamespace('extensionScannerNotAffected');
......
...@@ -51,7 +51,7 @@ class PropertyProtectedMatcher extends AbstractCoreMatcher ...@@ -51,7 +51,7 @@ class PropertyProtectedMatcher extends AbstractCoreMatcher
&& !$this->isLineIgnored($node) && !$this->isLineIgnored($node)
&& $node instanceof PropertyFetch && $node instanceof PropertyFetch
&& $node->name instanceof Identifier && $node->name instanceof Identifier
&& $node->var->name !== 'this' && ($node->var->name ?? '') !== 'this'
&& array_key_exists($node->name->name, $this->flatMatcherDefinitions) && array_key_exists($node->name->name, $this->flatMatcherDefinitions)
) { ) {
$match = [ $match = [
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</button> </button>
</f:else> </f:else>
</f:if> </f:if>
<a role="button" data-bs-toggle="collapse" data-bs-parent="#accordion" href="#collapse{id}" aria-expanded="true" aria-controls="collapse{id}" class="collapsed"> <a role="button" data-bs-toggle="collapse" href="#collapse{id}" aria-expanded="true" aria-controls="collapse{id}" class="collapsed">
<span class="caret"></span> <span class="caret"></span>
<strong>{fileArray.headline}</strong> <strong>{fileArray.headline}</strong>
</a> </a>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<a href="{fileArray.url.documentation}" target="_blank" rel="noreferrer" class="nowrap"><core:icon identifier="actions-window-open" /> Open rendered version</a> <a href="{fileArray.url.documentation}" target="_blank" rel="noreferrer" class="nowrap"><core:icon identifier="actions-window-open" /> Open rendered version</a>
</f:if> </f:if>
</div> </div>
<pre><f:format.raw>{fileArray.parsedContent}</f:format.raw></pre> <pre class="panel-body"><f:format.raw>{fileArray.parsedContent}</f:format.raw></pre>
</div> </div>
</div> </div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment