[TASK] Add more acceptance tests for topbar modules 16/47716/6
authordirk_juettner <dirk.juettner@gmail.com>
Thu, 14 Apr 2016 16:09:40 +0000 (18:09 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 15 Apr 2016 21:39:40 +0000 (23:39 +0200)
Resolves: #75631
Releases: master
Change-Id: I4f0bf756a2ddac9defb97749e66d74ffca636af8
Reviewed-on: https://review.typo3.org/47716
Reviewed-by: Dirk Jüttner <dirk.juettner@gmail.com>
Tested-by: Dirk Jüttner <dirk.juettner@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/Acceptance/Backend/Topbar/HelpCest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Acceptance/Backend/Topbar/LogoCest.php [new file with mode: 0644]

diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/Topbar/HelpCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/Topbar/HelpCest.php
new file mode 100644 (file)
index 0000000..7fc4fde
--- /dev/null
@@ -0,0 +1,67 @@
+<?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 help module in the topbar
+ */
+class HelpCest
+{
+    /**
+    * Selector for the module container in the topbar
+    *
+    * @var string
+    */
+    public static $topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-helptoolbaritem';
+
+    /**
+     * @param Admin $I
+     */
+    public function _before(Admin $I)
+    {
+        $I->useExistingSession();
+        $I->switchToIFrame('content');
+        // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
+        $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 seeStyleguideInHelpModule(Admin $I)
+    {
+        $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
+        $I->canSee('Styleguide', self::$topBarModuleSelector);
+        $I->click('Styleguide', self::$topBarModuleSelector);
+        $I->switchToIFrame('content');
+        $I->see('TYPO3 CMS Backend Styleguide', 'h1');
+    }
+}
diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/Topbar/LogoCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/Topbar/LogoCest.php
new file mode 100644 (file)
index 0000000..6655d25
--- /dev/null
@@ -0,0 +1,39 @@
+<?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;
+
+/**
+ * Acceptance test for the TYPO3 logo in the topbar
+ */
+class LogoCest
+{
+    /**
+     * @param Admin $I
+     */
+    public function _before(Admin $I)
+    {
+        $I->useExistingSession();
+    }
+
+    /**
+     * @param Admin $I
+     */
+    public function checkIfTypo3LogoIsLinked(Admin $I)
+    {
+        $I->seeElement('#typo3-topbar .typo3-topbar-site-logo', ['href' => 'https://typo3.org/']);
+    }
+}