[TASK] Switch to chrome in ac tests 03/52603/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 23 Apr 2017 18:03:46 +0000 (20:03 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 25 Apr 2017 12:59:08 +0000 (14:59 +0200)
The acceptance tests currently rely on firefox esr build
and younger firefox versions don't run with given web driver.

The patch updates selenium dependency to youngest version,
adds chrome webdriver as dependency, hands over some start
arguments to chrome and fixes a couple of tests to stabilize
the acceptance tests with chrome.

Goal is a quicker acceptance tests execution with chrome
instead of firefox. Furthermore, it is now much easier to
execute the acceptance tests locally since just a "current"
chrome version is needed instead of an outdated firefox nobody
has installed by default. Additionally, chrome strives for
a headless version in its current dev build, which is an
additional option for the tests later to drop another dependency.

Change-Id: I2688969d70d95849145f931d86879e81d0d493f6
Resolves: #81010
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/52603
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
composer.json
composer.lock
typo3/sysext/core/Tests/Acceptance.suite.yml
typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/CategoryTreeCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicInputCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicInputDateCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsGroupCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/Inline1nCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Language/LanguageCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Template/TemplateCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Topbar/NavigationComponentTreeCest.php

index 0692be6..82d8ad3 100644 (file)
@@ -55,7 +55,8 @@
        "require-dev": {
                "typo3/testing-framework": "~1.0.0",
                "codeception/codeception": "^2.2",
-               "se/selenium-server-standalone": "~2.53",
+               "se/selenium-server-standalone": "~3.3.1",
+               "enm1989/chromedriver": "~2.29",
                "typo3/cms-styleguide": "~8.0.8",
                "friendsofphp/php-cs-fixer": "^2.0",
                "fiunchinho/phpunit-randomizer": "~2.0.3"
index 57fb476..9d1e15f 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "d466da27236cd52e943ba1e2f894f070",
+    "content-hash": "11fafa90e76890dc750be42d0ba3e915",
     "packages": [
         {
             "name": "cogpowered/finediff",
         },
         {
             "name": "codeception/codeception",
-            "version": "2.2.8",
+            "version": "2.2.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Codeception/Codeception.git",
-                "reference": "0a87d4b19070a24636125993450a9d3f698a6663"
+                "reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Codeception/Codeception/zipball/0a87d4b19070a24636125993450a9d3f698a6663",
-                "reference": "0a87d4b19070a24636125993450a9d3f698a6663",
+                "url": "https://api.github.com/repos/Codeception/Codeception/zipball/c32a3f92834db08ceedb4666ea2265c3aa43396e",
+                "reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e",
                 "shasum": ""
             },
             "require": {
                 "guzzlehttp/guzzle": ">=4.1.4 <7.0",
                 "guzzlehttp/psr7": "~1.0",
                 "php": ">=5.4.0 <8.0",
-                "phpunit/php-code-coverage": ">=2.1.3 <5.0",
+                "phpunit/php-code-coverage": ">=2.2.4 <5.0",
                 "phpunit/phpunit": ">4.8.20 <6.0",
                 "sebastian/comparator": "~1.1",
                 "sebastian/diff": "^1.4",
+                "stecman/symfony-console-completion": "^0.7.0",
                 "symfony/browser-kit": ">=2.7 <4.0",
                 "symfony/console": ">=2.7 <4.0",
                 "symfony/css-selector": ">=2.7 <4.0",
                 "functional testing",
                 "unit testing"
             ],
-            "time": "2017-01-20T00:54:15+00:00"
+            "time": "2017-03-25T03:19:52+00:00"
+        },
+        {
+            "name": "enm1989/chromedriver",
+            "version": "2.29",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/ENM1989/chromedriver.git",
+                "reference": "61c748b3e89063ac8901bf092a36c8a8d4afb681"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/ENM1989/chromedriver/zipball/61c748b3e89063ac8901bf092a36c8a8d4afb681",
+                "reference": "61c748b3e89063ac8901bf092a36c8a8d4afb681",
+                "shasum": ""
+            },
+            "bin": [
+                "bin/chromedriver"
+            ],
+            "type": "library",
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache License Version 2.0"
+            ],
+            "authors": [
+                {
+                    "name": "Nico Müller",
+                    "email": "nico.mueller.1989@googlemail.com"
+                }
+            ],
+            "description": "Composer distribution of Chromedriver. Adds a executable to your composer bin directory.",
+            "homepage": "https://github.com/ENM1989/chromedriver",
+            "keywords": [
+                "Chromedriver",
+                "chrome",
+                "selenium",
+                "webdriver"
+            ],
+            "time": "2017-04-05T10:16:10+00:00"
         },
         {
             "name": "facebook/webdriver",
         },
         {
             "name": "se/selenium-server-standalone",
-            "version": "v2.53.1",
+            "version": "v3.3.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sveneisenschmidt/selenium-server-standalone.git",
-                "reference": "ef4eea9c99efb9c0e3084e9cae625662ccd43361"
+                "reference": "6d8ae7864f2fc2d39456501ff8b01aa26d5cdda6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sveneisenschmidt/selenium-server-standalone/zipball/ef4eea9c99efb9c0e3084e9cae625662ccd43361",
-                "reference": "ef4eea9c99efb9c0e3084e9cae625662ccd43361",
+                "url": "https://api.github.com/repos/sveneisenschmidt/selenium-server-standalone/zipball/6d8ae7864f2fc2d39456501ff8b01aa26d5cdda6",
+                "reference": "6d8ae7864f2fc2d39456501ff8b01aa26d5cdda6",
                 "shasum": ""
             },
             "require-dev": {
                 "selenium",
                 "testing"
             ],
-            "time": "2016-07-01T14:16:52+00:00"
+            "time": "2017-03-23T10:12:26+00:00"
         },
         {
             "name": "sebastian/code-unit-reverse-lookup",
             "time": "2016-10-03T07:35:21+00:00"
         },
         {
+            "name": "stecman/symfony-console-completion",
+            "version": "0.7.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/stecman/symfony-console-completion.git",
+                "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/5461d43e53092b3d3b9dbd9d999f2054730f4bbb",
+                "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.2",
+                "symfony/console": "~2.3 || ~3.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.4"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "0.6.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Stecman\\Component\\Symfony\\Console\\BashCompletion\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Stephen Holdaway",
+                    "email": "stephen@stecman.co.nz"
+                }
+            ],
+            "description": "Automatic BASH completion for Symfony Console Component based applications.",
+            "time": "2016-02-24T05:08:54+00:00"
+        },
+        {
             "name": "symfony/browser-kit",
             "version": "v3.2.2",
             "source": {
index 5eb3466..a92cd50 100644 (file)
@@ -7,9 +7,9 @@ modules:
   config:
     WebDriver:
       url: http://localhost:8000/typo3temp/var/tests/acceptance
-      browser: firefox
+      browser: chrome
       port: 4444
-      window_size: 1280x960
+      window_size: 1280x1024
       wait: 1
       restart: true
       capabilities:
@@ -19,4 +19,6 @@ modules:
         # is overlaying it.
         # You have to ensure that the element is in the viewport by your own before clicking it!
         # You can simply do that by scrolling to it.
-        elementScrollBehavior: 1
\ No newline at end of file
+        elementScrollBehavior: 1
+        chromeOptions:
+          args: [no-sandbox,disable-infobars,disable-notifications,disable-gpu,disable-software-rasterizer]
\ No newline at end of file
index 2d44825..fc64579 100644 (file)
@@ -55,6 +55,11 @@ class CategoryTreeCest
         $I->waitForElementVisible('#web .modulemenu-group-container .modulemenu-item');
         $I->click('#web_list');
         $I->switchToIFrame('list_frame');
+        // Collapse all tables and expand category again - ensures category fits into window
+        $I->executeJS('$(\'.icon-actions-view-list-collapse\').click();');
+        $I->wait(1);
+        $I->executeJS('$(\'a[data-table="sys_category"] .icon-actions-view-list-expand\').click();');
+        $I->wait(1);
         // Select category with id 7
         $I->click('#recordlist-sys_category tr[data-uid="7"] a[data-original-title="Edit record"]');
         // Change title and level to root
index 95f31a0..12a592a 100644 (file)
@@ -41,8 +41,8 @@ class ElementsBasicInputCest extends AbstractElementsBasicCest
         $I->switchToIFrame('list_frame');
 
         // Open record and wait until form is ready
+        $I->waitForText('elements basic');
         $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[data-original-title="Edit record"]';
-        $I->waitForElement($editRecordLinkCssPath, 30);
         $I->click($editRecordLinkCssPath);
         $I->waitForText('Edit Form', 3, 'h1');
     }
index 5a212c1..a95156c 100644 (file)
@@ -41,8 +41,8 @@ class ElementsBasicInputDateCest extends AbstractElementsBasicCest
         $I->switchToIFrame('list_frame');
 
         // Open record and wait until form is ready
+        $I->waitForText('elements basic');
         $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[data-original-title="Edit record"]';
-        $I->waitForElement($editRecordLinkCssPath, 30);
         $I->click($editRecordLinkCssPath);
         $I->waitForText('Edit Form', 3, 'h1');
         $I->click('inputDateTime');
index 077f2c4..e7b2165 100644 (file)
@@ -37,8 +37,8 @@ class ElementsGroupCest
 
         $I->executeJS('window.name="TYPO3Main";');
 
+        $I->waitForText('elements group');
         $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_group a[data-original-title="Edit record"]';
-        $I->waitForElement($editRecordLinkCssPath, 30);
         $I->click($editRecordLinkCssPath);
         $I->waitForText('Edit Form', 3, 'h1');
     }
@@ -101,8 +101,9 @@ class ElementsGroupCest
         $I->switchToWindow('Typo3WinBrowser');
 
         try {
-            $I->amGoingTo('click record name in DB-Browser');
-            $I->click('#recordlist-be_groups > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(2)');
+            $I->amGoingTo('click + button to select record and close DB-Browser');
+            $I->click('#recordlist-be_users > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
+            $I->closeTab();
         } catch (NoSuchWindowException $e) {
             // missing focus by auto close window
         }
@@ -128,8 +129,9 @@ class ElementsGroupCest
         $I->click('#recordlist-be_groups > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
 
         try {
-            $I->amGoingTo('click record name in DB-Browser');
-            $I->click('#recordlist-be_users > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(2)');
+            $I->amGoingTo('click + button to select record and close DB-Browser');
+            $I->click('#recordlist-be_users > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
+            $I->closeTab();
         } catch (NoSuchWindowException $e) {
             // missing focus by auto close window
         }
@@ -178,7 +180,9 @@ class ElementsGroupCest
 
         // search Test only by string
         try {
-            $I->click('admin');
+            $I->amGoingTo('click + button to select record and close DB-Browser');
+            $I->click('#recordlist-be_users > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1) > a:nth-child(1)');
+            $I->closeTab();
         } catch (NoSuchWindowException $e) {
             // missing focus by auto close window
         }
index 59e8745..f1d82dd 100644 (file)
@@ -36,8 +36,8 @@ class Inline1nCest
         $pageTree->openPath(['styleguide TCA demo', 'inline 1n']);
         $I->switchToIFrame('list_frame');
 
+        $I->waitForText('inline 1n');
         $editRecordLinkCssPath = '#recordlist-tx_styleguide_inline_1n a[data-original-title="Edit record"]';
-        $I->waitForElement($editRecordLinkCssPath, 30);
         $I->click($editRecordLinkCssPath);
         $I->waitForText('Edit Form', 3, 'h1');
     }
index bbf4bfc..07bd2e8 100644 (file)
@@ -111,8 +111,8 @@ class LanguageCest
 
         $I->selectOption('.t3-js-jumpMenuBox', 'Translation Overview');
         $I->waitForElementVisible('#typo3-translation-list');
-        $I->click('#extension-core td a.updateTranslationLink');
-        $I->waitForElement('#extension-core td:nth-child(3).complete');
+        $I->click('#extension-beuser td a.updateTranslationLink');
+        $I->waitForElement('#extension-beuser td:nth-child(3).complete');
         $this->seeAlert($I, 'Success', 'The translation update has been successfully completed.');
     }
 
index 699df85..bf5cad7 100644 (file)
@@ -59,12 +59,11 @@ class TemplateCest
         // click on website root page
         $I->click('#extdd-3');
         $I->switchToIFrame('list_frame');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
-        $I->see('No template');
+        $I->waitForText('No template');
         $I->see('There was no template on this page!');
         $I->see('You need to create a template record below in order to edit your configuration.');
 
-        // @todo These input fields should be changed to buttons. Shoult be changed to proper HTML.
+        // @todo These input fields should be changed to buttons. Should be changed to proper HTML.
         $I->seeInFormFields(
             '#TypoScriptTemplateModuleController',
             [
@@ -83,10 +82,9 @@ class TemplateCest
         $I->switchToIFrame();
         $I->click('#extdd-3');
         $I->switchToIFrame('list_frame');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
+        $I->waitForText('Create new website');
         $I->click("//input[@name='newWebsite']");
-        $I->waitForElement('#TypoScriptTemplateModuleController');
-        $I->see('Edit constants for template');
+        $I->waitForText('Edit constants for template');
 
         $I->wantTo('change to Info/Modify and see the template overview table');
         $I->selectOption('.t3-js-jumpMenuBox', 'Info/Modify');
@@ -120,29 +118,23 @@ class TemplateCest
 
         $I->wantTo('change the template within the TypoScript Object Browser');
         $I->selectOption('.t3-js-jumpMenuBox', 'TypoScript Object Browser');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
-        $I->see('Current template');
+        $I->waitForText('Current template');
         $I->see('CONSTANTS ROOT');
         $I->selectOption('//select[@name="SET[ts_browser_type]"]', 'Setup');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
-        $I->see('SETUP ROOT');
+        $I->waitForText('SETUP ROOT');
         // find and open [page] in tree
         $I->see('[page] = PAGE');
         $I->click('//span[@class="list-tree-label"]/a[text()=\'page\']/../../../a');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
         // find and open [page][10] in tree
-        $I->see('[10] = TEXT');
+        $I->waitForText('[10] = TEXT');
         $I->click('//span[@class="list-tree-label"]/a[text()=\'page\']/../../../ul//span[@class="list-tree-label"]/a[text()=\'10\']/../../../a');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
         // find and edit [page][10][value] in tree
-        $I->see('[value] = Hello Acceptance Test!');
+        $I->waitForText('[value] = Hello Acceptance Test!');
         $I->click('//span[@class="list-tree-label"]/a[text()=\'10\']/../../../ul//span[@class="list-tree-label"]/a[text()=\'value\']');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
-        $I->see('page.10.value =');
+        $I->waitForText('page.10.value =');
         $I->fillField('//input[@name="data[page.10.value][value]"]', 'HELLO WORLD!');
         $I->click('//input[@name="update_value"]');
-        $I->waitForElement('#TypoScriptTemplateModuleController');
-        $I->see('Value updated');
+        $I->waitForText('Value updated');
         $I->see('page.10.value = HELLO WORLD!');
         $I->see('[value] = HELLO WORLD!');
     }
index 6edf070..fb6bcba 100644 (file)
@@ -32,7 +32,7 @@ class NavigationComponentTreeCest
     /**
      * @param Admin $I
      */
-    public function checkTreefExpandsAndCollapseByPageModule(Admin $I)
+    public function checkTreeExpandsAndCollapseByPageModule(Admin $I)
     {
         $treeArea = '.scaffold-content-navigation-expanded';
         $I->wantTo('check Page Module for Expands And Collapse');
@@ -53,21 +53,21 @@ class NavigationComponentTreeCest
     /**
      * @param Admin $I
      */
-    public function checkTreefExpandsAndCollapseByFileModule(Admin $I)
+    public function checkTreeExpandsAndCollapseByFileModule(Admin $I)
     {
         $I->wantTo('check File Module for Expands And Collapse');
         $I->click('Filelist');
         $I->switchToIFrame('nav_frame');
+        $I->waitForElement('.t3js-module-body');
         $I->see('fileadmin', '.t3js-module-body');
         $I->switchToIFrame();
         $I->wantTo('check File Module for Collapse');
         $I->click('button.t3js-topbar-button-navigationcomponent');
-        $I->switchToIFrame('nav_frame');
-        $I->cantSee('fileadmin', '.t3js-module-body');
-        $I->switchToIFrame();
+        $I->waitForElementNotVisible('.scaffold-content-navigation-expanded');
         $I->wantTo('check File Module for Expands');
         $I->click('button.t3js-topbar-button-navigationcomponent');
         $I->switchToIFrame('nav_frame');
+        $I->waitForElement('.t3js-module-body');
         $I->see('fileadmin', '.t3js-module-body');
         $I->switchToIFrame();
     }