‪TYPO3CMS  11.5
SearchCest.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 
21 use TYPO3\TestingFramework\Core\Acceptance\Helper\Topbar;
22 
27 {
33  public static string ‪$topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-livesearchtoolbaritem';
34 
35  public function ‪_before(‪ApplicationTester $I): void
36  {
37  $I->useExistingSession('admin');
38  }
39 
41  {
42  $I->cantSeeElement(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
43  $I->fillField('#live-search-box', 'adm');
44  $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
45 
46  $I->canSee('Backend user', self::$topBarModuleSelector);
47  $I->click('admin', self::$topBarModuleSelector);
48 
49  $I->switchToContentFrame();
50  $I->waitForElementVisible('#EditDocumentController');
51  $I->canSee('Edit Backend user "admin" on root level');
52  }
53 
55  {
56  $I->fillField('#live-search-box', 'Kasper = Jesus # joh316');
57  $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector, 100);
58 
59  // tod0: check why TYPO3 does not return a result for "Kasper" by itself
60  $I->canSee('No results found.', self::$topBarModuleSelector);
61 
62  $I->click(self::$topBarModuleSelector . ' .close');
63  $I->waitForElementNotVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector, 100);
64  $I->cantSeeInField('#live-search-box', 'Kasper = Jesus # joh316');
65  }
66 
68  {
69  $I->fillField('#live-search-box', 'fileadmin');
70  $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
71 
72  $I->canSee('fileadmin', self::$topBarModuleSelector);
73  $I->click('.t3js-live-search-show-all', self::$topBarModuleSelector);
74 
75  $I->switchToContentFrame();
76 
77  // Search word is transferred to the recordlist search form
78  $I->seeInField('#search_field', 'fileadmin');
79 
80  // Correct table and element is displayed
81  $I->waitForElementVisible('form[name="list-table-form-sys_file_storage"]');
82  $I->canSee('fileadmin', 'form[name="list-table-form-sys_file_storage"] a');
83  }
84 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\SearchCest\searchAndTestIfAutocompletionWorks
‪searchAndTestIfAutocompletionWorks(ApplicationTester $I)
Definition: SearchCest.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\SearchCest\searchForFancyTextAndCheckEmptyResultInfo
‪searchForFancyTextAndCheckEmptyResultInfo(ApplicationTester $I)
Definition: SearchCest.php:54
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar
Definition: BookmarkCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\SearchCest\_before
‪_before(ApplicationTester $I)
Definition: SearchCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\SearchCest\$topBarModuleSelector
‪static string $topBarModuleSelector
Definition: SearchCest.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\SearchCest\checkIfTheShowAllLinkPointsToTheListViewWithSearchResults
‪checkIfTheShowAllLinkPointsToTheListViewWithSearchResults(ApplicationTester $I)
Definition: SearchCest.php:67
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar\SearchCest
Definition: SearchCest.php:27