Skip to content
Snippets Groups Projects
Commit d0c80916 authored by Joerg Kummer's avatar Joerg Kummer Committed by Christian Kuhn
Browse files

[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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarJoerg Kummer <service@enobe.de>
Tested-by: default avatarJoerg Kummer <service@enobe.de>
Reviewed-by: default avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: default avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent f26fb920
Branches
Tags
No related merge requests found
...@@ -41,7 +41,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) { ...@@ -41,7 +41,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) {
/** /**
* The main Notification object * 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 * @exports TYPO3/CMS/Backend/Notification
*/ */
var Notification = { var Notification = {
...@@ -50,7 +50,8 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) { ...@@ -50,7 +50,8 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) {
OK: 0, OK: 0,
WARNING: 1, WARNING: 1,
ERROR: 2, ERROR: 2,
messageContainer: null messageContainer: null,
duration: 5
}; };
/** /**
...@@ -158,7 +159,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) { ...@@ -158,7 +159,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Severity'], function ($) {
icon = 'info'; icon = 'info';
} }
duration = (typeof duration === 'undefined') ? 5 : parseFloat(duration); duration = (typeof duration === 'undefined') ? Notification.duration : parseFloat(duration);
if (Notification.messageContainer === null) { if (Notification.messageContainer === null) {
Notification.messageContainer = $('<div id="alert-container"></div>').appendTo('body'); Notification.messageContainer = $('<div id="alert-container"></div>').appendTo('body');
......
...@@ -36,6 +36,9 @@ class LanguageCest ...@@ -36,6 +36,9 @@ class LanguageCest
$I->see('Languages'); $I->see('Languages');
$I->click('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 // switch to content iframe
$I->switchToIFrame('list_frame'); $I->switchToIFrame('list_frame');
} }
...@@ -78,10 +81,8 @@ class LanguageCest ...@@ -78,10 +81,8 @@ class LanguageCest
*/ */
public function activateAndDeactivateALanguage(Admin $I) public function activateAndDeactivateALanguage(Admin $I)
{ {
//@todo: Fix this test
$this->skipUnstable();
$I->wantTo('Install a language'); $I->wantTo('Install a language');
$I->seeElement('#language-da'); $I->seeElement('#language-da');
$I->seeElement('#language-da.disabled'); $I->seeElement('#language-da.disabled');
$I->click('#language-da td a.activateLanguageLink'); $I->click('#language-da td a.activateLanguageLink');
...@@ -101,9 +102,6 @@ class LanguageCest ...@@ -101,9 +102,6 @@ class LanguageCest
*/ */
public function downloadALanguage(Admin $I) public function downloadALanguage(Admin $I)
{ {
//@todo: Fix this test
$this->skipUnstable();
$I->wantTo('Download a language with no selection and see error message'); $I->wantTo('Download a language with no selection and see error message');
$I->click('a[data-action="updateActiveLanguages"]'); $I->click('a[data-action="updateActiveLanguages"]');
...@@ -172,12 +170,4 @@ class LanguageCest ...@@ -172,12 +170,4 @@ class LanguageCest
// switch to content iframe // switch to content iframe
$I->switchToIFrame('list_frame'); $I->switchToIFrame('list_frame');
} }
/**
* @throws \PHPUnit_Framework_SkippedTestError
*/
protected function skipUnstable()
{
throw new \PHPUnit_Framework_SkippedTestError('Test unstable, skipped for now.');
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment