ab6d3a2f184fb1238055bd0786f4ab709b5fa36c
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / General / ModuleMenuCest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\General;
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 * Module Menu tests
21 */
22 class ModuleMenuCest
23 {
24 /**
25 * @param Admin $I
26 */
27 public function _before(Admin $I)
28 {
29 $I->useExistingSession();
30 }
31
32 /**
33 * @param Admin $I
34 */
35 public function checkIfModuleMenuIsCollapsible(Admin $I)
36 {
37 foreach (['#web', '#system'] as $moduleGroupId) {
38 $I->seeElement($moduleGroupId . ' .typo3-module-menu-group-container .typo3-module-menu-item');
39
40 $I->wantTo('collapse the menu element');
41 $I->click($moduleGroupId . ' .typo3-module-menu-group-header');
42
43 $I->waitForElementNotVisible($moduleGroupId . ' .typo3-module-menu-group-container .typo3-module-menu-item');
44
45 $I->wantTo('expand the menu element again');
46 $I->click($moduleGroupId . ' .typo3-module-menu-group-header');
47
48 $I->seeElement($moduleGroupId . ' .typo3-module-menu-group-container .typo3-module-menu-item');
49 }
50 }
51
52 /**
53 * @param Admin $I
54 */
55 public function selectingAModuleDoesHighlightIt(Admin $I)
56 {
57 $I->seeNumberOfElements('#web .typo3-module-menu-item-link', [2,20]);
58
59 $I->wantTo('check that the second element has no "active" class\'');
60 $I->cantSeeElement('#web #web_list.active');
61 $I->click('#web #web_list .typo3-module-menu-item-link');
62
63 $I->wantTo('see that the second element has an "active" class');
64 $I->canSeeElement('#web #web_list.active');
65 }
66 }