‪TYPO3CMS  11.5
ElementsBasicInputEvalCest.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('svg .nodes .node');
40  $pageTree->‪openPath(['styleguide TCA demo', 'elements basic']);
41  $I->switchToContentFrame();
42 
43  // Open record and wait until form is ready
44  $I->waitForText('elements basic', 20);
45  $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[aria-label="Edit record"]';
46  $I->click($editRecordLinkCssPath);
47  $I->waitForElementNotVisible('#t3js-ui-block');
48  $I->waitForText('Edit Form', 3, 'h1');
49 
50  // Make sure the test operates on the "input" tab
51  $I->click('input');
52  }
53 
57  protected function ‪simpleEvalInputFieldsDataProvider(): array
58  {
59  return [
60  [
61  'label' => 'input_8',
62  'inputValue' => '12.335',
63  'expectedValue' => '12.34',
64  'expectedInternalValue' => '12.34',
65  'expectedValueAfterSave' => '12.34',
66  'comment' => '',
67  ],
68  [
69  'label' => 'input_8',
70  'inputValue' => '12,335', // comma as delimiter
71  'expectedValue' => '12.34',
72  'expectedInternalValue' => '12.34',
73  'expectedValueAfterSave' => '12.34',
74  'comment' => '',
75  ],
76  [
77  'label' => 'input_8',
78  'inputValue' => '1.1', // dot as delimiter
79  'expectedValue' => '1.10',
80  'expectedInternalValue' => '1.10',
81  'expectedValueAfterSave' => '1.10',
82  'comment' => '',
83  ],
84  [
85  'label' => 'input_8',
86  'inputValue' => 'TYPO3', // word having a number at end
87  'expectedValue' => '3.00',
88  'expectedInternalValue' => '3.00',
89  'expectedValueAfterSave' => '3.00',
90  'comment' => '',
91  ],
92  [
93  'label' => 'input_8',
94  'inputValue' => '3TYPO', // word having a number in front
95  'expectedValue' => '3.00',
96  'expectedInternalValue' => '3.00',
97  'expectedValueAfterSave' => '3.00',
98  'comment' => '',
99  ],
100  [
101  'label' => 'input_9',
102  'inputValue' => '12.335',
103  'expectedValue' => '12',
104  'expectedInternalValue' => '12',
105  'expectedValueAfterSave' => '12',
106  'comment' => '',
107  ],
108  [
109  'label' => 'input_9',
110  'inputValue' => '12,9',
111  'expectedValue' => '129',
112  'expectedInternalValue' => '129',
113  'expectedValueAfterSave' => '129',
114  'comment' => '',
115  ],
127  [
128  'label' => 'input_9',
129  'inputValue' => '3TYPO',
130  'expectedValue' => '3',
131  'expectedInternalValue' => '3',
132  'expectedValueAfterSave' => '3',
133  'comment' => '',
134  ],
135  [
136  'label' => 'input_15',
137  'inputValue' => '12.335',
138  'expectedValue' => '12335',
139  'expectedInternalValue' => '12335',
140  'expectedValueAfterSave' => '12335',
141  'comment' => '',
142  ],
143  [
144  'label' => 'input_15',
145  'inputValue' => '12,9',
146  'expectedValue' => '129',
147  'expectedInternalValue' => '129',
148  'expectedValueAfterSave' => '129',
149  'comment' => '',
150  ],
151  [
152  'label' => 'input_15',
153  'inputValue' => 'TYPO3',
154  'expectedValue' => '3',
155  'expectedInternalValue' => '3',
156  'expectedValueAfterSave' => '3',
157  'comment' => '',
158  ],
159  [
160  'label' => 'input_15',
161  'inputValue' => '3TYPO',
162  'expectedValue' => '3',
163  'expectedInternalValue' => '3',
164  'expectedValueAfterSave' => '3',
165  'comment' => '',
166  ],
167  ];
168  }
169 
175  public function ‪simpleEvalInputFields(‪ApplicationTester $I, Example $testData): void
176  {
177  $this->‪runInputFieldTest($I, $testData);
178  }
179 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputEvalCest
Definition: ElementsBasicInputEvalCest.php:28
‪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\Application\FormEngine\ElementsBasicInputEvalCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: ElementsBasicInputEvalCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree\openPath
‪openPath(array $path)
Definition: PageTree.php:76
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputEvalCest\simpleEvalInputFieldsDataProvider
‪simpleEvalInputFieldsDataProvider()
Definition: ElementsBasicInputEvalCest.php:57
‪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\ElementsBasicInputEvalCest\simpleEvalInputFields
‪simpleEvalInputFields(ApplicationTester $I, Example $testData)
Definition: ElementsBasicInputEvalCest.php:175