17bb0588e3342b667aa99f9b69eda72077eceb41
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / RecordList / SysNoteCest.php
1 <?php
2 declare(strict_types = 1);
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
17 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\RecordList;
18
19 use Facebook\WebDriver\WebDriverKeys;
20 use TYPO3\TestingFramework\Core\Acceptance\Step\Backend\Admin;
21 use TYPO3\TestingFramework\Core\Acceptance\Support\Page\PageTree;
22
23 /**
24 * Cases concerning sys_note records
25 */
26 class SysNoteCest
27 {
28 /**
29 * @param Admin $I
30 *
31 * @throws \Exception
32 */
33 public function _before(Admin $I)
34 {
35 $I->useExistingSession();
36 // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
37 $I->switchToIFrame('list_frame');
38 $I->waitForText('Web Content Management System');
39 $I->switchToIFrame();
40 }
41
42 /**
43 * @param Admin $I
44 * @param PageTree $pageTree
45 *
46 * @throws \Exception
47 */
48 public function notesEntryCanBeEdited(Admin $I, PageTree $pageTree)
49 {
50 $I->wantToTest('whether sysnote entries can be edited via the Internal Notes section in List View');
51
52 $I->amGoingTo('create a record');
53 $I->click('List');
54 $I->waitForElementNotVisible('div#nprogress');
55 $pageTree->openPath(['styleguide TCA demo']);
56 $I->wait(0.2);
57 $I->switchToIFrame('list_frame');
58
59 $I->click('.module-docheader .btn[title="Create new record"]');
60 $I->wait(0.2);
61 $I->canSee('New record');
62
63 $I->click('ul.list-tree');
64 // it takes two strokes to get all the way down
65 $I->pressKey('body', WebDriverKeys::PAGE_DOWN);
66 $I->pressKey('body', WebDriverKeys::PAGE_DOWN);
67 $I->click('Internal note');
68
69 $I->fillField('//input[contains(@data-formengine-input-name, "data[sys_note]") and contains(@data-formengine-input-name, "[subject]")]', 'new sys_note');
70 $I->click('button[name="_savedok"]');
71 $I->wait(0.2);
72 $I->waitForElementNotVisible('#t3js-ui-block');
73 $I->click('a[title="Close"]');
74 $I->wait(1);
75 $I->canSee('styleguide TCA demo', 'h1');
76 $I->click('a.t3js-toggle-recordlist[data-table="pages"]');
77 $I->canSee('Internal notes', 'h2');
78 $I->canSee('new sys_note');
79 $I->click('div.typo3-dblist-sysnotes > div > div.panel-heading.clearfix > div > a:nth-child(1)');
80 $I->wait(0.2);
81 $I->canSee('Edit Internal note "new sys_note"');
82 }
83 }