[BUGFIX] Stabilize Language Acceptance tests 39/54639/2
authorMathias Schreiber <mathias.schreiber@typo3.org>
Mon, 13 Nov 2017 17:57:01 +0000 (18:57 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 14 Nov 2017 18:33:34 +0000 (19:33 +0100)
Stabilize the acceptance tests to activate and deactivate a language by
checking only for the alerts instead of the enabled/disabled rows.

Additionally make the download a language test fail immediately if the
language is enabled.

Resolves: #82972
Releases: master, 8.7
Change-Id: Ib380b464a24188dbbee37296ddda0f0bb5c44f5e
Reviewed-on: https://review.typo3.org/54639
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/Acceptance/Backend/Language/LanguageCest.php

index 608cc5e..b2b40ab 100644 (file)
@@ -77,18 +77,16 @@ class LanguageCest
      */
     public function activateAndDeactivateALanguage(Admin $I)
     {
-        $I->wantTo('Install a language');
-
-        $I->seeElement('#language-pt_BR');
+        $I->wantTo('Activate a language');
         $I->seeElement('#language-pt_BR.disabled');
-        $I->click('#language-pt_BR td a.activateLanguageLink');
-        $I->seeElement('#language-pt_BR.enabled');
 
+        $I->click('#language-pt_BR td a.activateLanguageLink');
         $this->seeAlert($I, 'Success', 'Language was successfully activated.');
 
-        $I->click('#language-pt_BR td a.deactivateLanguageLink');
-        $I->seeElement('#language-pt_BR.disabled');
+        $I->wantTo('Deactivate a language');
+        $I->seeElement('#language-pt_BR.enabled');
 
+        $I->click('#language-pt_BR td a.deactivateLanguageLink');
         $this->seeAlert($I, 'Success', 'Language was successfully deactivated.');
     }
 
@@ -98,6 +96,7 @@ class LanguageCest
     public function downloadALanguage(Admin $I)
     {
         $I->wantTo('Download a language with no selection and see error message');
+        $I->seeElement('#language-pt_BR.disabled');
 
         $I->click('a[data-action="updateActiveLanguages"]');
         $this->seeAlert($I, 'Error', 'No language activated. Please activate at least one language.');
@@ -105,8 +104,6 @@ class LanguageCest
         // Download only a single translation for a specific extension for performance reasons
         $I->wantTo('Download a single translation for a selected language');
 
-        $I->seeElement('#language-pt_BR');
-        $I->seeElement('#language-pt_BR.disabled');
         $I->click('#language-pt_BR td a.activateLanguageLink');
 
         $I->selectOption('.t3-js-jumpMenuBox', 'Translation Overview');
@@ -157,7 +154,7 @@ class LanguageCest
         $I->switchToIFrame();
 
         $I->wait(1);
-        $I->waitForElement('//div[contains(@role, "alert")]', 2);
+        $I->waitForElement('//div[contains(@role, "alert")]', 10);
         $I->see($alertTitle);
         $I->see($alertMessage);