‪TYPO3CMS  10.4
SiteModuleCest.php
Go to the documentation of this file.
1 <?php
2 
3 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 
19 
22 
27 {
28 
32  public function ‪_before(‪BackendTester $I)
33  {
34  $I->useExistingSession('admin');
35  }
36 
42  protected function ‪editExistingRecord(‪BackendTester $I)
43  {
44  $acceptanceUrl = $I->grabModuleConfig('WebDriver', 'url');
45  $acceptanceUrlWithTrailingSlash = rtrim($acceptanceUrl, '/') . '/';
46 
47  $I->click('Sites');
48  $I->switchToContentFrame();
49  $I->canSee('Site Configuration', 'h1');
50 
51  $I->amGoingTo('edit styleguide site configuration');
52  $I->click('Edit');
53  $I->waitForElementNotVisible('#t3js-ui-block');
54  $I->canSee('Edit Site Configuration "styleguide-demo-1" on root level');
55  $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[identifier]")]', 'autogenerated-1-c4ca4238a0');
56  $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[base]")]', $acceptanceUrlWithTrailingSlash);
57  $I->click('Languages');
58  $I->click('div[data-table-unique-original-value=site_language_0] > div.panel-heading > div:nth-child(1) > div:nth-child(3) > span:nth-child(1)');
59  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[title]")]', 'English');
60  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[base]")]', $acceptanceUrlWithTrailingSlash);
61  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[locale]")]', 'en_US.UTF-8');
62 
63  $saveButtonLink = '//*/button[@name="_savedok"][1]';
64  $I->waitForElement($saveButtonLink, 30);
65  $I->click($saveButtonLink);
66  $I->waitForElementNotVisible('#t3js-ui-block');
67 
68  $I->click('div.module-docheader .btn.t3js-editform-close');
69 
70  $I->waitForElementVisible('table.table-striped');
71  $I->canSee('Site Configuration', 'h1');
72  $I->canSee('autogenerated-1-c4ca4238a0');
73  }
74 
81  {
82  $acceptanceUrl = $I->grabModuleConfig('WebDriver', 'url');
83  $acceptanceUrlWithTrailingSlash = rtrim($acceptanceUrl, '/') . '/';
84 
85  $I->click('Sites');
86  $I->switchToContentFrame();
87  $I->canSee('Site Configuration', 'h1');
88 
89  $I->amGoingTo('delete the auto generated config in order to create one manually');
90  $I->click('Delete site configuration');
91  $modalDialog->canSeeDialog();
92  $modalDialog->clickButtonInDialog('Delete');
93  $I->switchToContentFrame();
94 
95  $I->amGoingTo('manually create a new site config for the existing root page');
96  $I->click('Add new site configuration for this site');
97  $I->waitForElementNotVisible('#t3js-ui-block');
98  $I->canSee('Create new Site configuration');
99  $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[identifier]")]', 'SitesTestIdentifier');
100  $I->fillField('//input[contains(@data-formengine-input-name, "data[site]") and contains(@data-formengine-input-name, "[base]")]', $acceptanceUrlWithTrailingSlash);
101  $I->click('Languages');
102  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[title]")]', 'Homepage');
103  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[base]")]', $acceptanceUrlWithTrailingSlash);
104  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[locale]")]', 'en_US.UTF-8');
105  $saveButtonLink = '//*/button[@name="_savedok"][1]';
106  $I->waitForElement($saveButtonLink, 30);
107  $I->click($saveButtonLink);
108  $I->waitForElementNotVisible('#t3js-ui-block');
109  $I->click('div.module-docheader .btn.t3js-editform-close');
110  $I->waitForElementVisible('table.table-striped');
111  $I->canSee('Site Configuration', 'h1');
112  $I->canSee('SitesTestIdentifier');
113  }
114 
123  {
124  $I->amGoingTo('create a default FE typoscript for the created site configuration');
125 
126  $I->click('Template');
127  $I->switchToContentFrame();
128  $I->waitForElementVisible('#ts-overview');
129  $I->see('Template tools');
130 
131  $I->switchToMainFrame();
132  $I->click('Template');
133  $I->click('.node.identifier-0_1');
134  $I->switchToContentFrame();
135  $I->waitForText('Create new website');
136 
137  $I->click("//input[@name='newWebsite']");
138  $I->selectOption('.t3-js-jumpMenuBox', 'Info/Modify');
139  $I->waitForElement('.table-fit');
140  $I->see('Title');
141 
142  $I->click('Edit the whole template record');
143  $I->waitForElement('#EditDocumentController');
144  $I->fillField('//input[@data-formengine-input-name="data[sys_template][1][title]"]', 'Default Title');
145  $I->click("//button[@name='_savedok']");
146 
147  $I->waitForElementNotVisible('#t3js-ui-block', 30);
148  $I->waitForElement('#EditDocumentController');
149  $I->waitForElementNotVisible('#t3js-ui-block');
150 
151  // watch out for new line after each instruction. Anything else doesn't work.
152  $config = 'page = PAGE
153 page.shortcutIcon = fileadmin/styleguide/bus_lane.jpg
154 page.10 = TEXT
155 page.10.value = This is a default text for default rendering without dynamic content creation
156 ';
157  $I->fillField('//textarea[@data-formengine-input-name="data[sys_template][1][config]"]', $config);
158  $I->click('//button[@name="_savedok"]');
159  $I->waitForElementNotVisible('#t3js-ui-block');
160 
161  // Call FE and verify it is properly rendered
162  $I->amOnPage('/');
163  $I->canSee('This is a default text for default rendering without dynamic content creation');
164  }
165 }
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Site\SiteModuleCest\createSiteConfigIfNoneExists
‪createSiteConfigIfNoneExists(BackendTester $I, ModalDialog $modalDialog)
Definition: SiteModuleCest.php:80
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Site
Definition: SiteModuleCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Site\SiteModuleCest
Definition: SiteModuleCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Site\SiteModuleCest\editExistingRecord
‪editExistingRecord(BackendTester $I)
Definition: SiteModuleCest.php:42
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Site\SiteModuleCest\defaultFrontendRendering
‪defaultFrontendRendering(BackendTester $I)
Definition: SiteModuleCest.php:122
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Site\SiteModuleCest\_before
‪_before(BackendTester $I)
Definition: SiteModuleCest.php:32
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:27