[TASK] Stabilize acceptance tests
[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 }
37
38 /**
39 * @param Admin $I
40 * @param PageTree $pageTree
41 *
42 * @throws \Exception
43 */
44 public function notesEntryCanBeEdited(Admin $I, PageTree $pageTree)
45 {
46 $I->wantToTest('whether sysnote entries can be edited via the Internal Notes section in List View');
47
48 $I->amGoingTo('create a record');
49 $I->click('List');
50 $I->waitForElementNotVisible('#nprogress');
51 $pageTree->openPath(['styleguide TCA demo']);
52 $I->wait(0.2);
53 $I->switchToContentFrame();
54
55 $I->click('.module-docheader .btn[title="Create new record"]');
56 $I->wait(0.2);
57 $I->canSee('New record');
58
59 $I->click('ul.list-tree');
60 // it takes two strokes to get all the way down
61 $I->pressKey('body', WebDriverKeys::PAGE_DOWN);
62 $I->pressKey('body', WebDriverKeys::PAGE_DOWN);
63 $I->click('Internal note');
64
65 $I->fillField('//input[contains(@data-formengine-input-name, "data[sys_note]") and contains(@data-formengine-input-name, "[subject]")]', 'new sys_note');
66 $I->click('button[name="_savedok"]');
67 $I->wait(0.2);
68 $I->waitForElementNotVisible('#t3js-ui-block');
69 $I->click('a[title="Close"]');
70 $I->wait(1);
71 $I->canSee('styleguide TCA demo', 'h1');
72 $I->click('a.t3js-toggle-recordlist[data-table="pages"]');
73 $I->canSee('Internal notes', 'h2');
74 $I->canSee('new sys_note');
75 $I->click('div.typo3-dblist-sysnotes > div > div.panel-heading.clearfix > div > a:nth-child(1)');
76 $I->wait(0.2);
77 $I->canSee('Edit Internal note "new sys_note"');
78 }
79 }