e89075aaa4af8d63be20ae91ef7f4c8aad713d06
[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 TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Admin;
18
19 /**
20 * Tests for the "Install list view" of the extension manager
21 */
22 class InstalledExtensionsCest
23 {
24 /**
25 * @param Admin $I
26 */
27 public function _before(Admin $I)
28 {
29 $I->useExistingSession();
30 // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
31 $I->switchToIFrame('contentIframe');
32 $I->waitForText('Web Content Management System');
33 $I->switchToIFrame();
34
35 $I->click('Extensions', '#menu');
36 $I->switchToIFrame('contentIframe');
37 $I->waitForElementVisible('#typo3-extension-list');
38 }
39
40 /**
41 * @param Admin $I
42 */
43 public function checkSearchFiltersList(Admin $I)
44 {
45 $I->canSeeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
46
47 // Fill extension search field
48 $I->fillField('Tx_Extensionmanager_extensionkey', 'cshmanual');
49
50 // see 2 rows. 1 for the header and one for the result
51 $I->canSeeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', 1);
52
53 // Look for extension key
54 $I->canSee('cshmanual', '#typo3-extension-list tbody tr[role="row"] td');
55
56 // unset the filter
57 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 1);
58 $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
59
60 $I->canSeeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
61 }
62
63 /**
64 * @param Admin $I
65 */
66 public function checkIfUploadFormAppears(Admin $I)
67 {
68 $I->cantSeeElement('.module-body .uploadForm');
69 $I->click('a[title="Upload Extension .t3x/.zip"]', '.module-docheader');
70 $I->seeElement('.module-body .uploadForm');
71 }
72
73 /**
74 * @param Admin $I
75 * @return Admin
76 */
77 public function checkIfInstallingAnExtensionWithBackendModuleAddsTheModuleToTheModuleMenu(Admin $I)
78 {
79 $I->switchToIFrame();
80 $I->canSeeElement('.modulemenu-item-link');
81 $I->cantSeeElement('#web_RecyclerRecycler');
82
83 $I->switchToIFrame('contentIframe');
84 $I->fillField('Tx_Extensionmanager_extensionkey', 'recycler');
85 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
86 $I->click('a[data-original-title="Activate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
87
88 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 1);
89 $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
90
91 $I->switchToIFrame();
92 $I->canSeeElement('#web_RecyclerRecycler');
93
94 return $I;
95 }
96
97 /**
98 * @depends checkIfInstallingAnExtensionWithBackendModuleAddsTheModuleToTheModuleMenu
99 * @param Admin $I
100 */
101 public function checkIfUninstallingAnExtensionWithBackendModuleRemovesTheModuleFromTheModuleMenu(Admin $I)
102 {
103 $I->switchToIFrame();
104 $I->canSeeElement('#web_RecyclerRecycler');
105
106 $I->switchToIFrame('contentIframe');
107 $I->fillField('Tx_Extensionmanager_extensionkey', 'recycler');
108 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
109 $I->click('a[data-original-title="Deactivate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
110
111 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 1);
112 $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
113
114 $I->switchToIFrame();
115 $I->cantSeeElement('#web_RecyclerRecycler');
116 }
117 }