‪TYPO3CMS  11.5
DashboardModuleCest.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 
22 
27 {
28  protected static string ‪$defaultDashboardTitle = 'My Dashboard';
29  protected static string ‪$customDashboardTitle = 'My Custom Dashboard';
30  protected static string ‪$dashboardActiveSelector = '.dashboard-tab--active';
31  protected static string ‪$widgetTitle = 'Type of backend users';
32  protected static string ‪$widgetTitleSelector = '.widget-content-title';
33 
37  public function ‪_before(‪ApplicationTester $I): void
38  {
39  $I->useExistingSession('admin');
40  $I->click('#dashboard');
41  $I->switchToContentFrame();
42  }
43 
48  {
49  $I->see(self::$defaultDashboardTitle, self::$dashboardActiveSelector);
50  $I->see('About TYPO3', self::$widgetTitleSelector);
51  $I->see('Getting Started with TYPO3', self::$widgetTitleSelector);
52  }
53 
59  {
60  // Create Dashboard
61  $I->click('.dashboard-button-tab-add');
62  $modalDialog->‪canSeeDialog();
63  $I->fillField('#dashboardModalAdd-title', self::$customDashboardTitle);
64  $I->click('button[name="save"]', ‪ModalDialog::$openedModalButtonContainerSelector);
65  $I->switchToContentFrame();
66  $I->see(self::$customDashboardTitle, self::$dashboardActiveSelector);
67 
68  // Add widget
69  $I->waitForElementVisible('.js-dashboard-addWidget');
70  $I->click('.js-dashboard-addWidget');
71  $modalDialog->‪canSeeDialog();
72  $I->click('#dashboard-widgetgroup-tab-systemInfo');
73  $I->click(self::$widgetTitle, ‪ModalDialog::$openedModalSelector);
74  $I->switchToContentFrame();
75  $I->see(self::$widgetTitle, self::$widgetTitleSelector);
76  }
77 
83  public function ‪deleteDashboardAndWidgets(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
84  {
85  // Delete widget
86  $I->click(self::$customDashboardTitle, '.dashboard-tabs');
87  $I->waitForElementVisible('div[data-widget-key="typeOfUsers"] .widget-content-title');
88  $I->click('.js-dashboard-remove-widget');
89  $modalDialog->‪canSeeDialog();
90  $I->click('button[name="delete"]', ‪ModalDialog::$openedModalButtonContainerSelector);
91  $I->switchToContentFrame();
92  $I->seeElement('.dashboard-empty-content');
93 
94  // Delete custom dashboard
95  $I->click('.js-dashboard-delete');
96  $modalDialog->‪canSeeDialog();
97  $I->click('button[name="delete"]', ‪ModalDialog::$openedModalButtonContainerSelector);
98  $I->dontSee(self::$customDashboardTitle, self::$dashboardActiveSelector);
99  }
100 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalSelector
‪static string $openedModalSelector
Definition: ModalDialog.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\seeInitialDashboardAndWidgets
‪seeInitialDashboardAndWidgets(ApplicationTester $I)
Definition: DashboardModuleCest.php:47
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\$dashboardActiveSelector
‪static string $dashboardActiveSelector
Definition: DashboardModuleCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\$widgetTitleSelector
‪static string $widgetTitleSelector
Definition: DashboardModuleCest.php:32
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\createCustomDashboardAndWidgets
‪createCustomDashboardAndWidgets(ApplicationTester $I, ModalDialog $modalDialog)
Definition: DashboardModuleCest.php:58
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\$defaultDashboardTitle
‪static string $defaultDashboardTitle
Definition: DashboardModuleCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalButtonContainerSelector
‪static string $openedModalButtonContainerSelector
Definition: ModalDialog.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\$customDashboardTitle
‪static string $customDashboardTitle
Definition: DashboardModuleCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\_before
‪_before(ApplicationTester $I)
Definition: DashboardModuleCest.php:37
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\deleteDashboardAndWidgets
‪deleteDashboardAndWidgets(ApplicationTester $I, ModalDialog $modalDialog)
Definition: DashboardModuleCest.php:83
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:73
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest
Definition: DashboardModuleCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard\DashboardModuleCest\$widgetTitle
‪static string $widgetTitle
Definition: DashboardModuleCest.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Dashboard
Definition: DashboardModuleCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:27