[TASK] Stabilize acceptance tests
[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\TestingFramework\Core\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 // A sub-element of web module is shown
38 $I->waitForElementVisible('#web .modulemenu-group-container .modulemenu-item');
39 $I->seeElement('#web .modulemenu-group-container .modulemenu-item');
40
41 // Collapse web module and verify sub elements are hidden
42 $I->wantTo('collapse the menu element');
43 $I->waitForElementVisible('#web .modulemenu-group-header');
44 $I->click('#web .modulemenu-group-header');
45 $I->waitForElementNotVisible('#web .modulemenu-group-container .modulemenu-item');
46 $I->dontSeeElement('#web .modulemenu-group-container .modulemenu-item');
47
48 // Expand again and verify sub elements are shown
49 $I->wantTo('expand the menu element again');
50 $I->click('#web .modulemenu-group-header');
51 $I->waitForElementVisible('#web .modulemenu-group-container .modulemenu-item');
52 $I->seeElement('#web .modulemenu-group-container .modulemenu-item');
53 }
54
55 /**
56 * @param Admin $I
57 */
58 public function selectingAModuleDoesHighlightIt(Admin $I)
59 {
60 $I->seeNumberOfElements('#web .modulemenu-item-link', [2, 20]);
61
62 $I->wantTo('check that the second element has no "active" class\'');
63 $I->cantSeeElement('#web #web_list.active');
64 $I->click('#web #web_list .modulemenu-item-link');
65
66 $I->wantTo('see that the second element has an "active" class');
67 $I->canSeeElement('#web #web_list.active');
68 }
69 }