‪TYPO3CMS  11.5
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\Scenario;
23 
25 {
26  public static string ‪$alertContainerSelector = '#alert-container';
27 
28  public function ‪_before(‪ApplicationTester $I): void
29  {
30  parent::_before($I);
31  $this->‪logIntoInstallTool($I);
32  $I->click('Upgrade');
33  $I->see('Upgrade', 'h1');
34  }
35 
40  public function ‪seeUpgradeCore(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
41  {
42  $I->click('Update Core');
43  $modalDialog->‪canSeeDialog();
44 
45  $I->amGoingTo('open the core updater');
46  $I->see('TYPO3 CMS core to its latest minor release');
47  $I->click('.t3js-modal-close');
48  }
49 
53  public function ‪seeUpgradeWizard(‪ApplicationTester $I, ‪ModalDialog $modalDialog, Scenario $scenario): void
54  {
55  $I->click('Run Upgrade Wizard');
56  $modalDialog->‪canSeeDialog();
57 
58  $I->amGoingTo('open the upgrade wizard and set charset to utf8');
59  $I->see('Upgrade Wizard', ‪ModalDialog::$openedModalSelector);
60 
61  try {
62  $I->click('Set default charset to utf8', ‪ModalDialog::$openedModalSelector);
63  $charsetChanged = true;
64  } catch (\Facebook\WebDriver\‪Exception\NoSuchElementException $e) {
65  $charsetChanged = false;
66  } catch (\Facebook\WebDriver\‪Exception\ElementNotInteractableException $e) {
67  $charsetChanged = false;
68  }
69 
70  if ($charsetChanged) {
71  $I->waitForText('Default connection database has been set to utf8', 5, ‪ModalDialog::$openedModalSelector);
72  }
73 
74  $isComposerMode = str_contains($scenario->current('env'), 'composer');
75  if ($isComposerMode) {
76  $I->see('Wizards marked as done', ‪ModalDialog::$openedModalSelector);
77  } else {
78  $I->see('No wizards are marked as done', ‪ModalDialog::$openedModalSelector);
79  }
80  $I->click('.t3js-modal-close');
81  }
82 
86  public function ‪seeViewUpgradeDocumentation(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
87  {
88  $versionPanel = '#version-1 .t3js-changelog-list > div:first-child';
89 
90  $I->click('View Upgrade Documentation');
91  $modalDialog->‪canSeeDialog();
92 
93  $I->amGoingTo('open the view upgrade documentation');
94  $I->see('View Upgrade Documentation', ‪ModalDialog::$openedModalSelector);
95 
96  $I->amGoingTo('mark an item as read');
97  // pick first named version, master might be empty
98  $I->click('#heading-1 > h2:nth-child(1) > a:nth-child(1) > strong:nth-child(2)');
99  $I->waitForElement('#version-1', 5, ‪ModalDialog::$openedModalSelector);
100 
101  $textCurrentFirstPanelHeading = $I->grabTextFrom($versionPanel . ' .panel-heading');
102 
103  $I->click($versionPanel . ' a[data-bs-toggle="collapse"]');
104  $I->click($versionPanel . ' .t3js-upgradeDocs-markRead');
105 
106  $I->dontSee($textCurrentFirstPanelHeading, '#version-1');
107 
108  $I->amGoingTo('mark an item as unread');
109  $I->executeJS('document.querySelector(".t3js-modal-body").scrollTop = 100000;');
110  $I->click('#heading-read');
111  $I->waitForElement('#collapseRead', 5, ‪ModalDialog::$openedModalSelector);
112  $I->see($textCurrentFirstPanelHeading, '#collapseRead');
113  $I->click('#collapseRead .t3js-changelog-list > div:first-child .t3js-upgradeDocs-unmarkRead');
114  $I->see($textCurrentFirstPanelHeading, '#version-1');
115 
116  $I->click('.t3js-modal-close');
117  }
118 
119  public function ‪seeCheckTca(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
120  {
121  $I->click('Check TCA');
122  $modalDialog->‪canSeeDialog();
123  $I->see('No TCA changes in ext_tables.php files.', ‪ModalDialog::$openedModalSelector);
124 
125  $I->click('.t3js-modal-close');
126  }
127 
129  {
130  $I->wait(1);
131  $I->click('Check Extension Compatibility');
132  $modalDialog->‪canSeeDialog();
133  $I->see('ext_localconf.php of all loaded extensions successfully loaded', ‪ModalDialog::$openedModalSelector);
134  $I->see('ext_tables.php of all loaded extensions successfully loaded', ‪ModalDialog::$openedModalSelector);
135 
136  $I->amGoingTo('trigger "check extensions"');
137  $I->click('Check extensions', ‪ModalDialog::$openedModalButtonContainerSelector);
138  $I->see('ext_localconf.php of all loaded extensions successfully loaded', ‪ModalDialog::$openedModalSelector);
139  $I->see('ext_tables.php of all loaded extensions successfully loaded', ‪ModalDialog::$openedModalSelector);
140 
141  $I->click('.t3js-modal-close');
142  }
143 
144  public function ‪seeCheckTcaMigrations(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
145  {
146  $I->click('Check TCA Migrations');
147  $modalDialog->‪canSeeDialog();
148  $I->see('Checks whether the current TCA needs migrations and displays the new migration paths which need to be adjusted manually', ‪ModalDialog::$openedModalSelector);
149 
150  $I->click('.t3js-modal-close');
151  }
152 
153  public function ‪seeScanExtensionFiles(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
154  {
155  $buttonText = 'Rescan';
156 
157  $I->click('Scan Extension Files');
158  $modalDialog->‪canSeeDialog();
159  $I->click('Extension: styleguide', ‪ModalDialog::$openedModalSelector);
160  $I->waitForText($buttonText, 30, ‪ModalDialog::$openedModalSelector);
161 
162  // Trigger scan for single extension
163  $I->click($buttonText);
164  $I->waitForText($buttonText, 30, ‪ModalDialog::$openedModalSelector);
165 
166  // Scan all available extensions
167  $I->click('Scan all');
168  $I->waitForElement('.t3js-extensionscan-finished', 20, ‪ModalDialog::$openedModalSelector);
169 
170  // Wait for all flash messages to disappear
171  $I->waitForText('Marked not affected files', 10, self::$alertContainerSelector);
172  $I->wait(5);
173 
174  $I->click('.t3js-modal-close');
175  }
176 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalSelector
‪static string $openedModalSelector
Definition: ModalDialog.php:33
‪TYPO3\CMS\Core\Exception
Definition: Exception.php:21
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeUpgradeCore
‪seeUpgradeCore(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalButtonContainerSelector
‪static string $openedModalButtonContainerSelector
Definition: ModalDialog.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\_before
‪_before(ApplicationTester $I)
Definition: UpgradeCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\AbstractCest\logIntoInstallTool
‪logIntoInstallTool(ApplicationTester $I)
Definition: AbstractCest.php:58
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeUpgradeWizard
‪seeUpgradeWizard(ApplicationTester $I, ModalDialog $modalDialog, Scenario $scenario)
Definition: UpgradeCest.php:53
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeViewUpgradeDocumentation
‪seeViewUpgradeDocumentation(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:86
‪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:119
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest
Definition: UpgradeCest.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeScanExtensionFiles
‪seeScanExtensionFiles(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:153
‪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:144
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:73
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\$alertContainerSelector
‪static string $alertContainerSelector
Definition: UpgradeCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\InstallTool\UpgradeCest\seeCheckForBrokenExtensions
‪seeCheckForBrokenExtensions(ApplicationTester $I, ModalDialog $modalDialog)
Definition: UpgradeCest.php:128
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:27