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