‪TYPO3CMS  ‪main
InlineContentElementLocalizeSynchronizeCest.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 
24 {
25  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
26  {
27  $I->useExistingSession('admin');
28 
29  $I->click('Page');
30  $pageTree->‪openPath(['styleguide TCA demo', 'staticdata']);
31  $I->switchToContentFrame();
32  $I->waitForText('staticdata', 20);
33  }
34 
36  {
37  // Add a content element type images and localize it
38  $I->click('.module-body td[data-language-uid="0"] span[data-identifier="actions-plus"]');
39  $I->switchToMainFrame();
40  $I->waitForElement('.t3js-modal.show');
41  $I->wait(3);
42  $I->waitForElementNotVisible('div#nprogess');
43  $I->executeJS("document.querySelector('typo3-backend-new-content-element-wizard').shadowRoot.querySelector('button[data-identifier=\"default_image\"]').click()");
44  $I->switchToContentFrame();
45  $I->waitForText('Create new Page Content on page "staticdata"', 3, 'h1');
46  $I->click('Images');
47  // Inline add record in Resources tab
48  $I->click('Images');
49  $I->click('span[data-identifier="actions-insert-record"]', 'div.active');
50  $I->switchToWindow('typo3-backend');
51  $I->switchToIFrame('modal_frame');
52  // Find page 'styleguide' in page tree of modal and click it
53  $I->click('//div[contains(@class, "element-browser-main-sidebar")]//*[text()="styleguide"]/..');
54  $I->waitForElementVisible('[data-filelist-name="telephone_box.jpg"] [data-filelist-action="primary"]');
55  $I->click('[data-filelist-name="telephone_box.jpg"] [data-filelist-action="primary"]');
56  // Save, go back to page
57  $I->switchToWindow('typo3-backend');
58  $I->switchToContentFrame();
59  $I->waitForElementVisible('.module-docheader a[title="Close"]');
60  $I->click('.module-docheader a[title="Close"]');
61  $I->switchToWindow('typo3-backend');
62  $I->wait(1);
63  $I->waitForText('Save and close');
64  $I->click('Save and close');
65  $I->wait(1);
66  // Switch to "All languages" view and localize content element
67  $I->switchToContentFrame();
68  $I->waitForElementVisible('select[name=actionMenu]');
69  $I->selectOption('select[name=actionMenu]', 'Language Comparison');
70  $I->waitForElementVisible('button[title="Language"]');
71  $I->click('button[title="Language"]');
72  $I->click('a[title="All languages"]');
73  $I->waitForText('Translate');
74  $I->click('Translate');
75  $I->switchToWindow('typo3-backend');
76  $I->waitForText('Localize page "staticdata - language 1" into styleguide demo language danish');
77  $I->click('span[data-identifier="actions-localize"]');
78  $I->click('Next');
79  $I->waitForText('Normal');
80  $I->click('Next');
81  $I->switchToContentFrame();
82  $I->waitForText('(copy 1)');
83  // Edit default language content element again and add another image
84  $I->click('.module-body td[data-language-uid="0"] span[data-identifier="actions-open"]');
85  $I->waitForText('Edit Page Content on page "staticdata"', 3, 'h1');
86  $I->click('Images');
87  $I->click('span[data-identifier="actions-insert-record"]', 'div.active');
88  $I->switchToWindow('typo3-backend');
89  $I->switchToIFrame('modal_frame');
90  // Find page 'styleguide' in page tree of modal and click it
91  $I->click('//div[contains(@class, "element-browser-main-sidebar")]//*[text()="styleguide"]/..');
92  $I->waitForElementVisible('[data-filelist-name="underground.jpg"] [data-filelist-action="primary"]');
93  $I->click('[data-filelist-name="underground.jpg"] [data-filelist-action="primary"]');
94  // Save, go back to page
95  $I->switchToWindow('typo3-backend');
96  $I->switchToContentFrame();
97  $I->click('.module-docheader a[title="Close"]');
98  $I->switchToWindow('typo3-backend');
99  $I->wait(1);
100  $I->waitForText('Save and close');
101  $I->click('Save and close');
102  $I->wait(1);
103  $I->waitForElementNotVisible('.t3js-modal.show');
104  // Open the localized element and see that the second image can be synchronized
105  $I->switchToContentFrame();
106  $I->waitForText('(copy 1)');
107  $I->click('.module-body td[data-language-uid="1"] span[data-identifier="actions-open"]');
108  $I->waitForText('Edit Page Content " (copy 1)" on page "staticdata"', 3, 'h1');
109  $I->click('Images');
110  $I->waitForText('underground.jpg');
111  $I->click('span[data-identifier="actions-document-localize"]');
112  // Synchronized image has been opened
113  $I->waitForText('Image Metadata');
114  }
115 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\InlineContentElementLocalizeSynchronizeCest
Definition: InlineContentElementLocalizeSynchronizeCest.php:24
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\InlineContentElementLocalizeSynchronizeCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: InlineContentElementLocalizeSynchronizeCest.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\InlineContentElementLocalizeSynchronizeCest\addingResourceToDefaultLangPageAddResourceToLocalizedPage
‪addingResourceToDefaultLangPageAddResourceToLocalizedPage(ApplicationTester $I)
Definition: InlineContentElementLocalizeSynchronizeCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine
Definition: AbstractElementsBasicCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26