‪TYPO3CMS  ‪main
ElementsSelectMultipleSideBySideWithKeyboardCest.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 Facebook\WebDriver\WebDriverKeys;
23 
25 {
26  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
27  {
28  $I->useExistingSession('admin');
29 
30  $I->click('List');
31  $pageTree->‪openPath(['styleguide TCA demo', 'elements select']);
32  $I->switchToContentFrame();
33 
34  $I->waitForText('elements select', 20);
35  $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_select a[aria-label="Edit record"]';
36  $I->click($editRecordLinkCssPath);
37  $I->waitForText('Edit Form', 3, 'h1');
38 
39  $I->click('renderType=selectMultipleSideBySide');
40  }
41 
43  {
44  $fieldset = 'div.typo3-TCEforms > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(4) > fieldset:nth-of-type(1)';
45  $formWizardsWrap = $fieldset . ' .form-wizards-element';
46  $selectAvailable = $formWizardsWrap . ' > div:nth-of-type(1) > div:nth-of-type(2) select';
47 
48  $I->amGoingTo('move the focus to the select with available items');
49  // sets the focus on the left select containing the current selected items
50  // by default only "foo 2" is in the list
51  $I->pressKey($selectAvailable, WebDriverKeys::TAB);
52  $I->pressKey($selectAvailable, WebDriverKeys::ARROW_DOWN);
53 
54  $I->amGoingTo('add the first option by pressing the Enter key');
55  $I->pressKey($selectAvailable, WebDriverKeys::ENTER);
56 
57  $selectSelected = $formWizardsWrap . ' > div:nth-of-type(1) > div:nth-of-type(1) select';
58  $I->see('foo 1', $selectSelected . ' > option:nth-child(2)');
59  }
60 
62  {
63  $fieldset = 'div.typo3-TCEforms > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(4) > fieldset:nth-of-type(1)';
64  $formWizardsWrap = $fieldset . ' .form-wizards-element';
65  $selectSelected = $formWizardsWrap . ' > div:nth-of-type(1) > div:nth-of-type(1) select';
66 
67  $I->amGoingTo('the first item in the list');
68  $I->pressKey($selectSelected, WebDriverKeys::TAB);
69  $I->pressKey($selectSelected, WebDriverKeys::ARROW_DOWN);
70  $I->pressKey($selectSelected, WebDriverKeys::DELETE);
71 
72  $I->dontSee('foo 2', $selectSelected . ' > option:nth-child(1)');
73  }
74 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsSelectMultipleSideBySideWithKeyboardCest\addElementsWithEnterKey
‪addElementsWithEnterKey(ApplicationTester $I)
Definition: ElementsSelectMultipleSideBySideWithKeyboardCest.php:42
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine
Definition: AbstractElementsBasicCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsSelectMultipleSideBySideWithKeyboardCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: ElementsSelectMultipleSideBySideWithKeyboardCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsSelectMultipleSideBySideWithKeyboardCest\removeElementWithDeleteKey
‪removeElementWithDeleteKey(ApplicationTester $I)
Definition: ElementsSelectMultipleSideBySideWithKeyboardCest.php:61
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsSelectMultipleSideBySideWithKeyboardCest
Definition: ElementsSelectMultipleSideBySideWithKeyboardCest.php:25
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26