398bccdd572647dbbce3b747a410d370f1ffb23e
[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
31 // clear the localstorage to fix problems in phantomJs where the search
32 // sometimes is preserved over multiple sessions
33 $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webDriver) {
34 $webDriver->executeScript('localStorage.clear();');
35 });
36
37 $I->click('Extensions', '#typo3-module-menu');
38 $I->switchToIFrame('contentIframe');
39 $I->waitForElementVisible('#typo3-extension-list');
40 }
41
42 /**
43 * @param Admin $I
44 */
45 public function checkSearchFiltersList(Admin $I)
46 {
47 $I->canSeeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
48
49 // Fill extension search field
50 $I->fillField('Tx_Extensionmanager_extensionkey', 'cshmanual');
51
52 // see 2 rows. 1 for the header and one for the result
53 $I->canSeeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', 1);
54
55 // Look for extension key
56 $I->canSee('cshmanual', '#typo3-extension-list tbody tr[role="row"] td');
57
58 // unset the filter
59 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 1);
60 $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
61
62 $I->canSeeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
63 }
64
65 /**
66 * @param Admin $I
67 */
68 public function checkIfUploadFormAppears(Admin $I)
69 {
70 $I->cantSeeElement('.module-body .uploadForm');
71 $I->click('a[title="Upload Extension .t3x/.zip"]', '.module-docheader');
72 $I->seeElement('.module-body .uploadForm');
73 }
74
75 /**
76 * @param Admin $I
77 * @return Admin
78 */
79 public function checkIfInstallingAnExtensionWithBackendModuleAddsTheModuleToTheModuleMenu(Admin $I)
80 {
81 $I->switchToIFrame();
82 $I->canSeeElement('.typo3-module-menu-item');
83 $I->cantSeeElement('#web_RecyclerRecycler');
84
85 $I->switchToIFrame('contentIframe');
86 $I->fillField('Tx_Extensionmanager_extensionkey', 'recycler');
87 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
88 $I->click('a[data-original-title="Activate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
89
90 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 1);
91 $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
92
93 $I->switchToIFrame();
94 $I->canSeeElement('#web_RecyclerRecycler');
95
96 return $I;
97 }
98
99 /**
100 * @depends checkIfInstallingAnExtensionWithBackendModuleAddsTheModuleToTheModuleMenu
101 * @param Admin $I
102 */
103 public function checkIfUninstallingAnExtensionWithBackendModuleRemovesTheModuleFromTheModuleMenu(Admin $I)
104 {
105 $I->switchToIFrame();
106 $I->canSeeElement('#web_RecyclerRecycler');
107
108 $I->switchToIFrame('contentIframe');
109 $I->fillField('Tx_Extensionmanager_extensionkey', 'recycler');
110 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
111 $I->click('a[data-original-title="Deactivate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="recycler"]');
112
113 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 1);
114 $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
115
116 $I->switchToIFrame();
117 $I->cantSeeElement('#web_RecyclerRecycler');
118 }
119 }