6231d765341931b130a832016b0e517b2eeb72c5
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / Topbar / FlushCest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Topbar;
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 use TYPO3\TestingFramework\Core\Acceptance\Support\Helper\Topbar;
19
20 /**
21 * Tests for the flush module in the topbar
22 */
23 class FlushCest
24 {
25 /**
26 * Selector for the module container in the topbar
27 *
28 * @var string
29 */
30 protected static $topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-clearcachetoolbaritem';
31
32 /**
33 * @param Admin $I
34 */
35 public function _before(Admin $I)
36 {
37 $I->useExistingSession();
38 // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
39 $I->switchToIFrame('list_frame');
40 $I->waitForText('Web Content Management System');
41 $I->switchToIFrame();
42 }
43
44 /**
45 * @param Admin $I
46 * @return Admin
47 */
48 public function canSeeModuleInTopbar(Admin $I)
49 {
50 $I->canSeeElement(self::$topBarModuleSelector);
51
52 return $I;
53 }
54
55 /**
56 * @depends canSeeModuleInTopbar
57 * @param Admin $I
58 */
59 public function seeFlushCachesLinksInClearCacheModule(Admin $I)
60 {
61 $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
62 // Ensure existence of link for flush frontend caches
63 $I->canSee('Flush frontend caches', 'a');
64 // Ensure existence of link for flush all caches
65 $I->canSee('Flush all caches', 'a');
66 }
67 }