‪TYPO3CMS  10.4
TasksCest.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 {
31  public function ‪_before(‪BackendTester $I)
32  {
33  $I->useExistingSession('admin');
34  $I->scrollTo('#system_txschedulerM1');
35  $I->see('Scheduler', '#system_txschedulerM1');
36  $I->click('#system_txschedulerM1');
37  $I->switchToContentFrame();
38  }
39 
44  {
45  $I->see('No tasks defined yet');
46  $I->click('//a[contains(@title, "Add task")]', '.module-docheader');
47  $I->waitForElementNotVisible('#task_SystemStatusUpdateNotificationEmail');
48  $I->selectOption('#task_class', 'System Status Update');
49  $I->seeElement('#task_SystemStatusUpdateNotificationEmail');
50  $I->selectOption('#task_type', 'Single');
51  $I->fillField('#task_SystemStatusUpdateNotificationEmail', 'test@local.typo3.org');
52  $I->click('button.dropdown-toggle', '.module-docheader');
53  $I->wantTo('Click "Save and close"');
54  $I->click("//a[contains(@data-value,'saveclose')]");
55  $I->waitForText('The task was added successfully.');
56  }
57 
62  public function ‪canRunTask(‪BackendTester $I)
63  {
64  // run the task
65  $I->click('a[data-original-title="Run task"]');
66  $I->waitForText('Executed: System Status Update');
67  $I->seeElement('.tx_scheduler_mod1 .disabled');
68  $I->see('disabled');
69  }
70 
75  public function ‪canEditTask(‪BackendTester $I)
76  {
77  $I->click('//a[contains(@data-original-title, "Edit")]');
78  $I->waitForText('Edit task');
79  $I->seeInField('#task_SystemStatusUpdateNotificationEmail', 'test@local.typo3.org');
80  $I->fillField('#task_SystemStatusUpdateNotificationEmail', 'foo@local.typo3.org');
81  $I->click('button.dropdown-toggle', '.module-docheader');
82  $I->wantTo('Click "Save and close"');
83  $I->click("//a[contains(@data-value,'saveclose')]");
84  $I->waitForText('The task was updated successfully.');
85  }
86 
92  {
93  $I->wantTo('See a enable button for a task');
94  $I->click('//a[contains(@data-original-title, "Enable")]', '#tx_scheduler_form');
95  $I->dontSeeElement('.tx_scheduler_mod1 .disabled');
96  $I->dontSee('disabled');
97  $I->wantTo('See a disable button for a task');
98  $I->click('//a[contains(@data-original-title, "Disable")]');
99  $I->waitForElementVisible('div.tx_scheduler_mod1');
100  $I->seeElement('.tx_scheduler_mod1 .disabled');
101  $I->see('disabled');
102  }
103 
109  public function ‪canDeleteTask(‪BackendTester $I, ‪ModalDialog $modalDialog)
110  {
111  $I->wantTo('See a delete button for a task');
112  $I->seeElement('//a[contains(@data-original-title, "Delete")]');
113  $I->click('//a[contains(@data-original-title, "Delete")]');
114  $I->wantTo('Cancel the delete dialog');
115 
116  // don't use $modalDialog->clickButtonInDialog due to too low timeout
117  $modalDialog->canSeeDialog();
118  $I->click('Cancel', ModalDialog::$openedModalButtonContainerSelector);
119  $I->waitForElementNotVisible(ModalDialog::$openedModalSelector, 30);
120 
121  $I->switchToContentFrame();
122  $I->wantTo('Still see and can click the Delete button as the deletion has been canceled');
123  $I->click('//a[contains(@data-original-title, "Delete")]');
124  $modalDialog->clickButtonInDialog('OK');
125  $I->switchToContentFrame();
126  $I->see('The task was successfully deleted.');
127  $I->see('No tasks defined yet');
128  }
129 
134  {
135  $I->selectOption('select[name=SchedulerJumpMenu]', 'Setup check');
136  $I->waitForElementVisible('div.tx_scheduler_mod1');
137  $I->see('Setup check');
138  $I->see('This screen checks if the requisites for running the Scheduler as a cron job are fulfilled');
139  }
140 
145  {
146  $I->selectOption('select[name=SchedulerJumpMenu]', 'Information');
147  $I->waitForElementVisible('div.tx_scheduler_mod1');
148  $I->see('Information');
149  $I->canSeeNumberOfElements('.tx_scheduler_mod1 table tbody tr', [1, 10000]);
150  }
151 
156  {
157  $I->amGoingTo('create a task when none exists yet');
158  $I->canSee('Scheduled tasks', 'h1');
159  $this->‪createASchedulerTask($I);
160 
161  $I->amGoingTo('test the new task group button on task edit view');
162  $I->click('.taskGroup-table > tbody > tr > td.nowrap > span > div:nth-child(1) > a:nth-child(1)');
163  $I->waitForElementNotVisible('#t3js-ui-block');
164  $I->canSee('Edit task', 'h2');
165  $I->click('#task_group_row > div > div > div > div > a');
166  $I->waitForElementNotVisible('#t3js-ui-block');
167  $I->canSee('Create new Scheduler task group on root level', 'h1');
168 
169  $I->fillField('//input[contains(@data-formengine-input-name, "data[tx_scheduler_task_group]") and contains(@data-formengine-input-name, "[groupName]")]', 'new task group');
170  $I->click('button[name="_savedok"]');
171  $I->wait(0.2);
172  $I->waitForElementNotVisible('#t3js-ui-block');
173  $I->click('a[title="Close"]');
174  $I->waitForElementVisible('#tx_scheduler_form');
175 
176  $I->selectOption('select#task_group', 'new task group');
177  $I->click('button[value="save"]');
178  $I->waitForElementNotVisible('#t3js-ui-block');
179  $I->click('a[title="Cancel"]');
180  $I->waitForElementVisible('div.tx_scheduler_mod1');
181 
182  $I->canSee('new task group', '.panel-heading');
183  }
184 }
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\canEnableAndDisableTask
‪canEnableAndDisableTask(BackendTester $I)
Definition: TasksCest.php:91
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\canEditTask
‪canEditTask(BackendTester $I)
Definition: TasksCest.php:75
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\canSwitchToSetupCheck
‪canSwitchToSetupCheck(BackendTester $I)
Definition: TasksCest.php:133
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\canDeleteTask
‪canDeleteTask(BackendTester $I, ModalDialog $modalDialog)
Definition: TasksCest.php:109
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler
Definition: TasksCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest
Definition: TasksCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\_before
‪_before(BackendTester $I)
Definition: TasksCest.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\canCreateNewTaskGroupFromEditForm
‪canCreateNewTaskGroupFromEditForm(BackendTester $I)
Definition: TasksCest.php:155
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\createASchedulerTask
‪createASchedulerTask(BackendTester $I)
Definition: TasksCest.php:43
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\canRunTask
‪canRunTask(BackendTester $I)
Definition: TasksCest.php:62
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler\TasksCest\canSwitchToInformation
‪canSwitchToInformation(BackendTester $I)
Definition: TasksCest.php:144
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:27