‪TYPO3CMS  ‪main
UpgradeCest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Codeception\Attribute\Env;
23 
24 final class ‪UpgradeCest extends ‪AbstractCest
25 {
26  public function ‪_before(‪ApplicationTester $I): void
27  {
28  parent::_before($I);
29  $this->‪logIntoInstallTool($I);
30  $I->click('Upgrade');
31  $I->see('Upgrade', 'h1');
32  }
33 
34  #[Env('classic')]
35  public function ‪seeUpgradeCore(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
36  {
37  $I->click('Update Core…');
38  $modalDialog->‪canSeeDialog();
39 
40  $I->amGoingTo('open the core updater');
41  $I->see('TYPO3 CMS core to its latest minor release');
42  $I->click('.t3js-modal-close');
43  }
44 
45  public function ‪seeViewUpgradeDocumentation(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
46  {
47  $versionPanel = '#version-2 .t3js-changelog-list > div:first-child';
48 
49  $I->click('View Upgrade Documentation…');
50  $modalDialog->‪canSeeDialog();
51 
52  $I->amGoingTo('open the view upgrade documentation');
53  $I->see('View Upgrade Documentation', ‪ModalDialog::$openedModalSelector);
54 
55  $I->amGoingTo('mark an item as read');
56  // pick 2nd named version (e.g. `12.4`), current dev versions might be empty (e.g. `13.0` and `12.4.x`)
57  $I->click('#heading-2 > h2:nth-child(1) > a:nth-child(1) > strong:nth-child(2)');
58  $I->waitForElement('#version-2', 5, ‪ModalDialog::$openedModalSelector);
59 
60  $textCurrentFirstPanelHeading = $I->grabTextFrom($versionPanel . ' .panel-heading');
61 
62  $I->click($versionPanel . ' a[data-bs-toggle="collapse"]');
63  $I->click($versionPanel . ' .t3js-upgradeDocs-markRead');
64 
65  $I->dontSee($textCurrentFirstPanelHeading, '#version-2');
66 
67  $I->amGoingTo('mark an item as unread');
68  $I->executeJS('document.querySelector(".t3js-modal-body").scrollTop = 100000;');
69  $I->click('#heading-read');
70  $I->waitForElement('#collapseRead', 5, ‪ModalDialog::$openedModalSelector);
71  $I->see($textCurrentFirstPanelHeading, '#collapseRead');
72  $I->click('#collapseRead .t3js-changelog-list > div:first-child .t3js-upgradeDocs-unmarkRead');
73  $I->see($textCurrentFirstPanelHeading, '#version-2');
74 
75  $I->click('.t3js-modal-close');
76  }
77 
78  public function ‪seeCheckTca(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
79  {
80  $I->click('Check TCA…');
81  $modalDialog->‪canSeeDialog();
82  $I->see('No TCA changes in ext_tables.php files.', ‪ModalDialog::$openedModalSelector);
83 
84  $I->click('.t3js-modal-close');
85  }
86 
87  public function ‪seeCheckForBrokenExtensions(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
88  {
89  $I->wait(1);
90  $I->click('Check Extension Compatibility…');
91  $modalDialog->‪canSeeDialog();
92  $I->see('ext_localconf.php of all loaded extensions successfully loaded', ‪ModalDialog::$openedModalSelector);
93  $I->see('ext_tables.php of all loaded extensions successfully loaded', ‪ModalDialog::$openedModalSelector);
94 
95  $I->amGoingTo('trigger "check extensions"');
96  $I->click('Check extensions', ‪ModalDialog::$openedModalButtonContainerSelector);
97  $I->wait(1);
98  $I->waitForText('ext_localconf.php of all loaded extensions successfully loaded');
99  $I->see('ext_localconf.php of all loaded extensions successfully loaded');
100  $I->waitForText('ext_tables.php of all loaded extensions successfully loaded');
101  $I->see('ext_tables.php of all loaded extensions successfully loaded');
102 
103  $I->click('.t3js-modal-close');
104  }
105 
106  public function ‪seeCheckTcaMigrations(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
107  {
108  $I->click('Check TCA Migrations…');
109  $modalDialog->‪canSeeDialog();
110  $I->see('Checks whether the current TCA needs migrations and displays the new migration paths which need to be adjusted manually', ‪ModalDialog::$openedModalSelector);
111 
112  $I->click('.t3js-modal-close');
113  }
114 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalSelector
‪static string $openedModalSelector
Definition: ModalDialog.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeUpgradeCore
‪seeUpgradeCore(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalButtonContainerSelector
‪static string $openedModalButtonContainerSelector
Definition: ModalDialog.php:37
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\_before
‪_before(ApplicationTester $I)
Definition: UpgradeCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\AbstractCest\logIntoInstallTool
‪logIntoInstallTool(ApplicationTester $I)
Definition: AbstractCest.php:57
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeViewUpgradeDocumentation
‪seeViewUpgradeDocumentation(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:45
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool
Definition: AbstractCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeCheckTca
‪seeCheckTca(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:78
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest
Definition: UpgradeCest.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\AbstractCest
Definition: AbstractCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeCheckTcaMigrations
‪seeCheckTcaMigrations(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:106
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:68
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeCheckForBrokenExtensions
‪seeCheckForBrokenExtensions(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:87
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24