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