[TASK] Stabilize acceptance tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / Extensionmanager / InstalledExtensionsCest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Extensionmanager;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use Codeception\Util\Locator;
18 use TYPO3\TestingFramework\Core\Acceptance\Step\Backend\Admin;
19
20 /**
21 * Tests for the "Install list view" of the extension manager
22 */
23 class InstalledExtensionsCest
24 {
25 /**
26 * @param Admin $I
27 */
28 public function _before(Admin $I)
29 {
30 $I->useExistingSession();
31
32 $I->click('Extensions', '#menu');
33 $I->switchToContentFrame();
34 $I->waitForElementVisible('#typo3-extension-list');
35 }
36
37 /**
38 * @param Admin $I
39 */
40 public function checkSearchFiltersList(Admin $I)
41 {
42 $I->seeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
43
44 // Fill extension search field
45 $I->fillField('Tx_Extensionmanager_extensionkey', 'backend');
46 $I->waitForElementNotVisible(Locator::contains('#typo3-extension-list', 'core'));
47
48 // see 2 rows. 1 for the header and one for the result
49 $I->seeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', 3);
50
51 // Look for extension key
52 $I->see('backend', '#typo3-extension-list tbody tr[role="row"] td');
53
54 // unset the filter
55 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 10);
56 $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
57 $I->wait(1);
58 $I->seeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
59 }
60
61 /**
62 * @param Admin $I
63 */
64 public function checkIfUploadFormAppears(Admin $I)
65 {
66 $I->cantSeeElement('.module-body .uploadForm');
67 $I->click('a[title="Upload Extension .t3x/.zip"]', '.module-docheader');
68 $I->seeElement('.module-body .uploadForm');
69 }
70
71 /**
72 * @param Admin $I
73 */
74 public function checkUninstallingAndInstallingAnExtension(Admin $I)
75 {
76 $I->wantTo('Check if uninstalling and installing an extension with backend module removes and adds the module from the module menu.');
77 $I->amGoingTo('uninstall extension belog');
78 $I->switchToMainFrame();
79 $I->seeElement('#system_BelogLog');
80
81 $I->switchToContentFrame();
82 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
83 $I->click('a[data-original-title="Deactivate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
84
85 $I->switchToMainFrame();
86 $I->cantSeeElement('#system_BelogLog');
87
88 $I->amGoingTo('install extension belog');
89 $I->switchToMainFrame();
90 $I->seeElement('.modulemenu-item-link');
91 $I->cantSeeElement('#system_BelogLog');
92
93 $I->switchToContentFrame();
94 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
95 $I->click('a[data-original-title="Activate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
96
97 $I->switchToMainFrame();
98 $I->seeElement('#system_BelogLog');
99 }
100 }