1c763fed3de8a839fb855dee46f535600e03e0e3
[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 // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
31 $I->switchToIFrame('contentIframe');
32 $I->waitForText('Web>Page module');
33 $I->switchToIFrame();
34 }
35
36 /**
37 * @param Admin $I
38 */
39 public function checkIfModuleMenuIsCollapsible(Admin $I)
40 {
41 // A sub-element of web module is show
42 $I->waitForElementVisible('#web .typo3-module-menu-group-container .typo3-module-menu-item');
43 $I->seeElement('#web .typo3-module-menu-group-container .typo3-module-menu-item');
44
45 // Collapse web module and verify sub elements are hidden
46 $I->wantTo('collapse the menu element');
47 $I->waitForElementVisible('#web .typo3-module-menu-group-header');
48 $I->click('#web .typo3-module-menu-group-header');
49 $I->waitForElementNotVisible('#web .typo3-module-menu-group-container .typo3-module-menu-item');
50 $I->dontSeeElement('#web .typo3-module-menu-group-container .typo3-module-menu-item');
51
52 // Expand again and verify sub elements are shown
53 $I->wantTo('expand the menu element again');
54 $I->click('#web .typo3-module-menu-group-header');
55 $I->waitForElementVisible('#web .typo3-module-menu-group-container .typo3-module-menu-item');
56 $I->seeElement('#web .typo3-module-menu-group-container .typo3-module-menu-item');
57 }
58
59 /**
60 * @param Admin $I
61 */
62 public function selectingAModuleDoesHighlightIt(Admin $I)
63 {
64 $I->seeNumberOfElements('#web .typo3-module-menu-item-link', [2, 20]);
65
66 $I->wantTo('check that the second element has no "active" class\'');
67 $I->cantSeeElement('#web #web_list.active');
68 $I->click('#web #web_list .typo3-module-menu-item-link');
69
70 $I->wantTo('see that the second element has an "active" class');
71 $I->canSeeElement('#web #web_list.active');
72 }
73 }