[TASK] Acceptance tests: chromedriver directly 01/54301/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 5 Oct 2017 10:14:27 +0000 (12:14 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 5 Oct 2017 11:26:10 +0000 (13:26 +0200)
Use chromedriver directly in acceptance tests instead of
routing through selenium-server.

Change-Id: I229032b1b1ec1b0e6f5e4c2eb5435e3ff0ae95df
Resolves: #82683
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54300
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-on: https://review.typo3.org/54301

Build/bamboo/src/main/java/core/AbstractCoreSpec.java
Build/bamboo/src/main/java/core/NightlySpec.java
composer.json
composer.lock
typo3/sysext/core/Tests/Acceptance.suite.yml
typo3/sysext/core/Tests/AcceptanceInstallMysql.suite.yml
typo3/sysext/core/Tests/AcceptanceInstallPgsql.suite.yml

index f990b80..8c7a67f 100644 (file)
@@ -702,27 +702,16 @@ abstract public class AbstractCoreSpec {
      */
     protected Task getTaskPrepareAcceptanceTest() {
         return new ScriptTask()
-            .description("Start xvfb, selenium, php web server, prepare chrome environment")
+            .description("Start php web server, chromedriver, prepare environment")
             .interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
             .inlineBody(
                 this.getScriptTaskBashInlineBody() +
-                "# start xvfb until chrome headless can be used\n" +
-                "/sbin/start-stop-daemon --start --quiet --pidfile xvfb.pid --make-pidfile --background --exec /usr/bin/Xvfb :99\n" +
-                "\n" +
-                "# the display chrome should render to (xvfb)\n" +
-                "export DISPLAY=\":99\"\n" +
-                "\n" +
-                "PATH=$PATH:./bin DBUS_SESSION_BUS_ADDRESS=/dev/null ./bin/selenium-server-standalone >/dev/null 2>&1 & \n" +
-                "echo $! > selenium.pid\n" +
-                "\n" +
-                "# Wait for selenium server to load\n" +
-                "until $(curl --output /dev/null --silent --head --fail http://localhost:4444/wd/hub); do\n" +
-                "    printf '.'\n    sleep 1\n" +
-                "done\n" +
-                "\n" +
                 "php -S localhost:8000 >/dev/null 2>&1 &\n" +
                 "echo $! > phpserver.pid\n" +
                 "\n" +
+                "./bin/chromedriver --url-base=/wd/hub >/dev/null 2>&1 &\n" +
+                "echo $! > chromedriver.pid\n" +
+                "\n" +
                 "mkdir -p typo3temp/var/tests/\n"
             );
     }
@@ -796,13 +785,12 @@ abstract public class AbstractCoreSpec {
      */
     protected Task getTaskTearDownAcceptanceTestSetup() {
         return new ScriptTask()
-            .description("Stop acceptance test services like selenium and friends")
+            .description("Stop acceptance test services like chromedriver and friends")
             .interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
             .inlineBody(
                 this.getScriptTaskBashInlineBody() +
                 "kill `cat phpserver.pid`\n" +
-                "kill `cat selenium.pid`\n" +
-                "kill `cat xvfb.pid`\n"
+                "kill `cat chromedriver.pid`\n"
             );
     }
 
index e3a96b4..78f8515 100644 (file)
@@ -50,8 +50,8 @@ public class NightlySpec extends AbstractCoreSpec {
     public static void main(final String[] args) throws Exception {
         // By default credentials are read from the '.credentials' file.
         BambooServer bambooServer = new BambooServer(bambooServerName);
-        bambooServer.publish(new PreMergeSpec().createPlan());
-        bambooServer.publish(new PreMergeSpec().getDefaultPlanPermissions(projectKey, planKey));
+        bambooServer.publish(new NightlySpec().createPlan());
+        bambooServer.publish(new NightlySpec().getDefaultPlanPermissions(projectKey, planKey));
     }
 
     /**
index b59c322..2a9ee1c 100644 (file)
@@ -53,7 +53,6 @@
        "require-dev": {
                "typo3/testing-framework": "~1.1.0",
                "codeception/codeception": "^2.3",
-               "se/selenium-server-standalone": "~3.5.3",
                "enm1989/chromedriver": "~2.30",
                "typo3/cms-styleguide": "~8.0.8",
                "friendsofphp/php-cs-fixer": "^2.0",
index 188c8a5..ff82dc4 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": "6fe75c293c921d6156d6ebba4f283d0d",
+    "content-hash": "40a731a4049571928ff8802e7a5f49b1",
     "packages": [
         {
             "name": "cogpowered/finediff",
             "time": "2017-03-03T06:30:20+00:00"
         },
         {
-            "name": "se/selenium-server-standalone",
-            "version": "3.5.3",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sveneisenschmidt/selenium-server-standalone.git",
-                "reference": "d3b5c43ca9c72d2abdbb3692d9cdda2dc20d9634"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sveneisenschmidt/selenium-server-standalone/zipball/d3b5c43ca9c72d2abdbb3692d9cdda2dc20d9634",
-                "reference": "d3b5c43ca9c72d2abdbb3692d9cdda2dc20d9634",
-                "shasum": ""
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.0"
-            },
-            "bin": [
-                "bin/selenium-server-standalone"
-            ],
-            "type": "library",
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "Apache 2.0"
-            ],
-            "authors": [
-                {
-                    "name": "Sven Eisenschmidt",
-                    "email": "sven.eisenschmidt@gmail.com"
-                }
-            ],
-            "description": "Composer distribution of Selenium Server Standalone, the browser automation framework. Adds a executable to your composer bin directory.",
-            "homepage": "https://github.com/sveneisenschmidt/selenium-server-standalone",
-            "keywords": [
-                "selenium",
-                "testing"
-            ],
-            "time": "2017-09-06T10:38:18+00:00"
-        },
-        {
             "name": "sebastian/code-unit-reverse-lookup",
             "version": "1.0.1",
             "source": {
index 0f6a3c2..6f48474 100644 (file)
@@ -8,8 +8,7 @@ modules:
     WebDriver:
       url: http://localhost:8000/typo3temp/var/tests/acceptance
       browser: chrome
-      port: 4444
-      wait: 1
+      port: 9515
       capabilities:
         # Disable the "scroll to element before clicking" behavior as this breaks tests
         # where for example a fixed docbar is used. Selenium scrolls to the element before
index 913c495..7a43af8 100644 (file)
@@ -8,8 +8,7 @@ modules:
     WebDriver:
       url: http://localhost:8000/typo3temp/var/tests/acceptanceinstallmysql
       browser: chrome
-      port: 4444
-      wait: 1
+      port: 9515
       capabilities:
         # Disable the "scroll to element before clicking" behavior as this breaks tests
         # where for example a fixed docbar is used. Selenium scrolls to the element before
index ff61dcf..a4de529 100644 (file)
@@ -8,8 +8,7 @@ modules:
     WebDriver:
       url: http://localhost:8000/typo3temp/var/tests/acceptanceinstallpgsql
       browser: chrome
-      port: 4444
-      wait: 1
+      port: 9515
       capabilities:
         # Disable the "scroll to element before clicking" behavior as this breaks tests
         # where for example a fixed docbar is used. Selenium scrolls to the element before