diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/General/ModuleMenuCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/General/ModuleMenuCest.php new file mode 100644 index 0000000000000000000000000000000000000000..ab6d3a2f184fb1238055bd0786f4ab709b5fa36c --- /dev/null +++ b/typo3/sysext/core/Tests/Acceptance/Backend/General/ModuleMenuCest.php @@ -0,0 +1,66 @@ +<?php +namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\General; + +/* + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ + +use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Admin; + +/** + * Module Menu tests + */ +class ModuleMenuCest +{ + /** + * @param Admin $I + */ + public function _before(Admin $I) + { + $I->useExistingSession(); + } + + /** + * @param Admin $I + */ + public function checkIfModuleMenuIsCollapsible(Admin $I) + { + foreach (['#web', '#system'] as $moduleGroupId) { + $I->seeElement($moduleGroupId . ' .typo3-module-menu-group-container .typo3-module-menu-item'); + + $I->wantTo('collapse the menu element'); + $I->click($moduleGroupId . ' .typo3-module-menu-group-header'); + + $I->waitForElementNotVisible($moduleGroupId . ' .typo3-module-menu-group-container .typo3-module-menu-item'); + + $I->wantTo('expand the menu element again'); + $I->click($moduleGroupId . ' .typo3-module-menu-group-header'); + + $I->seeElement($moduleGroupId . ' .typo3-module-menu-group-container .typo3-module-menu-item'); + } + } + + /** + * @param Admin $I + */ + public function selectingAModuleDoesHighlightIt(Admin $I) + { + $I->seeNumberOfElements('#web .typo3-module-menu-item-link', [2,20]); + + $I->wantTo('check that the second element has no "active" class\''); + $I->cantSeeElement('#web #web_list.active'); + $I->click('#web #web_list .typo3-module-menu-item-link'); + + $I->wantTo('see that the second element has an "active" class'); + $I->canSeeElement('#web #web_list.active'); + } +} diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/Menu/ModuleMenuSliderCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/Menu/ModuleMenuSliderCest.php deleted file mode 100644 index 2c11d1e7852b7c2b3c57e1453b56a6cad8e59c46..0000000000000000000000000000000000000000 --- a/typo3/sysext/core/Tests/Acceptance/Backend/Menu/ModuleMenuSliderCest.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Menu; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Kasper; - -/** - * Acceptance test - */ -class ModuleMenuSliderCest -{ - public function _before(Kasper $I) - { - $I->loginAsAdmin(); - } - - public function _after(Kasper $I) - { - $I->logout(); - } - - // tests - public function tryToTest(Kasper $I) - { - $ids = ['#web', '#tools', '#system']; - $sees = ['Page', 'Extensions']; - - $menuItems = [ - ['mainId' => '#web', 'menuItem' => 'Page'], - ['mainId' => '#tools', 'menuItem' => 'Extensions'], - ['mainId' => '#system', 'menuItem' => 'Log'] - ]; - - $I->wantTo('check the slider in the module menu'); - - foreach ($menuItems as $menuItem) { - $id = $menuItem['mainId']; - $menuItem = $menuItem['menuItem']; - - $I->waitForElement($id); - - // close the item - $classString = $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) use ($id) { - return $webdriver->findElement(\WebDriverBy::cssSelector($id))->getAttribute('class'); - }); - - if (strpos($classString, 'expanded') !== false) { - $I->click($id . ' > div'); - $I->wait(2); // the animation is so fast - } - - $I->dontSee($menuItem); - - // now we expand it - $I->click($id . ' > div'); - - // and wait a short moment - $I->waitForText($menuItem); - } - } -}