[TASK] Raise testing-framework and styleguide
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / RecordList / SysNoteCest.php
1 <?php
2 declare(strict_types = 1);
3 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\RecordList;
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
18 use Codeception\Util\Locator;
19 use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
20 use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree;
21
22 /**
23 * Cases concerning sys_note records
24 */
25 class SysNoteCest
26 {
27 /**
28 * @param BackendTester $I
29 */
30 public function _before(BackendTester $I)
31 {
32 $I->useExistingSession('admin');
33 }
34
35 /**
36 * @param BackendTester $I
37 * @param PageTree $pageTree
38 */
39 public function notesEntryCanBeEdited(BackendTester $I, PageTree $pageTree)
40 {
41 $I->wantToTest('whether sysnote entries can be edited via the Internal Notes section in List View');
42
43 $I->amGoingTo('create a record');
44 $I->click('List');
45 $I->waitForElementNotVisible('#nprogress');
46 $pageTree->openPath(['styleguide TCA demo']);
47 $I->wait(0.2);
48 $I->switchToContentFrame();
49
50 $I->click('.module-docheader .btn[title="Create new record"]');
51 $I->wait(0.2);
52 $I->canSee('New record');
53
54 $I->scrollTo(Locator::find('span', ['data-table' => 'sys_note']));
55 $I->click('Internal note');
56
57 $I->fillField('//input[contains(@data-formengine-input-name, "data[sys_note]") and contains(@data-formengine-input-name, "[subject]")]', 'new sys_note');
58 $I->click('button[name="_savedok"]');
59 $I->wait(0.2);
60 $I->waitForElementNotVisible('#t3js-ui-block');
61 $I->click('a[title="Close"]');
62 $I->wait(1);
63 $I->canSee('styleguide TCA demo', 'h1');
64 $I->click('a.t3js-toggle-recordlist[data-table="pages"]');
65 $I->canSee('Internal notes', 'h2');
66 $I->canSee('new sys_note');
67 $I->click('div.typo3-dblist-sysnotes > div > div.panel-heading.clearfix > div > a:nth-child(1)');
68 $I->wait(0.2);
69 $I->canSee('Edit Internal note "new sys_note"');
70 }
71 }