[TASK] Enable v8 acceptance testing again
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / FormEngine / ElementsBasicInputRangeCest.php
1 <?php
2 declare(strict_types = 1);
3 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine;
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
18 use Codeception\Example;
19 use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
20 use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree;
21
22 /**
23 * Tests for "elements_basic" range input fields of ext:styleguide
24 */
25 class ElementsBasicInputRangeCest extends AbstractElementsBasicCest
26 {
27 /**
28 * Open list module of styleguide elements basic page
29 *
30 * @param BackendTester $I
31 * @param PageTree $pageTree
32 */
33 public function _before(BackendTester $I, PageTree $pageTree)
34 {
35 $I->useExistingSession('admin');
36 $I->click('List');
37 $pageTree->openPath(['styleguide TCA demo', 'elements basic']);
38 $I->switchToContentFrame();
39
40 // Open record and wait until form is ready
41 $I->waitForText('elements basic', 20);
42 $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[data-original-title="Edit record"]';
43 $I->click($editRecordLinkCssPath);
44 $I->waitForElementNotVisible('#t3js-ui-block');
45 $I->waitForText('Edit Form', 3, 'h1');
46 }
47
48 /**
49 * type=input range and md5 field tests
50 */
51 protected function simpleRangeAndMd5FieldsDataProvider()
52 {
53 return [
54 /**
55 [
56 // @todo this one probably broke with the type="number" patch
57 'label' => 'input_25 eval=int, default=0, range lower=-2, range upper=2',
58 'inputValue' => 'Kasper TYPO3',
59 'expectedValue' => '0',
60 'expectedInternalValue' => '0',
61 'expectedValueAfterSave' => '0',
62 'comment' => '',
63 ],
64 */
65 [
66 'label' => 'input_25 eval=int, default=0, range lower=-2, range upper=2',
67 'inputValue' => '2',
68 'expectedValue' => '2',
69 'expectedInternalValue' => '2',
70 'expectedValueAfterSave' => '2',
71 'comment' => '',
72 ],
73 [
74 'label' => 'input_25 eval=int, default=0, range lower=-2, range upper=2',
75 'inputValue' => '-1',
76 'expectedValue' => '-1',
77 'expectedInternalValue' => '-1',
78 'expectedValueAfterSave' => '-1',
79 'comment' => '',
80 ],
81 [
82 'label' => 'input_12 eval=md5',
83 'inputValue' => 'Kasper TYPO3!',
84 'expectedValue' => '748469dd64911af8df8f9a3dcb2c9378',
85 'expectedInternalValue' => '748469dd64911af8df8f9a3dcb2c9378',
86 'expectedValueAfterSave' => '748469dd64911af8df8f9a3dcb2c9378',
87 'comment' => '',
88 ],
89 [
90 'label' => 'input_12 eval=md5',
91 'inputValue' => ' Kasper TYPO3! ',
92 'expectedValue' => '792a085606250c47d6ebb8c98804d5b0',
93 'expectedInternalValue' => '792a085606250c47d6ebb8c98804d5b0',
94 'expectedValueAfterSave' => '792a085606250c47d6ebb8c98804d5b0',
95 'comment' => 'Check whitespaces are not trimmed.',
96 ],
97 ];
98 }
99
100 /**
101 * @dataProvider simpleRangeAndMd5FieldsDataProvider
102 * @param BackendTester $I
103 * @param Example $testData
104 */
105 public function simpleRangeAndMd5Fields(BackendTester $I, Example $testData)
106 {
107 $this->runInputFieldTest($I, $testData);
108 }
109 }