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