‪TYPO3CMS  ‪main
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 
26 final class ‪SiteModuleCest
27 {
28  public function ‪_before(‪ApplicationTester $I): void
29  {
30  $I->useExistingSession('admin');
31  }
32 
33  public function ‪editExistingRecord(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
34  {
35  $I->amGoingTo('Access the site module');
36  $I->click('Sites');
37  $I->switchToContentFrame();
38  $I->see('Site Configuration', 'h1');
39 
40  $I->amGoingTo('edit an automatically created site configuration');
41  $I->click('Edit');
42  $I->waitForElementNotVisible('#t3js-ui-block');
43  $I->see('Edit Site Configuration', 'h1');
44 
45  $I->amGoingTo('Edit the default site language');
46  $I->click('Languages');
47  $I->see('English [0] (en_US.UTF-8)');
48  $I->click('div[data-table-unique-original-value=site_language_0] > div:nth-child(1) > div:nth-child(1)');
49  $I->waitForElementVisible('div[data-table-unique-original-value=site_language_0] > div.panel-collapse');
50  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[title]")]', 'English Edit');
51  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[base]")]', '/');
52  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[locale]")]', 'en_US.UTF-8');
53 
54  $I->amGoingTo('Delete a site language');
55  $I->see('styleguide demo language danish [1] (da_DK.UTF-8)');
56  $I->click('div[data-table-unique-original-value=site_language_1] > div:nth-child(1) > div:nth-child(1) > div:nth-child(3) button');
57  $modalDialog->‪canSeeDialog();
58  $I->click('button[name="yes"]', ‪ModalDialog::$openedModalButtonContainerSelector);
59  $I->waitForElementNotVisible(‪ModalDialog::$openedModalSelector, 30);
60  $I->switchToContentFrame();
61  $I->dontSee('styleguide demo language danish [1] (da_DK.UTF-8)');
62  $I->see('styleguide demo language danish [1]', 'option');
63 
64  $I->amGoingTo('Save the site configuration');
65  $saveButtonLink = '//*/button[@name="_savedok"][1]';
66  $I->waitForElement($saveButtonLink, 30);
67  $I->click($saveButtonLink);
68  $I->waitForElementNotVisible('#t3js-ui-block');
69 
70  $I->amGoingTo('Verify default site language has changed and danish is deleted');
71  $I->see('English Edit [0] (en_US.UTF-8)');
72  $I->dontSee('styleguide demo language danish [1] (da_DK.UTF-8)');
73 
74  $I->amGoingTo('Create a completely new site language');
75  $I->click('Create new language');
76  $I->waitForElementVisible('div.inlineIsNewRecord');
77  $I->scrollTo('div.inlineIsNewRecord');
78  $I->see('[New language]');
79  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[title]")]', 'New Language');
80  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[base]")]', '/new-language/');
81  $I->fillField('//input[contains(@data-formengine-input-name, "data[site_language]") and contains(@data-formengine-input-name, "[locale]")]', 'hr_HR');
82 
83  $I->amGoingTo('Save the site configuration');
84  $I->waitForElement($saveButtonLink, 30);
85  $I->click($saveButtonLink);
86  $I->waitForElementNotVisible('#t3js-ui-block');
87 
88  $I->amGoingTo('Verify new site configuration has been added with the next available language ID)');
89  $I->see('New Language [9] (hr_HR)');
90 
91  $I->amGoingTo('Close the site configuration form');
92  $I->click('Close');
93  $I->waitForElementVisible('table.table-striped');
94  $I->see('Site Configuration', 'h1');
95  }
96 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalSelector
‪static string $openedModalSelector
Definition: ModalDialog.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalButtonContainerSelector
‪static string $openedModalButtonContainerSelector
Definition: ModalDialog.php:37
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Site
Definition: SiteModuleCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Site\SiteModuleCest\_before
‪_before(ApplicationTester $I)
Definition: SiteModuleCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Site\SiteModuleCest
Definition: SiteModuleCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:68
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Site\SiteModuleCest\editExistingRecord
‪editExistingRecord(ApplicationTester $I, ModalDialog $modalDialog)
Definition: SiteModuleCest.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24