[BUGFIX] Streamline iframe namings for new backend
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / Scheduler / TasksCest.php
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
17 use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Admin;
18 use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog;
19
20 /**
21 * Scheduler task tests
22 */
23 class TasksCest
24 {
25 /**
26 * @param Admin $I
27 */
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
36 $I->see('Scheduler', '#system_txschedulerM1');
37 $I->click('Scheduler', '#system_txschedulerM1');
38
39 // switch to content iframe
40 $I->switchToIFrame('list_frame');
41 }
42
43 /**
44 * @param Admin $I
45 * @return Admin
46 */
47 public function createASchedulerTask(Admin $I)
48 {
49 $I->see('No tasks defined yet');
50 $I->click('//a[contains(@title, "Add task")]', '.module-docheader');
51
52 $I->cantSeeElement('#task_SystemStatusUpdateNotificationEmail');
53 $I->selectOption('#task_class', 'System Status Update');
54 $I->seeElement('#task_SystemStatusUpdateNotificationEmail');
55
56 $I->selectOption('#task_type', 'Single');
57
58 $I->fillField('#task_SystemStatusUpdateNotificationEmail', 'test@local.typo3.org');
59
60 $I->click('button.dropdown-toggle', '.module-docheader');
61 $I->wantTo('Click "Save and close"');
62 $I->click("//a[contains(@data-value,'saveclose')]");
63
64 $I->waitForText('The task was added successfully.');
65
66 return $I;
67 }
68
69 /**
70 * @depends createASchedulerTask
71 * @param Admin $I
72 * @return Admin
73 */
74 public function canRunTask(Admin $I)
75 {
76 // run the task
77 $I->click('//a[contains(@title, "Run task")]');
78 $I->waitForText('Executed: System Status Update');
79
80 return $I;
81 }
82
83 /**
84 * @depends createASchedulerTask
85 * @param Admin $I
86 * @param ModalDialog $modalDialog
87 */
88 public function canDeleteTask(Admin $I, ModalDialog $modalDialog)
89 {
90 $I->wantTo('See a delete button for a task');
91 $I->seeElement('//a[contains(@title, "Delete")]');
92
93 $I->click('//a[contains(@title, "Delete")]');
94 $I->wantTo('Cancel the delete dialog');
95 $modalDialog->clickButtonInDialog('Cancel');
96 $I->switchToIFrame('list_frame');
97
98 $I->wantTo('Still see and can click the Delete button as the deletion has been canceled');
99 $I->click('//a[contains(@title, "Delete")]');
100 $modalDialog->clickButtonInDialog('OK');
101
102 $I->switchToIFrame('list_frame');
103 $I->see('The task was successfully deleted.');
104 $I->see('No tasks defined yet');
105 }
106 }