[TASK] Add acceptance test for Template and Sites creation 84/59184/8
authorSteffen Dietrich <steffen_dietrich@gmx.de>
Mon, 17 Dec 2018 16:23:38 +0000 (17:23 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 19 Dec 2018 11:52:49 +0000 (12:52 +0100)
Extends the existing site configuration acceptance test
by adding a default FE ts snipped and verifying FE is
rendered.

Resolves: #87191
Releases: master, 9.5
Change-Id: I369980f2de240db9647550dad73a2923a1aa6371
Reviewed-on: https://review.typo3.org/59184
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Tests/Acceptance/Backend/Site/SiteModuleCest.php

index e75a25c..90fc373 100644 (file)
@@ -29,10 +29,6 @@ class SiteModuleCest
     public function _before(BackendTester $I)
     {
         $I->useExistingSession('admin');
-
-        $I->click('Sites');
-        $I->switchToContentFrame();
-        $I->canSee('Site Configuration', 'h1');
     }
 
     /**
@@ -40,15 +36,19 @@ class SiteModuleCest
      */
     public function createNewRecordIfNoneExist(BackendTester $I)
     {
+        $I->click('Sites');
+        $I->switchToContentFrame();
+        $I->canSee('Site Configuration', 'h1');
+
         $I->amGoingTo('create a new site configuration when none are in the system, yet');
         $I->click('Add new site configuration for this site');
         $I->waitForElementNotVisible('#t3js-ui-block');
         $I->canSee('Create new Site configuration');
-        $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[identifier]")]', 'testIdentifier');
-        $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[base]")]', '/');
+        $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[identifier]")]', 'SitesTestIdentifier');
+        $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[base]")]', 'http://web:8000/typo3temp/var/tests/acceptance/');
         $I->click('Languages');
-        $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[title]")]', 'English');
-        $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[base]")]', 'en/');
+        $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[title]")]', 'Homepage');
+        $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[base]")]', 'http://web:8000/typo3temp/var/tests/acceptance/');
         $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[locale]")]', 'en_US.UTF-8');
 
         $saveButtonLink = '//*/button[@name="_savedok"][1]';
@@ -60,6 +60,57 @@ class SiteModuleCest
 
         $I->waitForElementVisible('table.table-striped');
         $I->canSee('Site Configuration', 'h1');
-        $I->canSee('testIdentifier');
+        $I->canSee('SitesTestIdentifier');
+    }
+
+    /**
+     * Add a default FE ts snipped to the existing site config and verify FE is rendered
+     *
+     * @depends createNewRecordIfNoneExist
+     *
+     * @param BackendTester $I
+     */
+    public function defaultFrontendRendering(BackendTester $I)
+    {
+        $I->amGoingTo('create a default FE typoscript for the created site configuration');
+
+        $I->click('Template');
+        $I->switchToContentFrame();
+        $I->waitForElementVisible('#ts-overview');
+        $I->see('Template tools');
+
+        $I->switchToMainFrame();
+        $I->click('Template');
+        $I->click('.node.identifier-0_1');
+        $I->switchToContentFrame();
+        $I->waitForText('Create new website');
+
+        $I->click("//input[@name='newWebsite']");
+        $I->selectOption('.t3-js-jumpMenuBox', 'Info/Modify');
+        $I->waitForElement('.table-fit');
+        $I->see('Title');
+
+        $I->click('Edit the whole template record');
+        $I->waitForElement('#EditDocumentController');
+        $I->fillField('//input[@data-formengine-input-name="data[sys_template][1][title]"]', 'Default Title');
+        $I->click("//button[@name='_savedok']");
+
+        $I->waitForElementNotVisible('#t3js-ui-block', 30);
+        $I->waitForElement('#EditDocumentController');
+        $I->waitForElementNotVisible('#t3js-ui-block');
+
+        // watch out for new line after each instruction. Anything else doesn't work.
+        $config = 'page = PAGE
+page.shortcutIcon = fileadmin/styleguide/bus_lane.jpg
+page.10 = TEXT
+page.10.value = This is a default text for default rendering without dynamic content creation
+';
+        $I->fillField('//textarea[@data-formengine-input-name="data[sys_template][1][config]"]', $config);
+        $I->click('//button[@name="_savedok"]');
+        $I->waitForElementNotVisible('#t3js-ui-block');
+
+        // Call FE and verify it is properly rendered
+        $I->amOnPage('/');
+        $I->canSee('This is a default text for default rendering without dynamic content creation');
     }
 }