‪TYPO3CMS  11.5
ElementsBasicInputSimpleCest.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 Codeception\Example;
23 
28 {
35  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
36  {
37  $I->useExistingSession('admin');
38  $I->click('List');
39  $I->waitForElement('#typo3-pagetree-tree .nodes .node', 5);
40  $pageTree->‪openPath(['styleguide TCA demo', 'elements basic']);
41  // Wait until DOM actually rendered everything
42  $I->waitForElement('#typo3-pagetree-tree .nodes .node', 5);
43  $I->switchToContentFrame();
44 
45  // Open record and wait until form is ready
46  $I->waitForText('elements basic', 20);
47  $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[aria-label="Edit record"]';
48  $I->click($editRecordLinkCssPath);
49  $I->waitForElementNotVisible('#t3js-ui-block');
50  $I->waitForText('Edit Form', 3, 'h1');
51  }
52 
56  protected function ‪simpleInputFieldsDataProvider(): array
57  {
58  return [
59  [
60  'label' => 'input_1',
61  'inputValue' => 'This is a demo text',
62  'expectedValue' => 'This is a demo text',
63  'expectedInternalValue' => 'This is a demo text',
64  'expectedValueAfterSave' => 'This is a demo text',
65  'comment' => '',
66  ],
67  [
68  'label' => 'input_2',
69  'inputValue' => 'This is a demo text with numbers and other characters 42 #!',
70  'expectedValue' => 'This is a demo text with numbers and other characters 42 #!',
71  'expectedInternalValue' => 'This is a demo text with numbers and other characters 42 #!',
72  'expectedValueAfterSave' => 'This is a demo text with numbers and other characters 42 #!',
73  'comment' => '',
74  ],
75  [
76  'label' => 'input_3',
77  'inputValue' => 'Kasper',
78  'expectedValue' => 'Kasp',
79  'expectedInternalValue' => 'Kasp',
80  'expectedValueAfterSave' => 'Kasp',
81  'comment' => '',
82  ],
83  [
84  'label' => 'input_4',
85  'inputValue' => 'Kasper = TYPO3',
86  'expectedValue' => 'KasperTYPO',
87  'expectedInternalValue' => 'KasperTYPO',
88  'expectedValueAfterSave' => 'KasperTYPO',
89  'comment' => '',
90  ],
91  [
92  'label' => 'input_4',
93  'inputValue' => 'Non-latin characters: ŠĐŽĆČ',
94  'expectedValue' => 'Nonlatincharacters',
95  'expectedInternalValue' => 'Nonlatincharacters',
96  'expectedValueAfterSave' => 'Nonlatincharacters',
97  'comment' => '',
98  ],
99  [
100  'label' => 'input_5',
101  'inputValue' => 'Kasper = TYPO3',
102  'expectedValue' => 'KasperTYPO3',
103  'expectedInternalValue' => 'KasperTYPO3',
104  'expectedValueAfterSave' => 'KasperTYPO3',
105  'comment' => '',
106  ],
107  [
108  'label' => 'input_10',
109  'inputValue' => 'abcd1234',
110  'expectedValue' => 'abc123',
111  'expectedInternalValue' => 'abc123',
112  'expectedValueAfterSave' => 'abc123',
113  'comment' => '',
114  ],
115  [
116  'label' => 'input_10',
117  'inputValue' => 'Kasper TYPO3',
118  'expectedValue' => 'a3',
119  'expectedInternalValue' => 'a3',
120  'expectedValueAfterSave' => 'a3',
121  'comment' => '',
122  ],
123  [
124  'label' => 'input_11',
125  'inputValue' => 'Kasper TYPO3!',
126  'expectedValue' => 'kasper typo3!',
127  'expectedInternalValue' => 'kasper typo3!',
128  'expectedValueAfterSave' => 'kasper typo3!',
129  'comment' => '',
130  ],
131  [
132  'label' => 'input_13',
133  'inputValue' => ' Kasper TYPO3! ',
134  'expectedValue' => 'KasperTYPO3!',
135  'expectedInternalValue' => 'KasperTYPO3!',
136  'expectedValueAfterSave' => 'KasperTYPO3!',
137  'comment' => '',
138  ],
139  [
140  'label' => 'input_16',
141  'inputValue' => 'Kasper',
142  'expectedValue' => '********',
143  'expectedInternalValue' => 'Kasper',
144  // even if `password_2` is not hashed, it never should expose the value
145  'expectedValueAfterSave' => '*********',
146  'comment' => '',
147  ],
148  [
149  'label' => 'input_19',
150  'inputValue' => ' Kasper ',
151  'expectedValue' => 'Kasper',
152  'expectedInternalValue' => 'Kasper',
153  'expectedValueAfterSave' => 'Kasper',
154  'comment' => '',
155  ],
156  [
157  'label' => 'input_19',
158  'inputValue' => ' Kasper TYPO3 ',
159  'expectedValue' => 'Kasper TYPO3',
160  'expectedInternalValue' => 'Kasper TYPO3',
161  'expectedValueAfterSave' => 'Kasper TYPO3',
162  'comment' => '',
163  ],
164  [
165  'label' => 'input_23',
166  'inputValue' => 'Kasper TYPO3!',
167  'expectedValue' => 'KASPER TYPO3!',
168  'expectedInternalValue' => 'KASPER TYPO3!',
169  'expectedValueAfterSave' => 'KASPER TYPO3!',
170  'comment' => '',
171  ],
172  [
173  'label' => 'input_24',
174  'inputValue' => '2016',
175  'expectedValue' => '2016',
176  'expectedInternalValue' => '2016',
177  'expectedValueAfterSave' => '2016',
178  'comment' => '',
179  ],
180  [
181  'label' => 'input_24',
182  'inputValue' => '12',
183  'expectedValue' => '12',
184  'expectedInternalValue' => '12',
185  'expectedValueAfterSave' => '12',
186  'comment' => '',
187  ],
188  [
189  'label' => 'input_24',
190  'inputValue' => 'Kasper',
191  'expectedValue' => date('Y'),
192  'expectedInternalValue' => date('Y'),
193  'expectedValueAfterSave' => date('Y'),
194  'comment' => 'Invalid character is converted to current year',
195  ],
196  ];
197  }
198 
204  public function ‪simpleInputFields(‪ApplicationTester $I, Example $testData): void
205  {
206  $this->‪runInputFieldTest($I, $testData);
207  }
208 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputSimpleCest
Definition: ElementsBasicInputSimpleCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputSimpleCest\simpleInputFields
‪simpleInputFields(ApplicationTester $I, Example $testData)
Definition: ElementsBasicInputSimpleCest.php:204
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine
Definition: AbstractElementsBasicCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree\openPath
‪openPath(array $path)
Definition: PageTree.php:76
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\AbstractElementsBasicCest\runInputFieldTest
‪runInputFieldTest(ApplicationTester $I, Example $testData)
Definition: AbstractElementsBasicCest.php:38
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\AbstractElementsBasicCest
Definition: AbstractElementsBasicCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputSimpleCest\simpleInputFieldsDataProvider
‪simpleInputFieldsDataProvider()
Definition: ElementsBasicInputSimpleCest.php:56
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputSimpleCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: ElementsBasicInputSimpleCest.php:35