‪TYPO3CMS  10.4
ElementsGroupCest.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 
22 
27 {
34  public function ‪_before(‪BackendTester $I, ‪PageTree $pageTree)
35  {
36  $I->useExistingSession('admin');
37 
38  $I->click('List');
39  $pageTree->openPath(['styleguide TCA demo', 'elements group']);
40  $I->switchToContentFrame();
41 
42  $I->executeJS('window.name="TYPO3Main";');
43 
44  $I->waitForText('elements group', 20);
45  $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_group a[data-original-title="Edit record"]';
46  $I->click($editRecordLinkCssPath);
47  $I->waitForText('Edit Form', 3, 'h1');
48  }
49 
54  {
55  $fieldset = 'div.typo3-TCEforms > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > fieldset:nth-of-type(1)';
56  $formWizardsWrap = $fieldset . ' > div:nth-of-type(1) div.t3js-formengine-field-item > div:nth-of-type(1)';
57  $select = $formWizardsWrap . ' > div:nth-of-type(2) > select';
58 
59  $selectOption1 = 'styleguide demo user 1';
60  $multiselect = ['styleguide demo user 1', 'styleguide demo user 2'];
61 
62  $I->amGoingTo('put "' . $selectOption1 . '" on first position');
63  $I->selectOption($select, $selectOption1);
64  $I->click($formWizardsWrap . ' div:nth-of-type(3) > div > a.t3js-btn-moveoption-top');
65  $I->see($selectOption1, $select . ' > option:nth-child(1)');
66 
67  $I->amGoingTo('put "' . $selectOption1 . '" one position down / on the second position');
68  $I->selectOption($select, $selectOption1);
69  $I->click($formWizardsWrap . ' div:nth-of-type(3) > div > a.t3js-btn-moveoption-down');
70  $I->see($selectOption1, $select . ' > option:nth-child(2)');
71 
72  $I->amGoingTo('put "' . $selectOption1 . '" on the last position');
73  $I->selectOption($select, $selectOption1);
74  $I->click($formWizardsWrap . ' div:nth-of-type(3) > div > a.t3js-btn-moveoption-bottom');
75  $I->see($selectOption1, $select . ' > option:nth-last-child(1)');
76 
77  $I->amGoingTo('put "' . $selectOption1 . '" one position up / on second last position');
78  $I->selectOption($select, $selectOption1);
79  $I->click($formWizardsWrap . ' div:nth-of-type(3) > div > a.t3js-btn-moveoption-up');
80  $I->see($selectOption1, $select . ' > option:nth-last-child(2)');
81 
82  $I->amGoingTo('put ' . print_r($multiselect, true) . ' on first position');
83  $I->selectOption($select, $multiselect);
84  $I->click($formWizardsWrap . ' div:nth-of-type(3) > div > a.t3js-btn-moveoption-top');
85  $I->see($multiselect[0], $select . ' > option:nth-child(1)');
86  $I->see($multiselect[1], $select . ' > option:nth-child(2)');
87 
88  $I->amGoingTo('put ' . print_r($multiselect, true) . ' one position down');
89  $I->selectOption($select, $multiselect);
90  $I->click($formWizardsWrap . ' div:nth-of-type(3) > div > a.t3js-btn-moveoption-down');
91  $I->see($multiselect[0], $select . ' > option:nth-child(2)');
92  $I->see($multiselect[1], $select . ' > option:nth-child(3)');
93  }
94 
99  {
100  $fieldset = 'div.typo3-TCEforms > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > fieldset:nth-of-type(1)';
101  $formWizardsWrap = $fieldset . ' > div:nth-of-type(1) div.t3js-formengine-field-item > div:nth-of-type(1)';
102 
103  $I->seeNumberOfElements('select[data-formengine-input-name="data[tx_styleguide_elements_group][1][group_db_1]"] option', 4);
104  $I->click($formWizardsWrap . ' div:nth-of-type(4) > div > a:nth-of-type(1)');
105 
106  $I->switchToWindow();
107  $I->switchToIFrame('modal_frame');
108 
109  $I->amGoingTo('click + button to select record and close DB-Browser');
110  $I->click('#recordlist-be_users > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
111 
112  $I->switchToWindow();
113  $I->switchToContentFrame();
114  $I->seeNumberOfElements('select[data-formengine-input-name="data[tx_styleguide_elements_group][1][group_db_1]"] option', 5);
115  }
116 
121  {
122  $fieldset = 'div.typo3-TCEforms > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > fieldset:nth-of-type(1)';
123  $formWizardsWrap = $fieldset . ' > div:nth-of-type(1) div.t3js-formengine-field-item > div:nth-of-type(1)';
124 
125  $I->seeNumberOfElements('select[data-formengine-input-name="data[tx_styleguide_elements_group][1][group_db_1]"] option', 4);
126  $I->click($formWizardsWrap . ' div:nth-of-type(4) > div > a:nth-of-type(1)');
127 
128  $I->switchToWindow();
129  $I->switchToIFrame('modal_frame');
130 
131  $I->amGoingTo('click record + in DB-Browser');
132  $I->click('#recordlist-be_groups > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
133  $I->amGoingTo('click + button to select record and close DB-Browser');
134  $I->click('#recordlist-be_users > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
135 
136  $I->switchToWindow();
137  $I->switchToContentFrame();
138  $I->seeNumberOfElements('select[data-formengine-input-name="data[tx_styleguide_elements_group][1][group_db_1]"] option', 6);
139  }
140 
145  {
146  $fieldset = 'div.typo3-TCEforms > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > fieldset:nth-of-type(1)';
147  $formWizardsWrap = $fieldset . ' > div:nth-of-type(1) div.t3js-formengine-field-item > div:nth-of-type(1)';
148 
149  $I->seeNumberOfElements('select[data-formengine-input-name="data[tx_styleguide_elements_group][1][group_db_1]"] option', 4);
150  $I->click($formWizardsWrap . ' div:nth-of-type(4) > div > a:nth-of-type(1)');
151 
152  $I->switchToWindow();
153  $I->switchToIFrame('modal_frame');
154 
155  $I->amGoingTo("search record '' and limit 1 in DB-Browser");
156  $I->fillField('#showLimit', 1);
157  $I->click('button[name="search"]');
158  $I->waitForElement('.recordlist');
159  $I->seeNumberOfElements('.recordlist #recordlist-be_groups table tbody tr', 1);
160 
161  $I->amGoingTo('search record style and limit 1 in DB-Browser');
162  $I->fillField('#search_field', 'style');
163  $I->click('button[name="search"]');
164  $I->waitForElement('.recordlist');
165  $I->seeNumberOfElements('.recordlist #recordlist-be_groups table tbody tr', 1);
166 
167  $I->amGoingTo('reset limit');
168  $I->fillField('#showLimit', '');
169  $I->amGoingTo('search record foo in DB-Browser');
170  $I->fillField('#search_field', 'foo');
171  $I->click('button[name="search"]');
172  $I->waitForElementNotVisible('.recordlist');
173 
174  $I->amGoingTo('search record admin in DB-Browser');
175  $I->fillField('#search_field', 'admin');
176  $I->click('button[name="search"]');
177  $I->waitForElement('.recordlist');
178  $I->see('admin', '.recordlist');
179 
180  $I->amGoingTo('click + button to select record and close DB-Browser');
181  $I->click('#recordlist-be_users > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
182  $I->switchToWindow();
183  $I->click('.t3js-modal-close');
184 
185  $I->switchToContentFrame();
186  $I->see('admin', 'select[data-formengine-input-name="data[tx_styleguide_elements_group][1][group_db_1]"]');
187  $I->click('.btn-toolbar button.btn:nth-child(2)');
188  $I->click('button[name="_savedok"]');
189  }
190 }
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsGroupCest\sortElementsInGroup
‪sortElementsInGroup(BackendTester $I)
Definition: ElementsGroupCest.php:53
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsGroupCest\searchForARecordWithRecordBrowserGroup
‪searchForARecordWithRecordBrowserGroup(BackendTester $I)
Definition: ElementsGroupCest.php:144
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsGroupCest\_before
‪_before(BackendTester $I, PageTree $pageTree)
Definition: ElementsGroupCest.php:34
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsGroupCest
Definition: ElementsGroupCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsGroupCest\addTwoRecordWithRecordBrowserGroup
‪addTwoRecordWithRecordBrowserGroup(BackendTester $I)
Definition: ElementsGroupCest.php:120
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsGroupCest\addARecordWithRecordBrowserGroup
‪addARecordWithRecordBrowserGroup(BackendTester $I)
Definition: ElementsGroupCest.php:98
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine
Definition: AbstractElementsBasicCest.php:18