[TASK] Split long running acceptance test into smaller pieces 60/51660/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Mon, 13 Feb 2017 19:02:13 +0000 (20:02 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Wed, 15 Feb 2017 16:52:13 +0000 (17:52 +0100)
The formengine validation test is splitted into few smaller tests.

Releases: master
Resolves: #79788
Change-Id: I8a44c02e77bad9b26d33aa17a1d18f2c9edd26ff
Reviewed-on: https://review.typo3.org/51660
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicCest.php

index 3af991a..9a9a183 100644 (file)
@@ -48,7 +48,7 @@ class ElementsBasicCest
      * @param Admin $I
      * @param Formhandler $formhandler
      */
-    public function checkThatBrowserSideValidationsWorkAndSaveRecord(Admin $I, Formhandler $formhandler)
+    public function checkThatBrowserSideValidationsWorksForTextAndSaveRecord(Admin $I, Formhandler $formhandler)
     {
         $this->waitForFormReady($I);
 
@@ -88,6 +88,70 @@ class ElementsBasicCest
                 ),
 
             ],
+            'input_10 eval=is_in, is_in=abc123' => [
+                new FormHandlerElementTestDataObject(
+                    'abcd1234',
+                    'abc123'
+                ),
+                new FormHandlerElementTestDataObject(
+                    'Kasper TYPO3',
+                    'a3'
+                )
+            ],
+            'input_11 eval=lower' => [
+                new FormHandlerElementTestDataObject(
+                    'Kasper TYPO3!',
+                    'kasper typo3!'
+                )
+            ],
+            'input_13 eval=nospace' => [
+                new FormHandlerElementTestDataObject(
+                    ' Kasper TYPO3! ',
+                    'KasperTYPO3!'
+                )
+            ],
+            'input_16 eval=password' => [
+                new FormHandlerElementTestDataObject(
+                    'Kasper',
+                    '********',
+                    'Kasper'
+                ),
+            ],
+            'input_19 eval=trim' => [
+                new FormHandlerElementTestDataObject(
+                    ' Kasper ',
+                    'Kasper'
+                ),
+                new FormHandlerElementTestDataObject(
+                    ' Kasper TYPO3 ',
+                    'Kasper TYPO3'
+                ),
+            ],
+            'input_23 eval=upper' => [
+                new FormHandlerElementTestDataObject(
+                    'Kasper TYPO3!',
+                    'KASPER TYPO3!'
+                )
+            ],
+        ];
+        foreach ($fieldTests as $fieldLabel => $testData) {
+            $formhandler->fillSeeSaveAndClearInputField(
+                $fieldLabel,
+                $testData
+            );
+        }
+    }
+
+    /**
+     * @param Admin $I
+     * @param Formhandler $formhandler
+     */
+    public function checkThatBrowserSideValidationsWorkForNumericAndSaveRecord(Admin $I, Formhandler $formhandler)
+    {
+        $this->waitForFormReady($I);
+
+        $fieldTests = [
+
             'input_8 eval=double2' => [
                 new FormHandlerElementTestDataObject(
                     '12.335',
@@ -138,43 +202,6 @@ class ElementsBasicCest
                     '3'
                 )
             ],
-            'input_10 eval=is_in, is_in=abc123' => [
-                new FormHandlerElementTestDataObject(
-                    'abcd1234',
-                    'abc123'
-                ),
-                new FormHandlerElementTestDataObject(
-                    'Kasper TYPO3',
-                    'a3'
-                )
-            ],
-            'input_11 eval=lower' => [
-                new FormHandlerElementTestDataObject(
-                    'Kasper TYPO3!',
-                    'kasper typo3!'
-                )
-            ],
-            'input_12 eval=md5' => [
-                new FormHandlerElementTestDataObject(
-                    'Kasper TYPO3!',
-                    '748469dd64911af8df8f9a3dcb2c9378',
-                    '748469dd64911af8df8f9a3dcb2c9378'
-                ),
-                new FormHandlerElementTestDataObject(
-                    ' Kasper TYPO3! ',
-                    '792a085606250c47d6ebb8c98804d5b0',
-                    '792a085606250c47d6ebb8c98804d5b0',
-                    '792a085606250c47d6ebb8c98804d5b0',
-                    false,
-                    'Check that whitespaces are not trimmed.'
-                )
-            ],
-            'input_13 eval=nospace' => [
-                new FormHandlerElementTestDataObject(
-                    ' Kasper TYPO3! ',
-                    'KasperTYPO3!'
-                )
-            ],
             'input_15 eval=num' => [
                 new FormHandlerElementTestDataObject(
                     '12.335',
@@ -193,29 +220,26 @@ class ElementsBasicCest
                     '3'
                 ),
             ],
-            'input_16 eval=password' => [
-                new FormHandlerElementTestDataObject(
-                    'Kasper',
-                    '********',
-                    'Kasper'
-                ),
-            ],
-            'input_19 eval=trim' => [
-                new FormHandlerElementTestDataObject(
-                    ' Kasper ',
-                    'Kasper'
-                ),
-                new FormHandlerElementTestDataObject(
-                    ' Kasper TYPO3 ',
-                    'Kasper TYPO3'
-                ),
-            ],
-            'input_23 eval=upper' => [
-                new FormHandlerElementTestDataObject(
-                    'Kasper TYPO3!',
-                    'KASPER TYPO3!'
-                )
-            ],
+        ];
+
+        foreach ($fieldTests as $fieldLabel => $testData) {
+            $formhandler->fillSeeSaveAndClearInputField(
+                $fieldLabel,
+                $testData
+            );
+        }
+    }
+
+    /**
+     * @param Admin $I
+     * @param Formhandler $formhandler
+     */
+    public function checkThatBrowserSideValidationsWorkForRangeAndSaveRecord(Admin $I, Formhandler $formhandler)
+    {
+        $this->waitForFormReady($I);
+
+        $fieldTests = [
+
             'input_25 eval=int, default=0, range lower=-2, range upper=2' => [
                 new FormHandlerElementTestDataObject(
                     'Kasper TYPO3',
@@ -264,6 +288,40 @@ class ElementsBasicCest
      * @param Admin $I
      * @param Formhandler $formhandler
      */
+    public function checkThatBrowserSideValidationsWorkForMd5AndSaveRecord(Admin $I, Formhandler $formhandler)
+    {
+        $this->waitForFormReady($I);
+
+        $fieldTests = [
+            'input_12 eval=md5' => [
+                new FormHandlerElementTestDataObject(
+                    'Kasper TYPO3!',
+                    '748469dd64911af8df8f9a3dcb2c9378',
+                    '748469dd64911af8df8f9a3dcb2c9378'
+                ),
+                new FormHandlerElementTestDataObject(
+                    ' Kasper TYPO3! ',
+                    '792a085606250c47d6ebb8c98804d5b0',
+                    '792a085606250c47d6ebb8c98804d5b0',
+                    '792a085606250c47d6ebb8c98804d5b0',
+                    false,
+                    'Check that whitespaces are not trimmed.'
+                )
+            ],
+        ];
+
+        foreach ($fieldTests as $fieldLabel => $testData) {
+            $formhandler->fillSeeSaveAndClearInputField(
+                $fieldLabel,
+                $testData
+            );
+        }
+    }
+
+    /**
+     * @param Admin $I
+     * @param Formhandler $formhandler
+     */
     public function checkThatValidationWorks_evalYear(Admin $I, Formhandler $formhandler)
     {
         $this->waitForFormReady($I);