‪TYPO3CMS  11.5
InlinePagesLocalizeResourceCest.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 
20 use Facebook\WebDriver\Remote\RemoteWebDriver;
21 use Facebook\WebDriver\WebDriverBy;
24 
26 {
27  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
28  {
29  $I->useExistingSession('admin');
30 
31  $I->click('List');
32  $I->waitForElement('svg .nodes .node');
33  $pageTree->‪openPath(['styleguide TCA demo', 'staticdata']);
34  $I->switchToContentFrame();
35  $I->waitForText('staticdata', 20);
36  }
37 
39  {
40  // Add an image to media field of default lang page
41  $I->click('.module-docheader a[title="Edit page properties"]');
42  $I->waitForText('Edit Page "staticdata"', 3, 'h1');
43  // Inline add record in Resources tab
44  $I->click('Resources');
45  $I->click('span[data-identifier="actions-insert-record"]', 'div.active');
46  $I->switchToWindow();
47  $I->switchToIFrame('modal_frame');
48  // Find page 'styleguide' in page tree of modal and click it
49  $context = $I->executeInSelenium(function (RemoteWebDriver $webdriver) {
50  $context = $webdriver->findElement(WebDriverBy::cssSelector('div.element-browser-main-sidebar'));
51  return $context->findElement(WebDriverBy::xpath('//*[text()=\'styleguide\']/..'));
52  });
53  // Add an image, closes modal again
54  $context->findElement(WebDriverBy::cssSelector('text.node-name'))->click();
55  $I->waitForElementVisible('#typo3-filelist a[data-file-name="telephone_box.jpg"]');
56  $I->click('#typo3-filelist a[data-file-name="telephone_box.jpg"]');
57  // Save, go back to list
58  $I->switchToWindow();
59  $I->switchToContentFrame();
60  $I->click('.module-docheader a[title="Close"]');
61  $I->switchToWindow();
62  $I->wait(1);
63  $I->waitForText('Save and close');
64  $I->click('Save and close');
65  $I->wait(1);
66  // Edit the page translation and see if that resource has been added.
67  $I->switchToContentFrame();
68  $I->waitForText('staticdata - language 1');
69  $I->wait(1);
70  $I->click('staticdata - language 1');
71  $I->waitForText('Edit Page "staticdata - language 1"', 3, 'h1');
72  $I->click('Resources');
73  $I->see('telephone_box.jpg');
74  }
75 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine
Definition: AbstractElementsBasicCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree\openPath
‪openPath(array $path)
Definition: PageTree.php:76
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\InlinePagesLocalizeResourceCest
Definition: InlinePagesLocalizeResourceCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\InlinePagesLocalizeResourceCest\addingResourceToDefaultLangPageAddResourceToLocalizedPage
‪addingResourceToDefaultLangPageAddResourceToLocalizedPage(ApplicationTester $I)
Definition: InlinePagesLocalizeResourceCest.php:38
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\InlinePagesLocalizeResourceCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: InlinePagesLocalizeResourceCest.php:27