2 declare(strict_types = 1);
34 $I->useExistingSession(
'admin');
37 $pageTree->openPath([
'styleguide TCA demo',
'elements group']);
38 $I->switchToContentFrame();
40 $I->executeJS(
'window.name="TYPO3Main";');
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');
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';
57 $selectOption1 =
'styleguide demo user 1';
58 $multiselect = [
'styleguide demo user 1',
'styleguide demo user 2'];
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)');
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)');
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)');
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)');
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)');
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)');
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)';
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)');
104 $I->switchToWindow();
105 $I->switchToIFrame(
'modal_frame');
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)');
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);
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)';
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)');
126 $I->switchToWindow();
127 $I->switchToIFrame(
'modal_frame');
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)');
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);
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)';
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)');
150 $I->switchToWindow();
151 $I->switchToIFrame(
'modal_frame');
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);
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);
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');
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');
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');
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"]');