8f1cfd0a6619993f3d2bb3b6fcba9f90e2fc426f
[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\TestingFramework\Core\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('list_frame');
32 $I->waitForText('Web Content Management System');
33 $I->switchToIFrame();
34
35 $I->click('Extensions', '#menu');
36 $I->switchToIFrame('list_frame');
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', 'backend');
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('backend', '#typo3-extension-list tbody tr[role="row"] td');
55
56 // unset the filter
57 $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 10);
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 */
76 public function checkUninstallingAndInstallingAnExtension(Admin $I)
77 {
78 $I->wantTo('Check if uninstalling and installing an extension with backend module removes and adds the module from the module menu.');
79 $I->amGoingTo('uninstall extension belog');
80 $I->switchToIFrame();
81 $I->canSeeElement('#system_BelogLog');
82
83 $I->switchToIFrame('list_frame');
84 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
85 $I->click('a[data-original-title="Deactivate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
86
87 $I->switchToIFrame();
88 $I->cantSeeElement('#system_BelogLog');
89
90 $I->amGoingTo('install extension belog');
91 $I->switchToIFrame();
92 $I->canSeeElement('.modulemenu-item-link');
93 $I->cantSeeElement('#system_BelogLog');
94
95 $I->switchToIFrame('list_frame');
96 $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
97 $I->click('a[data-original-title="Activate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
98
99 $I->switchToIFrame();
100 $I->canSeeElement('#system_BelogLog');
101 }
102 }