‪TYPO3CMS  9.5
SiteModuleCest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
20 
25 {
26 
30  public function ‪_before(‪BackendTester $I)
31  {
32  $I->useExistingSession('admin');
33  }
34 
39  {
40  $I->click('Sites');
41  $I->switchToContentFrame();
42  $I->canSee('Site Configuration', 'h1');
43 
44  try {
45  $I->amGoingTo('delete the auto generated config in order to create one manually');
46  $I->click('Delete site configuration');
47  $modalDialog->canSeeDialog();
48  $modalDialog->clickButtonInDialog('Delete');
49  $I->switchToContentFrame();
50  } catch (\‪Exception $e) {
51  // Don't do anything if there is no site configuration
52  }
53 
54  $I->amGoingTo('create a new site configuration when none are in the system, yet');
55  $I->click('Add new site configuration for this site');
56  $I->waitForElementNotVisible('#t3js-ui-block');
57  $I->canSee('Create new Site configuration');
58  $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[identifier]")]', 'SitesTestIdentifier');
59  $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[base]")]', 'http://web:8000/typo3temp/var/tests/acceptance/');
60  $I->click('Languages');
61  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[title]")]', 'Homepage');
62  $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/');
63  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[locale]")]', 'en_US.UTF-8');
64 
65  $saveButtonLink = '//*/button[@name="_savedok"][1]';
66  $I->waitForElement($saveButtonLink, 30);
67  $I->click($saveButtonLink);
68  $I->waitForElementNotVisible('#t3js-ui-block');
69 
70  $I->click('div.module-docheader .btn.t3js-editform-close');
71 
72  $I->waitForElementVisible('table.table-striped');
73  $I->canSee('Site Configuration', 'h1');
74  $I->canSee('SitesTestIdentifier');
75  }
76 
85  {
86  $I->amGoingTo('create a default FE typoscript for the created site configuration');
87 
88  $I->click('Template');
89  $I->switchToContentFrame();
90  $I->waitForElementVisible('#ts-overview');
91  $I->see('Template tools');
92 
93  $I->switchToMainFrame();
94  $I->click('Template');
95  $I->click('.node.identifier-0_1');
96  $I->switchToContentFrame();
97  $I->waitForText('Create new website');
98 
99  $I->click("//input[@name='newWebsite']");
100  $I->selectOption('.t3-js-jumpMenuBox', 'Info/Modify');
101  $I->waitForElement('.table-fit');
102  $I->see('Title');
103 
104  $I->click('Edit the whole template record');
105  $I->waitForElement('#EditDocumentController');
106  $I->fillField('//input[@data-formengine-input-name="data[sys_template][1][title]"]', 'Default Title');
107  $I->click("//button[@name='_savedok']");
108 
109  $I->waitForElementNotVisible('#t3js-ui-block', 30);
110  $I->waitForElement('#EditDocumentController');
111  $I->waitForElementNotVisible('#t3js-ui-block');
112 
113  // watch out for new line after each instruction. Anything else doesn't work.
114  $config = 'page = PAGE
115 page.shortcutIcon = fileadmin/styleguide/bus_lane.jpg
116 page.10 = TEXT
117 page.10.value = This is a default text for default rendering without dynamic content creation
118 ';
119  $I->fillField('//textarea[@data-formengine-input-name="data[sys_template][1][config]"]', $config);
120  $I->click('//button[@name="_savedok"]');
121  $I->waitForElementNotVisible('#t3js-ui-block');
122 
123  // Call FE and verify it is properly rendered
124  $I->amOnPage('/');
125  $I->canSee('This is a default text for default rendering without dynamic content creation');
126  }
127 }
‪TYPO3\CMS\Core\Exception
Definition: Exception.php:21
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Redirect\SiteModuleCest\_before
‪_before(BackendTester $I)
Definition: SiteModuleCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Redirect
Definition: RedirectModuleCest.php:3
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Redirect\SiteModuleCest
Definition: SiteModuleCest.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Redirect\SiteModuleCest\createNewRecordIfNoneExist
‪createNewRecordIfNoneExist(BackendTester $I, ModalDialog $modalDialog)
Definition: SiteModuleCest.php:38
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Redirect\SiteModuleCest\defaultFrontendRendering
‪defaultFrontendRendering(BackendTester $I)
Definition: SiteModuleCest.php:84
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:25