TYPO3 CMS  TYPO3_8-7
CategoryTreeCest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
23 {
27  public function _before(BackendTester $I)
28  {
29  $I->useExistingSession('admin');
30  }
31 
36  {
37  // A sub-element of web module is show
38  $I->waitForElementVisible('#web .modulemenu-group-container .modulemenu-item');
39  $I->click('#web_list');
40  $I->switchToContentFrame();
41  $I->waitForElement('#recordlist-sys_category');
42  $I->seeNumberOfElements('#recordlist-sys_category table > tbody > tr', [5, 100]);
43  }
44 
48  public function editCategoryItem(BackendTester $I)
49  {
50  // A sub-element of web module is show
51  $I->waitForElementVisible('#web .modulemenu-group-container .modulemenu-item');
52  $I->click('#web_list');
53  $I->switchToContentFrame();
54  // Collapse all tables and expand category again - ensures category fits into window
55  $I->executeJS('$(\'.icon-actions-view-list-collapse\').click();');
56  $I->wait(1);
57  $I->executeJS('$(\'a[data-table="sys_category"] .icon-actions-view-list-expand\').click();');
58  $I->waitForElementVisible('#recordlist-sys_category tr[data-uid="7"] a[data-original-title="Edit record"]');
59  // Select category with id 7
60  $I->click('#recordlist-sys_category tr[data-uid="7"] a[data-original-title="Edit record"]');
61  $I->waitForText('Category', 20);
62  // Change title and level to root
63  $I->fillField('input[data-formengine-input-name="data[sys_category][7][title]"]', 'level-1-4');
64  $I->click('.identifier-7 text');
65  $I->click('.identifier-3 text');
66  $I->click('button[name="_savedok"]');
67  // Wait for tree and check if isset level-1-4
68  $I->waitForElement('.svg-tree-wrapper svg');
69  $I->waitForText('Category');
70  $I->see('level-1-4');
71  }
72 }