From d0c809165c44166da9188a9c5f498549c61716ba Mon Sep 17 00:00:00 2001 From: Joerg Kummer <service@enobe.de> Date: Fri, 24 Feb 2017 14:58:48 +0100 Subject: [PATCH] [TASK] Improve unstable language tests 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> --- .../Public/JavaScript/Notification.js | 7 ++++--- .../Backend/Language/LanguageCest.php | 18 ++++-------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Notification.js b/typo3/sysext/backend/Resources/Public/JavaScript/Notification.js index 4827e0da41ef..23f765597e55 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/Notification.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/Notification.js @@ -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'); diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/Language/LanguageCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/Language/LanguageCest.php index 8f47e8a1056c..7adf1e502b0e 100644 --- a/typo3/sysext/core/Tests/Acceptance/Backend/Language/LanguageCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Backend/Language/LanguageCest.php @@ -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.'); - } } -- GitLab