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