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