[TASK] Stabilize acceptance tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / BackendUser / CompareUserCest.php
1 <?php
2 declare(strict_types = 1);
3
4 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\BackendUser;
5
6 /*
7 * This file is part of the TYPO3 CMS project.
8 *
9 * It is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, either version 2
11 * of the License, or any later version.
12 *
13 * For the full copyright and license information, please read the
14 * LICENSE.txt file that was distributed with this source code.
15 *
16 * The TYPO3 project - inspiring people to share!
17 */
18
19 use TYPO3\TestingFramework\Core\Acceptance\Step\Backend\Admin;
20
21 /**
22 * Tests concerning the compare view of BE user module
23 */
24 class CompareUserCest
25 {
26 /**
27 * @param Admin $I
28 */
29 public function _before(Admin $I)
30 {
31 $I->useExistingSession();
32
33 $I->see('Backend users');
34 $I->click('Backend users');
35 $I->switchToContentFrame();
36 }
37
38 /**
39 * @param Admin $I
40 */
41 public function editingBeUserRecordsFromCompareViewWorks(Admin $I)
42 {
43 // put two users into compare list
44 $I->see('Backend User Listing');
45 $I->click('#typo3-backend-user-list > tbody > tr:nth-child(1) > td.col-control > div:nth-child(3) > a');
46 $I->waitForElementVisible('table#typo3-backend-user-list');
47 $I->click('#typo3-backend-user-list > tbody > tr:nth-child(2) > td.col-control > div:nth-child(3) > a');
48 $I->waitForElementVisible('table#typo3-backend-user-list-compare');
49 $I->canSeeNumberOfElements('#typo3-backend-user-list-compare tbody tr', 2);
50 $I->click('body > div > div.module-body.t3js-module-body > form:nth-child(4) > input');
51 $I->waitForElementVisible('table.table-striped');
52
53 // first user can be edited
54 $usernameFirstCompare = $I->grabTextFrom('#tx_beuser_compare > thead > tr > th:nth-child(2)');
55 $I->click('#tx_beuser_compare > thead > tr > th:nth-child(2) > a.btn.btn-default.pull-right');
56 $I->waitForElementNotVisible('#t3js-ui-block');
57 $I->waitForElementVisible('#EditDocumentController');
58 $I->canSee('Edit Backend user "' . $usernameFirstCompare . '" on root level');
59
60 // back to compare view
61 $I->click('div.module-docheader .btn.t3js-editform-close');
62 $I->waitForElementVisible('table.table-striped');
63 $I->canSee('Compare backend users', 'h1');
64
65 // second user can be edited
66 $usernameFirstCompare = $I->grabTextFrom('#tx_beuser_compare > thead > tr > th:nth-child(3)');
67 $I->click('#tx_beuser_compare > thead > tr > th:nth-child(3) > a.btn.btn-default.pull-right');
68 $I->waitForElementNotVisible('#t3js-ui-block');
69 $I->waitForElementVisible('#EditDocumentController');
70 $I->canSee('Edit Backend user "' . $usernameFirstCompare . '" on root level');
71 }
72 }