TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
TasksCest.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Scheduler;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
23 class TasksCest
24 {
28  public function _before(Admin $I)
29  {
30  $I->useExistingSession();
31  // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
32  $I->switchToIFrame('list_frame');
33  $I->waitForText('Web Content Management System');
34  $I->switchToIFrame();
35  $I->see('Scheduler', '#system_txschedulerM1');
36  $I->click('Scheduler', '#system_txschedulerM1');
37  // switch to content iframe
38  $I->switchToIFrame('list_frame');
39  }
40 
44  public function createASchedulerTask(Admin $I)
45  {
46  $I->see('No tasks defined yet');
47  $I->click('//a[contains(@title, "Add task")]', '.module-docheader');
48  $I->cantSeeElement('#task_SystemStatusUpdateNotificationEmail');
49  $I->selectOption('#task_class', 'System Status Update');
50  $I->seeElement('#task_SystemStatusUpdateNotificationEmail');
51  $I->selectOption('#task_type', 'Single');
52  $I->fillField('#task_SystemStatusUpdateNotificationEmail', 'test@local.typo3.org');
53  $I->click('button.dropdown-toggle', '.module-docheader');
54  $I->wantTo('Click "Save and close"');
55  $I->click("//a[contains(@data-value,'saveclose')]");
56  $I->waitForText('The task was added successfully.');
57  }
58 
63  public function canRunTask(Admin $I)
64  {
65  // run the task
66  $I->click('//a[contains(@title, "Run task")]');
67  $I->waitForText('Executed: System Status Update');
68  $I->seeElement('.tx_scheduler_mod1 .disabled');
69  $I->see('disabled');
70  }
71 
76  public function canEditTask(Admin $I)
77  {
78  $I->click('//a[contains(@title, "Edit")]');
79  $I->waitForText('Edit task');
80  $I->seeInField('#task_SystemStatusUpdateNotificationEmail', 'test@local.typo3.org');
81  $I->fillField('#task_SystemStatusUpdateNotificationEmail', 'foo@local.typo3.org');
82  $I->click('button.dropdown-toggle', '.module-docheader');
83  $I->wantTo('Click "Save and close"');
84  $I->click("//a[contains(@data-value,'saveclose')]");
85  $I->waitForText('The task was updated successfully.');
86  }
87 
92  public function canEnableAndDisableTask(Admin $I)
93  {
94  $I->wantTo('See a enable button for a task');
95  $I->click('//a[contains(@title, "Enable")]', '#tx_scheduler_form');
96  $I->dontSeeElement('.tx_scheduler_mod1 .disabled');
97  $I->dontSee('disabled');
98  $I->wantTo('See a disable button for a task');
99  $I->click('//a[contains(@title, "Disable")]');
100  $I->seeElement('.tx_scheduler_mod1 .disabled');
101  $I->see('disabled');
102  }
103 
109  public function canDeleteTask(Admin $I, ModalDialog $modalDialog)
110  {
111  $I->wantTo('See a delete button for a task');
112  $I->seeElement('//a[contains(@title, "Delete")]');
113  $I->click('//a[contains(@title, "Delete")]');
114  $I->wantTo('Cancel the delete dialog');
115  $modalDialog->clickButtonInDialog('Cancel');
116  $I->switchToIFrame('list_frame');
117  $I->wantTo('Still see and can click the Delete button as the deletion has been canceled');
118  $I->click('//a[contains(@title, "Delete")]');
119  $modalDialog->clickButtonInDialog('OK');
120  $I->switchToIFrame('list_frame');
121  $I->see('The task was successfully deleted.');
122  $I->see('No tasks defined yet');
123  }
124 
128  public function canSwitchToSetupCheck(Admin $I)
129  {
130  $I->selectOption('select[name=SchedulerJumpMenu]', 'Setup check');
131  $I->see('Setup check');
132  $I->see('This screen checks if the requisites for running the Scheduler as a cron job are fulfilled');
133  }
134 
138  public function canSwitchToInformation(Admin $I)
139  {
140  $I->selectOption('select[name=SchedulerJumpMenu]', 'Information');
141  $I->see('Information');
142  $I->canSeeNumberOfElements('.tx_scheduler_mod1 table tbody tr', [1, 10000]);
143  }
144 }
canDeleteTask(Admin $I, ModalDialog $modalDialog)
Definition: TasksCest.php:109