[TASK] Acceptence tests for backend topbar flush caches 15/49815/3
authorJoerg Kummer <service@enobe.de>
Fri, 2 Sep 2016 23:05:23 +0000 (01:05 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 3 Sep 2016 00:08:15 +0000 (02:08 +0200)
Adds acceptence tests for clearcachetoolbaritem in backend topbar

Resolves: #77821
Releases: master
Change-Id: Iccef10a4b065b00c77e69e31904b769b6a332e1a
Reviewed-on: https://review.typo3.org/49815
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Tested-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
typo3/sysext/core/Tests/Acceptance/Backend/Topbar/FlushCest.php [new file with mode: 0644]

diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/Topbar/FlushCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/Topbar/FlushCest.php
new file mode 100644 (file)
index 0000000..f7d52c8
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Topbar;
+
+/*
+ * 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;
+use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\Topbar;
+
+/**
+ * Tests for the flush module in the topbar
+ */
+class FlushCest
+{
+    /**
+     * Selector for the module container in the topbar
+     *
+     * @var string
+     */
+    protected static $topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-clearcachetoolbaritem';
+
+    /**
+     * Selector for the "Flush frontend caches" link
+     *
+     * @var string
+     */
+    protected static $docHeaderFlushFrontendCachesLinkSelector = 'a span[data-identifier="actions-system-cache-clear-impact-low"]';
+
+    /**
+     * Selector for the "Flush all caches" link
+     *
+     * @var string
+     */
+    protected static $docHeaderFlushAllCachesLinkSelector = 'a span[data-identifier="actions-system-cache-clear-impact-high"]';
+
+    /**
+     * @param Admin $I
+     */
+    public function _before(Admin $I)
+    {
+        $I->useExistingSession();
+        // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
+        $I->switchToIFrame('content');
+        $I->waitForText('Web>Page module');
+        $I->switchToIFrame();
+    }
+
+    /**
+     * @param Admin $I
+     * @return Admin
+     */
+    public function canSeeModuleInTopbar(Admin $I)
+    {
+        $I->canSeeElement(self::$topBarModuleSelector);
+
+        return $I;
+    }
+
+    /**
+     * @depends canSeeModuleInTopbar
+     * @param Admin $I
+     */
+    public function seeFlushCachesLinksInClearCacheModule(Admin $I)
+    {
+        $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
+        // Ensure existence of link for flush frontend caches
+        $I->waitForElementVisible(self::$docHeaderFlushFrontendCachesLinkSelector);
+        $I->seeElement(self::$docHeaderFlushFrontendCachesLinkSelector);
+        // Ensure existence of link for flush all caches
+        $I->waitForElementVisible(self::$docHeaderFlushAllCachesLinkSelector);
+        $I->seeElement(self::$docHeaderFlushAllCachesLinkSelector);
+    }
+}