TYPO3 CMS  TYPO3_8-7
BookmarkCest.php
Go to the documentation of this file.
1 <?php
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 
21 
26 {
32  public static $topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-shortcuttoolbaritem';
33 
39  protected static $docHeaderBookmarkButtonSelector = '.module-docheader .btn[title="Create a bookmark to this page"]';
40 
44  public function _before(BackendTester $I)
45  {
46  $I->useExistingSession('admin');
47  }
48 
54  {
56  $I->cantSeeElement(self::$topBarModuleSelector . ' .shortcut');
57  return $I;
58  }
59 
66  public function checkThatAddingABookmarkAddsItemToTheBookmarkList(BackendTester $I, ModalDialog $dialog, Scenario $scenario)
67  {
68  // open the scheduler module as we would like to put it into the bookmark liste
69  $I->click('Scheduler', '.scaffold-modulemenu');
70 
71  $I->switchToContentFrame();
72 
73  $I->click(self::$docHeaderBookmarkButtonSelector);
74  // cancel the action to test the functionality
75  // don't use $modalDialog->clickButtonInDialog due to too low timeout
76  $dialog->canSeeDialog();
77  $I->click('Cancel', ModalDialog::$openedModalButtonContainerSelector);
78  $I->waitForElementNotVisible(ModalDialog::$openedModalSelector, 30);
79 
80  // check if the list is still empty
82 
83  $I->switchToContentFrame();
84  $I->click(self::$docHeaderBookmarkButtonSelector);
85 
86  $dialog->clickButtonInDialog('OK');
87 
89  $I->waitForText('Scheduled tasks', 15, self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
90 
91  // @test complete test when https://forge.typo3.org/issues/75689 is fixed
92  $scenario->comment(
93  'Tests for deleting the item in the list and readding it are missing ' .
94  'as this is currently broken in the core. See https://forge.typo3.org/issues/75689'
95  );
96 
97  return $I;
98  }
99 
105  {
107  $I->click('Scheduled tasks', self::$topBarModuleSelector);
108  $I->switchToContentFrame();
109  $I->canSee('Scheduled tasks', 'h1');
110  }
111 
117  {
119  $firstShortcutSelector = self::$topBarModuleSelector . ' .t3js-topbar-shortcut';
120  $I->click('.t3js-shortcut-edit', $firstShortcutSelector);
121  $secondShortcutSelector = self::$topBarModuleSelector . ' form.shortcut-form';
122  $I->fillField($secondShortcutSelector . ' input[name="shortcut-title"]', 'Scheduled tasks renamed');
123  $I->click('.shortcut-form-save', $secondShortcutSelector);
124 
125  // searching in a specific context fails with an "Stale Element Reference Exception"
126  // see http://docs.seleniumhq.org/exceptions/stale_element_reference.jsp
127  // currently don't know how to fix that so we search in the whole context.
128  $I->waitForText('Scheduled tasks renamed');
129  }
130 
136  {
138 
139  $I->canSee('Scheduled tasks renamed', self::$topBarModuleSelector);
140  $I->click('.t3js-shortcut-delete', self::$topBarModuleSelector . ' .t3js-topbar-shortcut');
141  $dialog->clickButtonInDialog('OK');
142 
143  $I->cantSee('Scheduled tasks renamed', self::$topBarModuleSelector);
144  }
145 
150  {
151  $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownToggleSelector);
152  $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
153  }
154 }
checkThatAddingABookmarkAddsItemToTheBookmarkList(BackendTester $I, ModalDialog $dialog, Scenario $scenario)
checkIfDeleteBookmarkWorks(BackendTester $I, ModalDialog $dialog)