‪TYPO3CMS  10.4
PageModuleCest.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 
28 {
32  public function ‪_before(‪BackendTester $I)
33  {
34  $I->useExistingSession('admin');
35  }
36 
41  {
42  $I->click('Page');
43  $I->switchToContentFrame();
44  $I->canSee('Web>Page module', 'h4');
45  }
46 
51  public function ‪editPageTitle(‪BackendTester $I, ‪PageTree $pageTree): void
52  {
53  $currentPageTitle = 'styleguide TCA demo';
54  $newPageTitle = 'styleguide TCA demo page';
55 
56  $I->click('Page');
57  $pageTree->openPath([$currentPageTitle]);
58  $I->wait(0.2);
59  $I->switchToContentFrame();
60 
61  // Rename the page
62  $this->‪renamePage($I, $currentPageTitle, $newPageTitle);
63 
64  // Now recover the old page title
65  $this->‪renamePage($I, $newPageTitle, $currentPageTitle);
66  }
67 
73  private function ‪renamePage(‪BackendTester $I, string $oldTitle, string $newTitle)
74  {
75  $editLinkSelector = 'a[data-action="edit"]';
76  $inputFieldSelector = 'input[class*="t3js-title-edit-input"]';
77 
78  $I->canSee($oldTitle, 'h1');
79  $I->moveMouseOver('.t3js-title-inlineedit');
80 
81  $I->comment('Activate inline edit of page title');
82  $I->seeElement($editLinkSelector);
83  $I->click($editLinkSelector);
84  $I->seeElement($inputFieldSelector);
85 
86  $I->comment('Set new value and save');
87  $I->fillField($inputFieldSelector, $newTitle);
88  $I->click('button[data-action="submit"]');
89 
90  $I->comment('See the new page title');
91  $I->waitForElementNotVisible($inputFieldSelector);
92  $I->canSee($newTitle, 'h1');
93  }
94 }
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Page\PageModuleCest\checkThatPageModuleHasAHeadline
‪checkThatPageModuleHasAHeadline(BackendTester $I)
Definition: PageModuleCest.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Page
Definition: AddPageInPageModuleCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Page\PageModuleCest\renamePage
‪renamePage(BackendTester $I, string $oldTitle, string $newTitle)
Definition: PageModuleCest.php:73
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Page\PageModuleCest\editPageTitle
‪editPageTitle(BackendTester $I, PageTree $pageTree)
Definition: PageModuleCest.php:51
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Page\PageModuleCest
Definition: PageModuleCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Page\PageModuleCest\_before
‪_before(BackendTester $I)
Definition: PageModuleCest.php:32
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:28