‪TYPO3CMS  9.5
PageTreeFilterCest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types = 1);
4 
6 
7 /*
8  * This file is part of the TYPO3 CMS project.
9  *
10  * It is free software; you can redistribute it and/or modify it under
11  * the terms of the GNU General Public License, either version 2
12  * of the License, or any later version.
13  *
14  * For the full copyright and license information, please read the
15  * LICENSE.txt file that was distributed with this source code.
16  *
17  * The TYPO3 project - inspiring people to share!
18  */
19 
24 
26 {
27  protected ‪$filterInputFieldClearButton = '#typo3-pagetree #svg-toolbar span[data-identifier=actions-close]';
28  protected ‪$filterButton = '#typo3-pagetree #svg-toolbar button[data-tree-icon=actions-filter]';
29  protected ‪$filterInputField = '#typo3-pagetree #svg-toolbar .search-input';
30  protected ‪$pageTreeReloadButton = '#typo3-pagetree #svg-toolbar button[data-tree-icon=actions-refresh]';
31  protected ‪$inPageTree = '#typo3-pagetree-treeContainer .nodes';
32 
33  public function ‪_before(‪BackendTester $I, ‪PageTree $pageTree, ‪SiteConfiguration $siteConfiguration)
34  {
35  $siteConfiguration->adjustSiteConfiguration();
36  $I->useExistingSession('admin');
37  $I->click('List');
38 
39  $pageTree->openPath(['styleguide TCA demo']);
40  $I->waitForElement('#typo3-pagetree-tree .nodes .node', 5);
41  }
42 
49  {
50  $I->click($this->filterButton);
51  $I->cantSeeElement($this->filterInputFieldClearButton);
52 
53  $I->fillField($this->filterInputField, 'Group');
55 
56  $I->amGoingTo('prove filter reset button is visible upon input');
57  $I->canSeeElement($this->filterInputFieldClearButton);
58 
59  // [#91884] no Enter key press on purpose. The search should start by itself without additional Enter key press
60  // and this assertion makes sure the filter worked
61  $I->cantSee('inline expandsingle', $this->inPageTree);
62 
63  $I->canSee('elements group', $this->inPageTree);
64  $I->canSee('inline mngroup', $this->inPageTree);
65 
66  // [#91883] this happens, when translated pages are also part of the result set
67  $I->amGoingTo('prove translated pages are not shown in the filtered page tree');
68  $I->cantSee('inline mngroup - language 3', $this->inPageTree);
69 
70  $I->click($this->pageTreeReloadButton);
72 
73  // [#91885] filter must still apply after page tree reload
74  $I->amGoingTo('prove the filter applies after page tree reload');
75  $I->cantSee('flex', $this->inPageTree);
76  $I->seeInField($this->filterInputField, 'Group');
77  }
78 
83  {
84  $I->click($this->filterButton);
85  $I->fillField($this->filterInputField, 'Group');
87 
88  $I->canSee('elements group', $this->inPageTree);
89  $I->canSee('inline mngroup', $this->inPageTree);
90  $I->cantSee('inline expandsingle', $this->inPageTree);
91 
92  $I->click($this->filterInputFieldClearButton);
94 
95  $I->canSee('elements group', $this->inPageTree);
96  $I->canSee('inline mngroup', $this->inPageTree);
97  $I->canSee('inline expandsingle', $this->inPageTree);
98  }
99 
107  {
108  $I->click($this->filterButton);
109  $I->fillField($this->filterInputField, 'Group');
111 
112  $I->canSee('elements group', $this->inPageTree);
113  $I->canSee('inline mngroup', $this->inPageTree);
114 
115  $I->clickWithRightButton('//*[text()=\'inline mngroup\']');
116 
117  $I->canSeeElement('#contentMenu0');
118  $I->click('Delete', '#contentMenu0');
119 
120  // don't use $modalDialog->clickButtonInDialog due to too low timeout
121  $modalDialog->canSeeDialog();
122  $I->click('button[name="delete"]', ModalDialog::$openedModalButtonContainerSelector);
123  $I->waitForElementNotVisible(ModalDialog::$openedModalSelector, 30);
125 
126  $I->canSee('elements group', $this->inPageTree);
127  $I->cantSee('inline mngroup', $this->inPageTree);
128  $I->cantSee('inline expandsingle', $this->inPageTree);
129  }
130 
134  protected function ‪clearPageTreeFilters(
136  ): void {
137  $I->click($this->filterInputFieldClearButton);
138  $I->click($this->pageTreeReloadButton);
139  $I->cantSeeElement($this->filterInputFieldClearButton);
140  }
141 
145  protected function ‪waitForAjaxRequestToFinish(‪BackendTester $I): void
146  {
147  $I->waitForJS('return $.active == 0;', 10);
148  // sometimes rendering is still slower that ajax being finished.
149  $I->wait(0.5);
150  }
151 }
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\$pageTreeReloadButton
‪$pageTreeReloadButton
Definition: PageTreeFilterCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\$inPageTree
‪$inPageTree
Definition: PageTreeFilterCest.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree
Definition: PageTreeFilterCest.php:5
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\deletingPageWithFilterAppliedRespectsFilterUponPageTreeReload
‪deletingPageWithFilterAppliedRespectsFilterUponPageTreeReload(BackendTester $I, ModalDialog $modalDialog)
Definition: PageTreeFilterCest.php:106
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\$filterInputFieldClearButton
‪$filterInputFieldClearButton
Definition: PageTreeFilterCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\$filterButton
‪$filterButton
Definition: PageTreeFilterCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\clearPageTreeFilters
‪clearPageTreeFilters(BackendTester $I)
Definition: PageTreeFilterCest.php:134
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\filterTreeForPage
‪filterTreeForPage(BackendTester $I)
Definition: PageTreeFilterCest.php:48
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\SiteConfiguration
Definition: SiteConfiguration.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest
Definition: PageTreeFilterCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\waitForAjaxRequestToFinish
‪waitForAjaxRequestToFinish(BackendTester $I)
Definition: PageTreeFilterCest.php:145
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\clearFilterReloadsPageTreeWithoutFilterApplied
‪clearFilterReloadsPageTreeWithoutFilterApplied(BackendTester $I)
Definition: PageTreeFilterCest.php:82
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\_before
‪_before(BackendTester $I, PageTree $pageTree, SiteConfiguration $siteConfiguration)
Definition: PageTreeFilterCest.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\PageTree\PageTreeFilterCest\$filterInputField
‪$filterInputField
Definition: PageTreeFilterCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:25