[TASK] Improve unstable language tests 32/51832/4
authorJoerg Kummer <service@enobe.de>
Fri, 24 Feb 2017 13:58:48 +0000 (14:58 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 26 Feb 2017 18:54:29 +0000 (19:54 +0100)
The notification js object gets "duration" as additional default value.
This can be increased for acceptance tests to ensure
notifications don't vanish before they are tested.
Activate two ac tests again that were disabled for that reason.

Resolves: #79963
Releases: master
Change-Id: Ib7bf046e7de1999fc693e08eeefc7d4c420bddae
Reviewed-on: https://review.typo3.org/51832
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Kummer <service@enobe.de>
Tested-by: Joerg Kummer <service@enobe.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Resources/Public/JavaScript/Notification.js
typo3/sysext/core/Tests/Acceptance/Backend/Language/LanguageCest.php

index 4827e0d..23f7655 100644 (file)
@@ -41,7 +41,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) {
        /**
         * The main Notification object
         *
-        * @type {{NOTICE: number, INFO: number, OK: number, WARNING: number, ERROR: number, messageContainer: null}}
+        * @type {{NOTICE: number, INFO: number, OK: number, WARNING: number, ERROR: number, messageContainer: null, duration: number}}
         * @exports TYPO3/CMS/Backend/Notification
         */
        var Notification = {
@@ -50,7 +50,8 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) {
                OK: 0,
                WARNING: 1,
                ERROR: 2,
-               messageContainer: null
+               messageContainer: null,
+               duration: 5
        };
 
        /**
@@ -158,7 +159,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) {
                                icon = 'info';
                }
 
-               duration = (typeof duration === 'undefined') ? 5 : parseFloat(duration);
+               duration = (typeof duration === 'undefined') ? Notification.duration : parseFloat(duration);
 
                if (Notification.messageContainer === null) {
                        Notification.messageContainer = $('<div id="alert-container"></div>').appendTo('body');
index 8f47e8a..7adf1e5 100644 (file)
@@ -36,6 +36,9 @@ class LanguageCest
         $I->see('Languages');
         $I->click('Languages');
 
+        // Increase duration for notification viewing, avoids vanish before the message is tested
+        $I->executeJS('TYPO3.Notification.duration = 100;');
+
         // switch to content iframe
         $I->switchToIFrame('list_frame');
     }
@@ -78,10 +81,8 @@ class LanguageCest
      */
     public function activateAndDeactivateALanguage(Admin $I)
     {
-        //@todo: Fix this test
-        $this->skipUnstable();
-
         $I->wantTo('Install a language');
+
         $I->seeElement('#language-da');
         $I->seeElement('#language-da.disabled');
         $I->click('#language-da td a.activateLanguageLink');
@@ -101,9 +102,6 @@ class LanguageCest
      */
     public function downloadALanguage(Admin $I)
     {
-        //@todo: Fix this test
-        $this->skipUnstable();
-
         $I->wantTo('Download a language with no selection and see error message');
 
         $I->click('a[data-action="updateActiveLanguages"]');
@@ -172,12 +170,4 @@ class LanguageCest
         // switch to content iframe
         $I->switchToIFrame('list_frame');
     }
-
-   /**
-    * @throws \PHPUnit_Framework_SkippedTestError
-    */
-    protected function skipUnstable()
-    {
-        throw new \PHPUnit_Framework_SkippedTestError('Test unstable, skipped for now.');
-    }
 }