4d11892e062ad50cdb657f09314f5f3d6ac42404
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / Topbar / SearchCest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Topbar;
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\Topbar;
19
20 /**
21 * Test the search module in the top bar
22 */
23 class SearchCest
24 {
25 /**
26 * Selector for the module container in the topbar
27 *
28 * @var string
29 */
30 public static $topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-livesearchtoolbaritem';
31
32 /**
33 * @param Admin $I
34 */
35 public function _before(Admin $I)
36 {
37 $I->useExistingSession();
38 }
39
40 /**
41 * @param Admin $I
42 */
43 public function searchAndTestIfAutocompletionWorks(Admin $I)
44 {
45 $I->cantSeeElement(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
46 $I->fillField('#live-search-box', 'adm');
47 $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
48
49 $I->canSee('Backend user', self::$topBarModuleSelector);
50 $I->click('.icon-status-user-admin', self::$topBarModuleSelector);
51
52 $I->switchToIFrame('contentIframe');
53 $I->waitForElementVisible('#EditDocumentController');
54 $I->canSee('Edit Backend user "admin" on root level');
55 }
56
57 /**
58 * @param Admin $I
59 */
60 public function searchForFancyTextAndCheckEmptyResultInfo(Admin $I)
61 {
62 $I->fillField('#live-search-box', 'Kasper = Jesus # joh316');
63 $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
64
65 // tod0: check why TYPO3 does not return a result for "Kasper" by itself
66 $I->canSee('No results found.', self::$topBarModuleSelector);
67
68 $I->click(self::$topBarModuleSelector . ' .close');
69 $I->waitForElementNotVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
70 $I->cantSeeInField('#live-search-box', 'Kasper = Jesus # joh316');
71 }
72
73 /**
74 * @param Admin $I
75 */
76 public function checkIfTheShowAllLinkPointsToTheListViewWithSearchResults(Admin $I)
77 {
78 $I->fillField('#live-search-box', 'fileadmin');
79 $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
80
81 $I->canSee('fileadmin/ (auto-created)', self::$topBarModuleSelector);
82 $I->click('.t3js-live-search-show-all', self::$topBarModuleSelector);
83
84 $I->switchToIFrame('contentIframe');
85 $I->waitForElementVisible('form[name="dblistForm"]');
86 $I->canSee('fileadmin/ (auto-created)');
87 }
88 }