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