‪TYPO3CMS  ‪main
TaskGroupsCest.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 
26 final class ‪TaskGroupsCest
27 {
28  protected string ‪$groupName = 'My task group';
29 
30  public function ‪_before(‪ApplicationTester $I): void
31  {
32  $I->useExistingSession('admin');
33  $I->scrollTo('[data-modulemenu-identifier="scheduler"]');
34  $I->see('Scheduler', '[data-modulemenu-identifier="scheduler"]');
35  $I->click('[data-modulemenu-identifier="scheduler"]');
36  $I->switchToContentFrame();
37  }
38 
39  public function ‪createASchedulerGroup(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
40  {
41  $I->click('.t3js-create-group', '.module-docheader');
42  $modalDialog->‪canSeeDialog();
43  $I->fillField('input[name="action[createGroup]"]', $this->groupName);
44  $modalDialog->‪clickButtonInDialog('Create group');
45  $I->switchToContentFrame();
46  $I->seeElement('//table//td[contains(., "' . $this->groupName . '")]');
47  }
48 
49  public function ‪addTaskToEmptyGroup(‪ApplicationTester $I): void
50  {
51  $I->click('//table//td[contains(., "' . $this->groupName . '")]/following-sibling::td/*//a[contains(@title, "New task")]');
52  $I->seeOptionIsSelected('#task_group', $this->groupName);
53  $I->fillField('#task_frequency', '0 */2 * * *');
54  $I->click('button[title="Save"]', '.module-docheader');
55  $I->waitForText('The task was added successfully.');
56  $I->click('a[title="Close"]', '.module-docheader');
57  $I->seeElement('//div[contains(@class, "panel-heading")][contains(., "' . $this->groupName . '")]');
58  }
59 
60  public function ‪hideTaskGroup(‪ApplicationTester $I): void
61  {
62  $I->click('//div[contains(@class, "panel-heading")][contains(., "' . $this->groupName . '")]/*//button[contains(@title, "Disable")]');
63 
64  $I->amGoingTo('see group disabled');
65  $I->seeElement('//div[contains(@class, "panel-heading")][contains(., "' . $this->groupName . '")]/*/*[contains(@class, "badge-secondary")]');
66 
67  $I->amGoingTo('see task disabled by group');
68  $I->seeElement('//div[contains(@class, "panel-heading")][contains(., "' . $this->groupName . '")]/following::div//*[contains(@class, "badge-secondary")]');
69  }
70 
71  public function ‪removeGroup(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
72  {
73  $I->amGoingTo('remove tasks from group');
74  $I->click('//div[contains(@class, "panel-heading")][contains(., "' . $this->groupName . '")]//parent::div//table//button[contains(@title, "Delete")]');
75  $modalDialog->‪canSeeDialog();
76  $modalDialog->‪clickButtonInDialog('OK');
77 
78  $I->amGoingTo('remove the empty group');
79  $I->switchToContentFrame();
80  $I->seeElement('//table//td[contains(., "' . $this->groupName . '")]');
81  $I->click('//table//td[contains(., "' . $this->groupName . '")]/following-sibling::td/*//button[contains(@title, "Delete")]');
82  $modalDialog->‪canSeeDialog();
83  $modalDialog->‪clickButtonInDialog('OK');
84  $I->dontSeeElement('//table//td[contains(., "' . $this->groupName . '")]');
85  }
86 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler\TaskGroupsCest\$groupName
‪string $groupName
Definition: TaskGroupsCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler\TaskGroupsCest\addTaskToEmptyGroup
‪addTaskToEmptyGroup(ApplicationTester $I)
Definition: TaskGroupsCest.php:49
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler
Definition: TaskGroupsCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler\TaskGroupsCest\createASchedulerGroup
‪createASchedulerGroup(ApplicationTester $I, ModalDialog $modalDialog)
Definition: TaskGroupsCest.php:39
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:68
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler\TaskGroupsCest\hideTaskGroup
‪hideTaskGroup(ApplicationTester $I)
Definition: TaskGroupsCest.php:60
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler\TaskGroupsCest
Definition: TaskGroupsCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\clickButtonInDialog
‪clickButtonInDialog(string $buttonLinkLocator)
Definition: ModalDialog.php:57
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler\TaskGroupsCest\_before
‪_before(ApplicationTester $I)
Definition: TaskGroupsCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Scheduler\TaskGroupsCest\removeGroup
‪removeGroup(ApplicationTester $I, ModalDialog $modalDialog)
Definition: TaskGroupsCest.php:71
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24