30dbcb882d9bb250d6ef5a77cef593f1d77c24c7
[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 // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
33 $I->switchToIFrame('list_frame');
34 $I->waitForText('Web Content Management System');
35 $I->switchToIFrame();
36
37 $I->see('Backend users');
38 $I->click('Backend users');
39
40 // switch to content iframe
41 $I->switchToIFrame('list_frame');
42 $I->waitForElementNotVisible('div#nprogess');
43 }
44
45 /**
46 * @param Admin $I
47 */
48 public function editingBeUserRecordsFromCompareViewWorks(Admin $I)
49 {
50 // put two users into compare list
51 $I->see('Backend User Listing');
52 $I->click('#typo3-backend-user-list > tbody > tr:nth-child(1) > td.col-control > div:nth-child(3) > a');
53 $I->waitForElementVisible('table#typo3-backend-user-list');
54 $I->click('#typo3-backend-user-list > tbody > tr:nth-child(2) > td.col-control > div:nth-child(3) > a');
55 $I->waitForElementVisible('table#typo3-backend-user-list-compare');
56 $I->canSeeNumberOfElements('#typo3-backend-user-list-compare tbody tr', 2);
57 $I->click('body > div > div.module-body.t3js-module-body > form:nth-child(4) > input');
58 $I->waitForElementVisible('table.table-striped');
59
60 // first user can be edited
61 $usernameFirstCompare = $I->grabTextFrom('#tx_beuser_compare > thead > tr > th:nth-child(2)');
62 $I->click('#tx_beuser_compare > thead > tr > th:nth-child(2) > a.btn.btn-default.pull-right');
63 $I->waitForElementNotVisible('#t3js-ui-block');
64 $I->waitForElementVisible('#EditDocumentController');
65 $I->canSee('Edit Backend user "' . $usernameFirstCompare . '" on root level');
66
67 // back to compare view
68 $I->click('div.module-docheader .btn.t3js-editform-close');
69 $I->waitForElementVisible('table.table-striped');
70 $I->canSee('Compare backend users', 'h1');
71
72 // second user can be edited
73 $usernameFirstCompare = $I->grabTextFrom('#tx_beuser_compare > thead > tr > th:nth-child(3)');
74 $I->click('#tx_beuser_compare > thead > tr > th:nth-child(3) > a.btn.btn-default.pull-right');
75 $I->waitForElementNotVisible('#t3js-ui-block');
76 $I->waitForElementVisible('#EditDocumentController');
77 $I->canSee('Edit Backend user "' . $usernameFirstCompare . '" on root level');
78 }
79 }