‪TYPO3CMS  11.5
CategoryTreeCest.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 
21 
26 {
30  public function ‪_before(‪ApplicationTester $I): void
31  {
32  $I->useExistingSession('admin');
33  }
34 
39  {
40  // A sub-element of web module is show
41  $I->waitForElementVisible('#web + .modulemenu-group-container .modulemenu-action');
42  $I->click('#web_list');
43  $I->switchToContentFrame();
44  $I->waitForElement('#recordlist-sys_category');
45  $I->seeNumberOfElements('#recordlist-sys_category table > tbody > tr', [5, 100]);
46  }
47 
51  public function ‪editCategoryItem(‪ApplicationTester $I): void
52  {
53  // A sub-element of web module is show
54  $I->waitForElementVisible('#web + .modulemenu-group-container .modulemenu-action');
55  $I->click('#web_list');
56  $I->switchToContentFrame();
57  // Collapse all tables and expand category again - ensures category fits into window
58  $I->executeJS('$(\'.icon-actions-view-list-collapse\').click();');
59  $I->wait(1);
60  $I->executeJS('$(\'button[data-table="sys_category"] .icon-actions-view-list-expand\').click();');
61  $I->waitForElementVisible('#recordlist-sys_category tr[data-uid="7"] a[aria-label="Edit record"]');
62  // Select category with id 7
63  $I->click('#recordlist-sys_category tr[data-uid="7"] a[aria-label="Edit record"]');
64  $I->waitForText('Category', 20);
65  // Change title and level to root
66  $I->fillField('input[data-formengine-input-name="data[sys_category][7][title]"]', 'level-1-4');
67  $I->click('#identifier-0_7 text.node-name');
68  $I->click('#identifier-0_3 text.node-name');
69  $I->click('button[name="_savedok"]');
70  // Wait for tree and check if isset level-1-4
71  $I->waitForElement('.svg-tree-wrapper svg');
72  $I->waitForText('Category');
73  $I->see('level-1-4');
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\Application\FormEngine\CategoryTreeCest
Definition: CategoryTreeCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\CategoryTreeCest\_before
‪_before(ApplicationTester $I)
Definition: CategoryTreeCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\CategoryTreeCest\checkIfCategoryListIsAvailable
‪checkIfCategoryListIsAvailable(ApplicationTester $I)
Definition: CategoryTreeCest.php:38
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\CategoryTreeCest\editCategoryItem
‪editCategoryItem(ApplicationTester $I)
Definition: CategoryTreeCest.php:51