‪TYPO3CMS  11.5
CompareUserCest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
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 
19 
21 
26 {
30  public function ‪_before(‪ApplicationTester $I): void
31  {
32  $I->useExistingSession('admin');
33 
34  $I->see('Backend Users');
35  $I->click('Backend Users');
36  $I->switchToContentFrame();
37  }
38 
43  {
44  // put two users into compare list
45  $I->see('Backend User Listing');
46  $I->click('#typo3-backend-user-list > tbody > tr:nth-child(1) > td.col-control > div:nth-child(3) > a');
47  $I->waitForElementVisible('table#typo3-backend-user-list');
48  $I->click('#typo3-backend-user-list > tbody > tr:nth-child(2) > td.col-control > div:nth-child(3) > a');
49  $I->waitForElementVisible('table#typo3-backend-user-list-compare', 20);
50  $I->canSeeNumberOfElements('#typo3-backend-user-list-compare tbody tr', 2);
51  $I->click('body > div > div.module-body.t3js-module-body .compare');
52  $I->waitForElementVisible('table.table-striped');
53 
54  // first user can be edited
55  $usernameFirstCompare = $I->grabTextFrom('#tx_beuser_compare > thead > tr > th:nth-child(2)');
56  $I->click('#tx_beuser_compare > thead > tr > th:nth-child(2) > a[title="edit"]');
57  $I->waitForElementNotVisible('#t3js-ui-block');
58  $I->waitForElementVisible('#EditDocumentController');
59  $I->canSee('Edit Backend user "' . $usernameFirstCompare . '" on root level');
60 
61  // back to compare view
62  $I->click('.module-docheader a[title="Close"]');
63  $I->waitForElementVisible('table.table-striped');
64  $I->canSee('Compare backend users', 'h1');
65 
66  // second user can be edited
67  $usernameFirstCompare = $I->grabTextFrom('#tx_beuser_compare > thead > tr > th:nth-child(3)');
68  $I->click('#tx_beuser_compare > thead > tr > th:nth-child(3) > a[title="edit"]');
69  $I->waitForElementNotVisible('#t3js-ui-block');
70  $I->waitForElementVisible('#EditDocumentController');
71  $I->canSee('Edit Backend user "' . $usernameFirstCompare . '" on root level');
72  }
73 
78  {
79  $I->amGoingTo('Switch to user group listing');
80  $I->see('Backend User Listing', 'h1');
81  $I->selectOption('.t3-js-jumpMenuBox', 'Backend user groups');
82  $I->see('Backend User Group Listing', 'h1');
83 
84  $I->amGoingTo('Add three groups to compare');
85  $I->click('#typo3-backend-user-group-list > tbody > tr:nth-child(1) > td.col-control > div:nth-child(3) > a');
86  $I->waitForElementVisible('table#typo3-backend-user-group-list');
87  $I->click('#typo3-backend-user-group-list > tbody > tr:nth-child(2) > td.col-control > div:nth-child(3) > a');
88  $I->waitForElementVisible('table#typo3-backend-user-group-list');
89  $I->click('#typo3-backend-user-group-list > tbody > tr:nth-child(3) > td.col-control > div:nth-child(3) > a');
90 
91  $I->amGoingTo('Access the user group compare view');
92  $I->waitForElementVisible('table#typo3-backend-user-list-compare', 20);
93  $I->canSeeNumberOfElements('#typo3-backend-user-list-compare tbody tr', 3);
94  $I->click('Compare backend usergroups');
95 
96  $I->amGoingTo('Check compare view is loaded with the correct number of groups');
97  $I->see('Compare backend usergroups', 'h1');
98  // We expect four header columns, since the first one is used for the row labels
99  $I->canSeeNumberOfElements('#tx_beuser_compare > thead > tr > th', 4);
100  }
101 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\BackendUser\CompareUserCest
Definition: CompareUserCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\BackendUser\CompareUserCest\accessingBackendUserCompareViewWorks
‪accessingBackendUserCompareViewWorks(ApplicationTester $I)
Definition: CompareUserCest.php:77
‪TYPO3\CMS\Core\Tests\Acceptance\Application\BackendUser\CompareUserCest\_before
‪_before(ApplicationTester $I)
Definition: CompareUserCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Application\BackendUser
Definition: CompareUserCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\BackendUser\CompareUserCest\editingBeUserRecordsFromCompareViewWorks
‪editingBeUserRecordsFromCompareViewWorks(ApplicationTester $I)
Definition: CompareUserCest.php:42