[TASK] Raise testing-framework and styleguide 17/58817/8
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 1 Nov 2018 13:36:54 +0000 (14:36 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 2 Nov 2018 19:43:47 +0000 (20:43 +0100)
Acceptance tests of testing-framework have been refactored
a bit to be easier usable by extensions. Core needs some
adaptions to cope with that. styleguide has been
slightly improved and is raised along the way.

composer require --dev typo3/testing-framework ~4.11.1
composer require --dev typo3/cms-styleguide ~9.2.2

Change-Id: Ifc5fbc1192618017e6cd5e80452463eafe527d79
Resolves: #86839
Releases: master
Reviewed-on: https://review.typo3.org/58817
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>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
composer.json
composer.lock
typo3/sysext/core/Tests/Acceptance/Backend.suite.yml
typo3/sysext/core/Tests/Acceptance/Backend/FormEngine/Inline1nCest.php
typo3/sysext/core/Tests/Acceptance/Backend/RecordList/SysNoteCest.php
typo3/sysext/core/Tests/Acceptance/Support/Extension/BackendCoreEnvironment.php [new file with mode: 0644]
typo3/sysext/core/composer.json

index b7b54e3..9d2a8a6 100644 (file)
@@ -67,8 +67,8 @@
                "codeception/codeception": "^2.4.5",
                "fiunchinho/phpunit-randomizer": "^4.0",
                "friendsofphp/php-cs-fixer": "^2.12.2",
-               "typo3/cms-styleguide": "~9.2.1",
-               "typo3/testing-framework": "~4.10.0"
+               "typo3/cms-styleguide": "~9.2.2",
+               "typo3/testing-framework": "~4.11.1"
        },
        "suggest": {
                "ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images",
index 448277a..12e78bc 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "1ffc278cee5e98990949d683354301e8",
+    "content-hash": "3fac9f07b17b89422ee4e69daa5191ef",
     "packages": [
         {
             "name": "cogpowered/finediff",
         },
         {
             "name": "typo3/cms-styleguide",
-            "version": "9.2.1",
+            "version": "9.2.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TYPO3/styleguide.git",
-                "reference": "2672fe1750306a6510831a6dae437f134faeab85"
+                "reference": "e945c17a78cfd25ccea6335907fae35e55369d20"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TYPO3/styleguide/zipball/2672fe1750306a6510831a6dae437f134faeab85",
-                "reference": "2672fe1750306a6510831a6dae437f134faeab85",
+                "url": "https://api.github.com/repos/TYPO3/styleguide/zipball/e945c17a78cfd25ccea6335907fae35e55369d20",
+                "reference": "e945c17a78cfd25ccea6335907fae35e55369d20",
                 "shasum": ""
             },
             "replace": {
                 "styleguide": "*"
             },
+            "require-dev": {
+                "codeception/codeception": "^2.4",
+                "typo3/cms-about": "^9.5",
+                "typo3/cms-core": "^9.5",
+                "typo3/cms-frontend": "^9.5",
+                "typo3/cms-install": "^9.5",
+                "typo3/testing-framework": "^4.11.0"
+            },
             "type": "typo3-cms-extension",
+            "extra": {
+                "typo3/cms": {
+                    "app-dir": ".Build",
+                    "web-dir": ".Build/Web",
+                    "extension-key": "styleguide"
+                }
+            },
             "autoload": {
                 "psr-4": {
                     "TYPO3\\CMS\\Styleguide\\": "Classes/"
                 "typo3",
                 "typo3 backend"
             ],
-            "time": "2018-09-19T10:00:56+00:00"
+            "time": "2018-11-02T12:59:32+00:00"
         },
         {
             "name": "typo3/testing-framework",
-            "version": "4.10.0",
+            "version": "4.11.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TYPO3/testing-framework.git",
-                "reference": "aa2cde856fc41c475e903d641d80e37ac3c7d2fe"
+                "reference": "cfc5ad04e61898c8144e19ca5f7e8d83203a4b24"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/aa2cde856fc41c475e903d641d80e37ac3c7d2fe",
-                "reference": "aa2cde856fc41c475e903d641d80e37ac3c7d2fe",
+                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/cfc5ad04e61898c8144e19ca5f7e8d83203a4b24",
+                "reference": "cfc5ad04e61898c8144e19ca5f7e8d83203a4b24",
                 "shasum": ""
             },
             "require": {
                 "typo3/cms-extbase": "^9.3",
                 "typo3/cms-fluid": "^9.3",
                 "typo3/cms-frontend": "^9.3",
+                "typo3/cms-recordlist": "^9.3",
                 "typo3fluid/fluid": "^2.5"
             },
             "suggest": {
                 "tests",
                 "typo3"
             ],
-            "time": "2018-10-29T11:25:44+00:00"
+            "time": "2018-11-02T16:00:39+00:00"
         },
         {
             "name": "webmozart/assert",
index 68365b3..eb519a2 100644 (file)
@@ -16,7 +16,7 @@ modules:
 
 extensions:
     enabled:
-        - TYPO3\TestingFramework\Core\Acceptance\Extension\BackendCoreEnvironment
+        - TYPO3\CMS\Core\Tests\Acceptance\Support\Extension\BackendCoreEnvironment
 
 groups:
   AcceptanceTests-Job-*: AcceptanceTests-Job-*
index dd3fbf0..2d44cde 100644 (file)
@@ -94,9 +94,11 @@ class Inline1nCest
 
         $I->executeJS('$(\'a[data-table="pages"] .icon-actions-view-list-collapse\').click();');
         $I->wait(1);
+        $I->executeJS('$(\'a[data-table="tx_styleguide_inline_1n"] .icon-actions-view-list-collapse\').click();');
+        $I->wait(1);
 
         $I->see('lipsum', '#recordlist-tx_styleguide_inline_1n_child > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > a');
-        $I->see('Fo Bar', '#recordlist-tx_styleguide_inline_1n_child > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(6) > td:nth-child(2) > a');
+        $I->see('Fo Bar', '#recordlist-tx_styleguide_inline_1n_child > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(4) > td:nth-child(2) > a');
     }
 
     /**
@@ -114,10 +116,12 @@ class Inline1nCest
 
         $I->executeJS('$(\'a[data-table="pages"] .icon-actions-view-list-collapse\').click();');
         $I->wait(1);
+        $I->executeJS('$(\'a[data-table="tx_styleguide_inline_1n"] .icon-actions-view-list-collapse\').click();');
+        $I->wait(1);
 
         $I->wantTo('Check new sorting');
-        $I->see('Fo Bar', '#recordlist-tx_styleguide_inline_1n_child > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(3) > td:nth-child(2) > a');
-        $I->see('lipsum', '#recordlist-tx_styleguide_inline_1n_child > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(4) > td:nth-child(2) > a');
+        $I->see('Fo Bar', '#recordlist-tx_styleguide_inline_1n_child > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > a');
+        $I->see('lipsum', '#recordlist-tx_styleguide_inline_1n_child > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(2) > td:nth-child(2) > a');
     }
 
     /**
index 149aae5..f8a249a 100644 (file)
@@ -15,7 +15,7 @@ namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\RecordList;
  * The TYPO3 project - inspiring people to share!
  */
 
-use Facebook\WebDriver\WebDriverKeys;
+use Codeception\Util\Locator;
 use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
 use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree;
 
@@ -51,10 +51,7 @@ class SysNoteCest
         $I->wait(0.2);
         $I->canSee('New record');
 
-        $I->click('ul.list-tree');
-        // it takes two strokes to get all the way down
-        $I->pressKey('body', WebDriverKeys::PAGE_DOWN);
-        $I->pressKey('body', WebDriverKeys::PAGE_DOWN);
+        $I->scrollTo(Locator::find('span', ['data-table' => 'sys_note']));
         $I->click('Internal note');
 
         $I->fillField('//input[contains(@data-formengine-input-name, "data[sys_note]") and contains(@data-formengine-input-name, "[subject]")]', 'new sys_note');
diff --git a/typo3/sysext/core/Tests/Acceptance/Support/Extension/BackendCoreEnvironment.php b/typo3/sysext/core/Tests/Acceptance/Support/Extension/BackendCoreEnvironment.php
new file mode 100644 (file)
index 0000000..a18fcd8
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+declare(strict_types = 1);
+namespace TYPO3\CMS\Core\Tests\Acceptance\Support\Extension;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use Codeception\Event\SuiteEvent;
+use TYPO3\CMS\Core\Core\Bootstrap;
+use TYPO3\CMS\Styleguide\TcaDataGenerator\Generator;
+use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment;
+
+/**
+ * Load various core extensions and styleguide and call styleguide generator
+ */
+class BackendCoreEnvironment extends BackendEnvironment
+{
+    /**
+     * Load a list of core extensions and styleguide
+     *
+     * @var array
+     */
+    protected $localConfig = [
+        'coreExtensionsToLoad' => [
+            'core',
+            'beuser',
+            'extbase',
+            'fluid',
+            'filelist',
+            'extensionmanager',
+            'setup',
+            'rsaauth',
+            'backend',
+            'about',
+            'belog',
+            'install',
+            'frontend',
+            'recordlist',
+            'redirects',
+            'reports',
+            'sys_note',
+            'scheduler',
+            'tstemplate',
+        ],
+        'testExtensionsToLoad' => [
+            'typo3conf/ext/styleguide'
+        ],
+        'xmlDatabaseFixtures' => [
+            'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/be_users.xml',
+            'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/be_sessions.xml',
+            'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/be_groups.xml',
+            'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/sys_category.xml',
+            'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/tx_extensionmanager_domain_model_extension.xml',
+            'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/tx_extensionmanager_domain_model_repository.xml',
+        ],
+    ];
+
+    /**
+     * Generate styleguide data
+     *
+     * @param SuiteEvent $suiteEvent
+     */
+    public function bootstrapTypo3Environment(SuiteEvent $suiteEvent)
+    {
+        parent::bootstrapTypo3Environment($suiteEvent);
+        // styleguide generator uses DataHandler for some parts. DataHandler needs an initialized BE user
+        // with admin right and the live workspace.
+        Bootstrap::initializeBackendUser();
+        $GLOBALS['BE_USER']->user['admin'] = 1;
+        $GLOBALS['BE_USER']->user['uid'] = 1;
+        $GLOBALS['BE_USER']->workspace = 0;
+        Bootstrap::initializeLanguageObject();
+
+        $styleguideGenerator = new Generator();
+        $styleguideGenerator->create();
+    }
+}
index 297e33d..ceec9c0 100644 (file)
@@ -50,8 +50,8 @@
                "codeception/codeception": "^2.4.5",
                "fiunchinho/phpunit-randomizer": "^4.0",
                "friendsofphp/php-cs-fixer": "^2.12.2",
-               "typo3/cms-styleguide": "~9.2.1",
-               "typo3/testing-framework": "~4.10.0"
+               "typo3/cms-styleguide": "~9.2.2",
+               "typo3/testing-framework": "~4.11.1"
        },
        "suggest": {
                "ext-fileinfo": "Used for proper file type detection in the file abstraction layer",