Commit b6d613e5 authored by Adam Marcinkowski's avatar Adam Marcinkowski Committed by Christian Kuhn
Browse files

[TASK] Add basic test for category

* Add fixture with categories 
* Add test to check if categories are visible in list module
* Add test to check if category is editable

Releases: master
Resolves: #76162
Change-Id: Ia518e059d23238f52f79224acffccd21bf8aaa88
Reviewed-on: https://review.typo3.org/48096

Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 911acf85
<?php
namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Formhandler;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Admin;
/**
* Category tree tests
*/
class CategoryTreeCest
{
/**
* @param Admin $I
*/
public function _before(Admin $I)
{
$I->useExistingSession();
}
/**
* @param Admin $I
*/
public function checkIfCategoryListIsAvailable(Admin $I)
{
// A sub-element of web module is show
$I->waitForElementVisible('#web .typo3-module-menu-group-container .typo3-module-menu-item');
$I->click('#web_list');
$I->switchToIFrame('content');
$I->waitForElement('#recordlist-sys_category');
$I->seeNumberOfElements('#recordlist-sys_category table > tbody > tr', [5,100]);
}
/**
* @param Admin $I
*/
public function editCategoryItem(Admin $I)
{
// A sub-element of web module is show
$I->waitForElementVisible('#web .typo3-module-menu-group-container .typo3-module-menu-item');
$I->click('#web_list');
$I->switchToIFrame('content');
// Select category with id 7
$I->click('#recordlist-sys_category tr[data-uid="7"] a[data-original-title="Edit record"]');
// Change title and level to root
$I->fillField('input[data-formengine-input-name="data[sys_category][7][title]"]','level-1-4');
$I->click('div[ext\:tree-node-id="7"]');
$I->click('div[ext\:tree-node-id="3"]');
$I->click('button[name="_savedok"]');
// Wait for tree and check if isset level-1-4
$I->waitForElement('.x-panel.x-tree');
$I->see('level-1-4', '.x-panel.x-tree');
}
}
<?xml version="1.0" encoding="utf-8"?>
<dataset>
<sys_category>
<uid>1</uid>
<pid>0</pid>
<title>level-1-1</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>2</uid>
<parent>1</parent>
<pid>0</pid>
<title>level-1-1-1</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>3</uid>
<parent>2</parent>
<pid>0</pid>
<title>level-1-1-1-1</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>4</uid>
<parent>2</parent>
<pid>0</pid>
<title>level-1-1-1-2</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>5</uid>
<parent>2</parent>
<pid>0</pid>
<title>level-1-1-1-3</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>6</uid>
<parent>3</parent>
<pid>0</pid>
<title>level-1-1-1-1-1</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>7</uid>
<parent>3</parent>
<pid>0</pid>
<title>level-1-1-1-1-2</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>8</uid>
<pid>0</pid>
<title>level-1-2</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>9</uid>
<parent>8</parent>
<pid>0</pid>
<title>level-1-2-1</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>10</uid>
<parent>8</parent>
<pid>0</pid>
<title>level-1-2-2</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>11</uid>
<parent>8</parent>
<pid>0</pid>
<title>level-1-2-3</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>12</uid>
<parent>8</parent>
<pid>0</pid>
<title>level-1-2-4</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>13</uid>
<parent>8</parent>
<pid>0</pid>
<title>level-1-2-5</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>14</uid>
<parent>8</parent>
<pid>0</pid>
<title>level-1-2-6</title>
<deleted>0</deleted>
</sys_category>
<sys_category>
<uid>15</uid>
<pid>0</pid>
<title>level-1-3</title>
<deleted>0</deleted>
</sys_category>
</dataset>
......@@ -135,6 +135,7 @@ class AcceptanceCoreEnvironment extends Extension
'typo3/sysext/core/Tests/Acceptance/Fixtures/be_users.xml',
'typo3/sysext/core/Tests/Acceptance/Fixtures/be_sessions.xml',
'typo3/sysext/core/Tests/Acceptance/Fixtures/be_groups.xml',
'typo3/sysext/core/Tests/Acceptance/Fixtures/sys_category.xml',
];
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment