[TASK] Acceptance tests with travis-ci 60/46660/5
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 14 Feb 2016 11:15:26 +0000 (12:15 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 15 Feb 2016 10:21:04 +0000 (11:21 +0100)
Set up a basic test system in .travis.yml to run
the login acceptance test with selenium and
phantomjs headless browser in travis-ci.

Change-Id: I944ec6ffcf73e4a138271303dfce8aa7aa121b26
Resolves: #68110
Releases: master
Reviewed-on: https://review.typo3.org/46660
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
.travis.yml
typo3/sysext/core/Build/Configuration/Acceptance/TravisLocalConfiguration.php [new file with mode: 0644]
typo3/sysext/core/Build/Configuration/Acceptance/TravisPackageStates.php [new file with mode: 0644]
typo3/sysext/core/Build/Configuration/Acceptance/acceptance.suite.yml
typo3/sysext/core/Tests/Acceptance/Backend/LoginMouseOverCept.php

index 72f272a..ee972ee 100644 (file)
@@ -5,11 +5,11 @@ matrix:
 
   include:
     - php: 5.5
-      env: UNIT_TESTS=yes FUNCTIONAL_TESTS=yes PHP_LINT=yes XLF_CHECK=yes SUBMODULE_TEST=yes
+      env: UNIT_TESTS=yes FUNCTIONAL_TESTS=yes ACCEPTANCE_TESTS=yes PHP_LINT=yes XLF_CHECK=yes SUBMODULE_TEST=yes
     - php: 5.6
-      env: UNIT_TESTS=yes FUNCTIONAL_TESTS=yes PHP_LINT=yes
+      env: UNIT_TESTS=yes FUNCTIONAL_TESTS=yes ACCEPTANCE_TESTS=yes PHP_LINT=yes
     - php: 7
-      env: UNIT_TESTS=yes FUNCTIONAL_TESTS=yes PHP_LINT=yes
+      env: UNIT_TESTS=yes FUNCTIONAL_TESTS=yes ACCEPTANCE_TESTS=yes PHP_LINT=yes
 
 sudo: false
 
@@ -76,6 +76,18 @@ script:
         find . -wholename '*typo3/sysext/*/Tests/Functional/*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; ./bin/phpunit -c typo3/sysext/core/Build/FunctionalTests.xml {}'
     fi
   - >
+    if [[ "$ACCEPTANCE_TESTS" == "yes" ]]; then
+        ./bin/selenium-server-standalone &
+        php -S 0.0.0.0:8000 &
+        sleep 3;
+        mysql -e 'create database acceptance';
+        mysql acceptance < typo3/sysext/core/ext_tables.sql;
+        mkdir -p typo3temp/var/logs/codeception/ typo3conf/ext;
+        cp typo3/sysext/core/Build/Configuration/Acceptance/TravisLocalConfiguration.php typo3conf/LocalConfiguration.php;
+        cp typo3/sysext/core/Build/Configuration/Acceptance/TravisPackageStates.php typo3conf/PackageStates.php;
+        ./bin/codecept run acceptance -c typo3/sysext/core/Build/AcceptanceTests.yml typo3/sysext/core/Tests/Acceptance
+    fi
+  - >
     if [[ "$PHP_LINT" == "yes" ]]; then
         echo;
         echo "Running php lint";
diff --git a/typo3/sysext/core/Build/Configuration/Acceptance/TravisLocalConfiguration.php b/typo3/sysext/core/Build/Configuration/Acceptance/TravisLocalConfiguration.php
new file mode 100644 (file)
index 0000000..8274f88
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+return [
+    'BE' => [
+        'debug' => true,
+        'explicitADmode' => 'explicitAllow',
+        'explicitConfirmationOfTranslation' => true,
+        'fileadminDir' => 'fileadmin/',
+        'installToolPassword' => '$P$notnotnotnotnotnot.validvalidva',
+        'loginSecurityLevel' => 'rsa',
+        'sessionTimeout' => '200000',
+        'versionNumberInFilename' => '0',
+    ],
+    'DB' => [
+        'database' => 'acceptance',
+        'extTablesDefinitionScript' => 'extTables.php',
+        'host' => 'localhost',
+        'socket' => '',
+        'username' => 'root',
+    ],
+    'EXT' => [
+        'extConf' => [
+            'rsaauth' => 'a:1:{s:18:"temporaryDirectory";s:0:"";}',
+            'saltedpasswords' => 'a:2:{s:3:"BE.";a:4:{s:21:"saltedPWHashingMethod";s:41:"TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt";s:11:"forceSalted";i:0;s:15:"onlyAuthService";i:0;s:12:"updatePasswd";i:1;}s:3:"FE.";a:5:{s:7:"enabled";i:1;s:21:"saltedPWHashingMethod";s:41:"TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt";s:11:"forceSalted";i:0;s:15:"onlyAuthService";i:0;s:12:"updatePasswd";i:1;}}',
+        ],
+    ],
+    'EXTCONF' => [
+    ],
+    'FE' => [
+        'debug' => true,
+        'loginSecurityLevel' => 'rsa',
+    ],
+    'GFX' => [
+        'jpg_quality' => '80',
+        'processor' => 'GraphicsMagick',
+        'processor_allowTemporaryMasksAsPng' => false,
+        'processor_colorspace' => 'RGB',
+        'processor_effects' => -1,
+        'processor_enabled' => 1,
+        'processor_path' => '/usr/bin/',
+        'processor_path_lzw' => '/usr/bin/',
+    ],
+    'INSTALL' => [
+        'wizardDone' => [
+        ],
+    ],
+    'SYS' => [
+        'caching' => [
+            'cacheConfigurations' => [
+                'extbase_object' => [
+                    'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend',
+                    'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend',
+                    'groups' => [
+                        'system',
+                    ],
+                    'options' => [
+                        'defaultLifetime' => 0,
+                    ],
+                ],
+            ],
+        ],
+        'clearCacheSystem' => true,
+        'devIPmask' => '*',
+        'displayErrors' => 1,
+        'enableDeprecationLog' => 'file',
+        'encryptionKey' => 'invalidinvalidinvalidinvalidinvalidinvalidinvalidinvalidinvalidinvalidinvalidinvalidinvalidinval',
+        'exceptionalErrors' => 28674,
+        'isInitialInstallationInProgress' => false,
+        'sitename' => 't3',
+        'sqlDebug' => 1,
+        'systemLogLevel' => 0,
+        'trustedHostsPattern' => '.*',
+    ],
+];
\ No newline at end of file
diff --git a/typo3/sysext/core/Build/Configuration/Acceptance/TravisPackageStates.php b/typo3/sysext/core/Build/Configuration/Acceptance/TravisPackageStates.php
new file mode 100644 (file)
index 0000000..31057b2
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+# PackageStates.php
+
+# This file is maintained by TYPO3's package management. Although you can edit it
+# manually, you should rather use the extension manager for maintaining packages.
+# This file will be regenerated automatically if it doesn't exist. Deleting this file
+# should, however, never become necessary if you use the package commands.
+
+return [
+    'packages' => [
+        'core' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-core',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/core/',
+            'classesPath' => 'Classes/',
+        ],
+        'extbase' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-extbase',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/extbase/',
+            'classesPath' => 'Classes/',
+        ],
+        'fluid' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-fluid',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/fluid/',
+            'classesPath' => 'Classes/',
+        ],
+        'extensionmanager' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-extensionmanager',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/extensionmanager/',
+            'classesPath' => 'Classes/',
+        ],
+        'lang' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-lang',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/lang/',
+            'classesPath' => 'Classes/',
+        ],
+        'setup' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-setup',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/setup/',
+            'classesPath' => 'Classes/',
+        ],
+        'rsaauth' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-rsaauth',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/rsaauth/',
+            'classesPath' => 'Classes/',
+        ],
+        'saltedpasswords' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-saltedpasswords',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/saltedpasswords/',
+            'classesPath' => 'Classes/',
+        ],
+        'backend' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-backend',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/backend/',
+            'classesPath' => 'Classes/',
+        ],
+        'belog' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-belog',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/belog/',
+            'classesPath' => 'Classes/',
+        ],
+        'install' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-install',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/install/',
+            'classesPath' => 'Classes/',
+        ],
+        't3skin' => [
+            'manifestPath' => '',
+            'composerName' => 'typo3/cms-t3skin',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/t3skin/',
+            'classesPath' => 'Classes/',
+        ],
+        'frontend' => [
+            'composerName' => 'typo3/cms-frontend',
+            'state' => 'active',
+            'packagePath' => 'typo3/sysext/frontend/',
+            'classesPath' => 'Classes/',
+        ],
+    ],
+    'version' => 4,
+];
\ No newline at end of file
index 5d61795..7d7bd59 100644 (file)
@@ -7,7 +7,16 @@ modules:
         - \Helper\Unit
     config:
       WebDriver:
-        window_size: 1024x768
         url: http://localhost:8000
-        browser: firefox
-        http_proxy: direct
\ No newline at end of file
+        browser: phantomjs
+
+env:
+    firefox:
+        modules:
+            config:
+                WebDriver:
+                    browser: 'firefox'
+                    window_size: 1024x768
+                    http_proxy: direct
+    phantom:
+        # nothing changed
\ No newline at end of file
index bcf2129..4b73423 100644 (file)
@@ -6,7 +6,7 @@
 $I = new AcceptanceTester($scenario);
 $I->wantTo('check login functions');
 $I->amOnPage('/typo3');
-$I->waitForElement('#t3-username');
+$I->waitForElement('#t3-username', 10);
 $I->wantTo('mouse over css change login button');
 
 $bs = $I->executeInSelenium(function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
@@ -18,4 +18,4 @@ $I->wait(1);
 $bsmo = $I->executeInSelenium(function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
     return $webdriver->findElement(WebDriverBy::cssSelector('#t3-login-submit'))->getCSSValue('box-shadow');
 });
-$this->assertFalse($bs == $bsmo);
\ No newline at end of file
+$this->assertFalse($bs == $bsmo);