‪TYPO3CMS  ‪main
BookmarkCest.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 
20 use Codeception\Scenario;
23 use TYPO3\TestingFramework\Core\Acceptance\Helper\Topbar;
24 
28 final class ‪BookmarkCest
29 {
33  private static string ‪$topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-shortcuttoolbaritem';
34 
38  private static string ‪$docHeaderBookmarkButtonSelector = 'button[title="Share"]';
39 
40  public function ‪_before(‪ApplicationTester $I): void
41  {
42  $I->useExistingSession('admin');
43  }
44 
46  {
48  $I->cantSeeElement(self::$topBarModuleSelector . ' .shortcut');
49  }
50 
52  {
53  // open the scheduler module as we would like to put it into the bookmark list
54  $I->click('Scheduler', '.scaffold-modulemenu');
55 
56  $I->switchToContentFrame();
57 
58  $I->click(self::$docHeaderBookmarkButtonSelector);
59  $I->waitForElementVisible('.module-docheader .dropdown-menu');
60  $I->click('.module-docheader .dropdown-menu button:nth-of-type(1)');
61 
62  $I->switchToMainFrame();
64  $I->waitForText('Scheduled tasks', 15, self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
65 
66  // @test complete test when https://forge.typo3.org/issues/75689 is fixed
67  $scenario->comment(
68  'Tests for deleting the item in the list and re-adding it are missing ' .
69  'as this is currently broken in the core. See https://forge.typo3.org/issues/75689'
70  );
71 
72  return $I;
73  }
74 
79  {
81  $I->click('Scheduled tasks', self::$topBarModuleSelector);
82  $I->switchToContentFrame();
83  $I->canSee('Scheduled tasks', 'h1');
84  }
85 
90  {
92  $firstShortcutSelector = self::$topBarModuleSelector . ' .t3js-topbar-shortcut';
93  $I->click('.t3js-shortcut-edit', $firstShortcutSelector);
94  $secondShortcutSelector = self::$topBarModuleSelector . ' form.t3js-shortcut-form';
95  $I->waitForElementVisible($secondShortcutSelector . ' input[name="shortcutTitle"]');
96  $I->fillField($secondShortcutSelector . ' input[name="shortcutTitle"]', 'Scheduled tasks renamed');
97  $I->click('input[type="submit"]', $secondShortcutSelector);
98 
99  // searching in a specific context fails with a "Stale Element Reference Exception"
100  // see http://docs.seleniumhq.org/exceptions/stale_element_reference.jsp
101  // currently don't know how to fix that so we search in the whole context.
102  $I->waitForText('Scheduled tasks renamed');
103  }
104 
109  {
111 
112  $I->canSee('Scheduled tasks renamed', self::$topBarModuleSelector);
113  $I->click('.t3js-shortcut-delete', self::$topBarModuleSelector . ' .t3js-topbar-shortcut');
114  $dialog->‪clickButtonInDialog('OK');
115  $I->waitForElementNotVisible('Scheduled tasks renamed');
116  $I->cantSee('Scheduled tasks renamed', self::$topBarModuleSelector);
117  }
118 
120  {
121  $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownToggleSelector);
122  $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
123  }
124 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\clickBookmarkDropdownToggleInTopbar
‪clickBookmarkDropdownToggleInTopbar(ApplicationTester $I)
Definition: BookmarkCest.php:119
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\checkThatAddingABookmarkAddsItemToTheBookmarkList
‪checkThatAddingABookmarkAddsItemToTheBookmarkList(ApplicationTester $I, Scenario $scenario)
Definition: BookmarkCest.php:51
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\checkIfDeleteBookmarkWorks
‪checkIfDeleteBookmarkWorks(ApplicationTester $I, ModalDialog $dialog)
Definition: BookmarkCest.php:108
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\checkIfEditBookmarkItemWorks
‪checkIfEditBookmarkItemWorks(ApplicationTester $I)
Definition: BookmarkCest.php:89
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar
Definition: BookmarkCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\$topBarModuleSelector
‪static string $topBarModuleSelector
Definition: BookmarkCest.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest
Definition: BookmarkCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\checkIfBookmarkItemLinksToTarget
‪checkIfBookmarkItemLinksToTarget(ApplicationTester $I)
Definition: BookmarkCest.php:78
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\clickButtonInDialog
‪clickButtonInDialog(string $buttonLinkLocator)
Definition: ModalDialog.php:57
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\_before
‪_before(ApplicationTester $I)
Definition: BookmarkCest.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\$docHeaderBookmarkButtonSelector
‪static string $docHeaderBookmarkButtonSelector
Definition: BookmarkCest.php:38
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\BookmarkCest\checkThatBookmarkListIsInitiallyEmpty
‪checkThatBookmarkListIsInitiallyEmpty(ApplicationTester $I)
Definition: BookmarkCest.php:45