diff --git a/.travis.yml b/.travis.yml index 84d53110a686..67d306e78a0e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ env: global: - TEST_DAV=$(tests/travis/changed_app.sh dav) - TC=litmus-v2 + - SRV_HOST_NAME=owncloud + - SRV_HOST_PORT=8888 matrix: - DB=sqlite @@ -26,15 +28,20 @@ addons: apt: packages: - realpath + hosts: + - owncloud + sauce_connect: before_install: - make - - sh -c "if [ '$TEST_DAV' = '1' ]; then bash tests/travis/before_install.sh $DB; fi" + - sh -c "if [ '$TEST_DAV' = '1' ] || [ '$TC' = 'selenium' ]; then bash tests/travis/before_install.sh $DB; fi" install: - - sh -c "if [ '$TEST_DAV' = '1' ]; then bash tests/travis/install.sh $DB; fi" + - sh -c "if [ '$TEST_DAV' = '1' ] || [ '$TC' = 'selenium' ]; then bash tests/travis/install.sh $DB; fi" - sh -c "if [ '$TEST_DAV' = '1' ]; then bash apps/dav/tests/travis/$TC/install.sh; fi" +before_script: + - sh -c "if [ '$TC' = 'selenium' ]; then bash tests/travis/start_php_dev_server.sh; fi" script: - sh -c "if [ '$TC' = 'syntax' ]; then make test-php-lint ; fi" @@ -42,6 +49,7 @@ script: - sh -c "if [ '$TEST_DAV' = '1' ]; then echo \"Testing DAV\"; fi" - sh -c "if [ '$TEST_DAV' = '1' ]; then bash apps/dav/tests/travis/$TC/script.sh; fi" + - sh -c "if [ '$TC' = 'selenium' ] && [ ! -z "$SAUCE_USERNAME" ] && [ ! -z "$SAUCE_ACCESS_KEY" ]; then bash tests/travis/start_behat_tests.sh; fi" matrix: include: @@ -51,6 +59,8 @@ matrix: env: DB=sqlite;TC=carddav - php: 5.6 env: DB=sqlite;TC=caldav + - php: 5.6 + env: DB=pgsql;TC=selenium - php: 5.6 env: DB=sqlite;TC=syntax;TEST_DAV=0 - php: 7.0 diff --git a/README.md b/README.md index 2e775e4c8f19..70ad2dee3f9c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![codecov.io](https://codecov.io/github/owncloud/core/coverage.svg?branch=master)](https://codecov.io/github/owncloud/core?branch=master) [![Dependency Status](https://www.versioneye.com/user/projects/54f4a2384f3108959a000a16/badge.svg?style=flat)](https://www.versioneye.com/user/projects/54f4a2384f3108959a000a16) [![Dependency Status](https://www.versioneye.com/user/projects/54d1f76f3ca0840b190000c0/badge.svg?style=flat)](https://www.versioneye.com/user/projects/54d1f76f3ca0840b190000c0) +[![Build Status](https://saucelabs.com/buildstatus/DeepDiver1975)](https://saucelabs.com/beta/builds/358889d1dc0a45ff927e3d6b844cabf0) **[ownCloud](http://ownCloud.org) gives you freedom and control over your own data. A personal cloud which runs on your own server.** diff --git a/composer.json b/composer.json index 05c3d1466985..a0b35412d524 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,10 @@ "jakub-onderka/php-console-highlighter": "^0.3.2", "phpunit/phpunit": "^5.5", "mikey179/vfsStream": "^1.6", + "behat/mink-extension": "^2.2", + "behat/mink-goutte-driver": "^1.2", + "behat/mink-selenium2-driver": "^1.3", + "sensiolabs/behat-page-object-extension": "^2.0", "behat/behat": "^3.0", "jarnaiz/behat-junit-formatter": "^1.3" }, diff --git a/composer.lock b/composer.lock index 9a7a24dd8de5..25d48c9ea9a1 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "1e3b8f9b50799a600d0d5acbef8734b9", + "content-hash": "1a4f62e4d22c8bfd65141c60ae7c417e", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -3136,6 +3136,295 @@ ], "time": "2016-10-30T11:50:56+00:00" }, + { + "name": "behat/mink", + "version": "v1.7.1", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "e6930b9c74693dff7f4e58577e1b1743399f3ff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/e6930b9c74693dff7f4e58577e1b1743399f3ff9", + "reference": "e6930b9c74693dff7f4e58577e1b1743399f3ff9", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "~2.1|~3.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2016-03-05T08:26:18+00:00" + }, + { + "name": "behat/mink-browserkit-driver", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", + "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/10e67fb4a295efcd62ea0bf16025a85ea19534fb", + "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb", + "shasum": "" + }, + "require": { + "behat/mink": "^1.7.1@dev", + "php": ">=5.3.6", + "symfony/browser-kit": "~2.3|~3.0", + "symfony/dom-crawler": "~2.3|~3.0" + }, + "require-dev": { + "silex/silex": "~1.2", + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Symfony2 BrowserKit driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "Mink", + "Symfony2", + "browser", + "testing" + ], + "time": "2016-03-05T08:59:47+00:00" + }, + { + "name": "behat/mink-extension", + "version": "v2.2", + "source": { + "type": "git", + "url": "https://github.com/Behat/MinkExtension.git", + "reference": "5b4bda64ff456104564317e212c823e45cad9d59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/5b4bda64ff456104564317e212c823e45cad9d59", + "reference": "5b4bda64ff456104564317e212c823e45cad9d59", + "shasum": "" + }, + "require": { + "behat/behat": "~3.0,>=3.0.5", + "behat/mink": "~1.5", + "php": ">=5.3.2", + "symfony/config": "~2.2|~3.0" + }, + "require-dev": { + "behat/mink-goutte-driver": "~1.1", + "phpspec/phpspec": "~2.0" + }, + "type": "behat-extension", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\MinkExtension": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com" + } + ], + "description": "Mink extension for Behat", + "homepage": "http://extensions.behat.org/mink", + "keywords": [ + "browser", + "gui", + "test", + "web" + ], + "time": "2016-02-15T07:55:18+00:00" + }, + { + "name": "behat/mink-goutte-driver", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkGoutteDriver.git", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "shasum": "" + }, + "require": { + "behat/mink": "~1.6@dev", + "behat/mink-browserkit-driver": "~1.2@dev", + "fabpot/goutte": "~1.0.4|~2.0|~3.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Goutte driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "goutte", + "headless", + "testing" + ], + "time": "2016-03-05T09:04:22+00:00" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/473a9f3ebe0c134ee1e623ce8a9c852832020288", + "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2016-03-05T09:10:18+00:00" + }, { "name": "behat/transliterator", "version": "v1.1.0", @@ -3261,6 +3550,113 @@ ], "time": "2015-06-14T21:17:01+00:00" }, + { + "name": "fabpot/goutte", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "0ad3ee6dc2d0aaa832a80041a1e09bf394e99802" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/0ad3ee6dc2d0aaa832a80041a1e09bf394e99802", + "reference": "0ad3ee6dc2d0aaa832a80041a1e09bf394e99802", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": ">=4,<6", + "php": ">=5.4.0", + "symfony/browser-kit": "~2.1", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1" + }, + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Goutte\\": "Goutte" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", + "keywords": [ + "scraper" + ], + "time": "2015-05-05T21:14:57+00:00" + }, + { + "name": "instaclick/php-webdriver", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2015-06-15T20:19:33+00:00" + }, { "name": "jakub-onderka/php-console-color", "version": "0.1", @@ -3503,24 +3899,87 @@ }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-01-26T22:05:40+00:00" + }, + { + "name": "ocramius/proxy-manager", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/ProxyManager.git", + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11", + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-code": ">2.2.5,<3.0" + }, + "require-dev": { + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "1.5.*" + }, + "suggest": { + "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", + "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", + "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", + "zendframework/zend-stdlib": "To use the hydrator proxy", + "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "ProxyManager\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", + "homepage": "https://github.com/Ocramius/ProxyManager", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "aop", + "lazy loading", + "proxy", + "proxy pattern", + "service proxies" ], - "time": "2017-01-26T22:05:40+00:00" + "time": "2015-08-09T04:28:19+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -4683,6 +5142,130 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, + { + "name": "sensiolabs/behat-page-object-extension", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sensiolabs/BehatPageObjectExtension.git", + "reference": "1d3f08e67a9131feb78cfc4331068755faceef2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sensiolabs/BehatPageObjectExtension/zipball/1d3f08e67a9131feb78cfc4331068755faceef2d", + "reference": "1d3f08e67a9131feb78cfc4331068755faceef2d", + "shasum": "" + }, + "require": { + "behat/behat": "^3.0.6", + "behat/mink": "^1.6", + "behat/mink-extension": "^2.0", + "ocramius/proxy-manager": "^1.0||^2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "behat/mink-goutte-driver": "^1.0", + "bossa/phpspec2-expect": "^1.0.3||^2.0", + "fabpot/goutte": "^1.0.4||^2.0||^3.0", + "phpspec/phpspec": "^2.5||^3.0", + "symfony/filesystem": "^2.8||^3.0", + "symfony/process": "^2.8||^3.0", + "symfony/yaml": "^2.8||^3.0" + }, + "suggest": { + "bossa/phpspec2-expect": "Allows to use PHPSpec2 matchers in Behat context files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-0": { + "SensioLabs\\Behat\\PageObjectExtension\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcello Duarte", + "email": "mduarte@inviqa.com" + }, + { + "name": "Jakub Zalas", + "email": "jakub@zalas.pl" + } + ], + "description": "Page object extension for Behat", + "homepage": "https://github.com/sensiolabs/BehatPageObjectExtension", + "keywords": [ + "BDD", + "Behat", + "page" + ], + "time": "2017-01-18T22:05:14+00:00" + }, + { + "name": "symfony/browser-kit", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "8827db04bcd8d9b9bf3114ea41081d8036ab209c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8827db04bcd8d9b9bf3114ea41081d8036ab209c", + "reference": "8827db04bcd8d9b9bf3114ea41081d8036ab209c", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/dom-crawler": "~2.1|~3.0.0" + }, + "require-dev": { + "symfony/css-selector": "^2.0.5|~3.0.0", + "symfony/process": "~2.3.34|^2.7.6|~3.0.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2017-02-21T08:33:48+00:00" + }, { "name": "symfony/class-loader", "version": "v3.2.4", @@ -4795,6 +5378,59 @@ "homepage": "https://symfony.com", "time": "2017-02-14T16:27:43+00:00" }, + { + "name": "symfony/css-selector", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "742bd688bd778dde8991ba696cb372570610afcd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/742bd688bd778dde8991ba696cb372570610afcd", + "reference": "742bd688bd778dde8991ba696cb372570610afcd", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2017-02-21T08:33:48+00:00" + }, { "name": "symfony/dependency-injection", "version": "v3.2.4", @@ -4858,6 +5494,62 @@ "homepage": "https://symfony.com", "time": "2017-02-16T22:46:52+00:00" }, + { + "name": "symfony/dom-crawler", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "24b1a3ffa5b64e4f8b1c5f2cdffd16368640704a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/24b1a3ffa5b64e4f8b1c5f2cdffd16368640704a", + "reference": "24b1a3ffa5b64e4f8b1c5f2cdffd16368640704a", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2017-02-21T08:33:48+00:00" + }, { "name": "symfony/filesystem", "version": "v3.2.4", @@ -5075,6 +5767,112 @@ "validate" ], "time": "2016-11-23T20:04:58+00:00" + }, + { + "name": "zendframework/zend-code", + "version": "2.6.3", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-code.git", + "reference": "95033f061b083e16cdee60530ec260d7d628b887" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/95033f061b083e16cdee60530ec260d7d628b887", + "reference": "95033f061b083e16cdee60530ec260d7d628b887", + "shasum": "" + }, + "require": { + "php": "^5.5 || 7.0.0 - 7.0.4 || ^7.0.6", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.8.21", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "homepage": "https://github.com/zendframework/zend-code", + "keywords": [ + "code", + "zf2" + ], + "time": "2016-04-20T17:26:42+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "c3bce7b7d47c54040b9ae51bc55491c72513b75d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/c3bce7b7d47c54040b9ae51bc55491c72513b75d", + "reference": "c3bce7b7d47c54040b9ae51bc55491c72513b75d", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.6", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2016-12-19T21:47:12+00:00" } ], "aliases": [], diff --git a/tests/travis/install.sh b/tests/travis/install.sh index fe7907f798ca..b91f77147001 100755 --- a/tests/travis/install.sh +++ b/tests/travis/install.sh @@ -45,6 +45,11 @@ cat > ./tests/autoconfig-sqlite.php < false, + 'trusted_domains' => + array ( + 0 => 'localhost', + 1 => '$SRV_HOST_NAME', + ), 'dbtype' => 'sqlite', 'dbtableprefix' => 'oc_', 'adminlogin' => '$ADMINLOGIN', @@ -57,6 +62,11 @@ cat > ./tests/autoconfig-mysql.php < false, + 'trusted_domains' => + array ( + 0 => 'localhost', + 1 => '$SRV_HOST_NAME', + ), 'dbtype' => 'mysql', 'dbtableprefix' => 'oc_', 'adminlogin' => '$ADMINLOGIN', @@ -73,6 +83,11 @@ cat > ./tests/autoconfig-pgsql.php < false, + 'trusted_domains' => + array ( + 0 => 'localhost', + 1 => '$SRV_HOST_NAME', + ), 'dbtype' => 'pgsql', 'dbtableprefix' => 'oc_', 'adminlogin' => '$ADMINLOGIN', @@ -89,6 +104,11 @@ cat > ./tests/autoconfig-oracle.php < false, + 'trusted_domains' => + array ( + 0 => 'localhost', + 1 => '$SRV_HOST_NAME', + ), 'dbtype' => 'oci', 'dbtableprefix' => 'oc_', 'adminlogin' => '$ADMINLOGIN', diff --git a/tests/travis/start_behat_tests.sh b/tests/travis/start_behat_tests.sh new file mode 100644 index 000000000000..54baf7e52748 --- /dev/null +++ b/tests/travis/start_behat_tests.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# ownCloud +# +# @author Artur Neumann +# @copyright 2017 Artur Neumann info@individual-it.net +# + +if [ "$SRV_HOST_PORT" == "80" ] +then + BASE_URL="http://$SRV_HOST_NAME/$SRV_HOST_URL" +else + BASE_URL="http://$SRV_HOST_NAME:$SRV_HOST_PORT/$SRV_HOST_URL" +fi + +export BEHAT_PARAMS='{"extensions" : {"Behat\\MinkExtension" : {"base_url" : "'$BASE_URL'","selenium2":{"wd_host":"http://'$SAUCE_USERNAME:$SAUCE_ACCESS_KEY'@localhost:4445/wd/hub"}}}}' +lib/composer/bin/behat -c tests/ui/config/behat.yml diff --git a/tests/travis/start_php_dev_server.sh b/tests/travis/start_php_dev_server.sh new file mode 100644 index 000000000000..c7e644c0f7c0 --- /dev/null +++ b/tests/travis/start_php_dev_server.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +# ownCloud +# +# @author Artur Neumann +# @copyright 2017 Artur Neumann info@individual-it.net +# + + +set -e + +php -S $SRV_HOST_NAME:$SRV_HOST_PORT > /dev/null 2>&1 & diff --git a/tests/ui/config/behat.yml b/tests/ui/config/behat.yml new file mode 100644 index 000000000000..d8dd63b8b947 --- /dev/null +++ b/tests/ui/config/behat.yml @@ -0,0 +1,18 @@ +default: + autoload: + '': %paths.base%/../features/bootstrap + extensions: + Behat\MinkExtension: + browser_name: 'chrome' + SensioLabs\Behat\PageObjectExtension: ~ + + suites: + default: + paths: + - %paths.base%/../features + contexts: + - FeatureContext: + - LoginContext: + - UsersContext: + + diff --git a/tests/ui/features/bootstrap/FeatureContext.php b/tests/ui/features/bootstrap/FeatureContext.php new file mode 100644 index 000000000000..cbe6a6f45574 --- /dev/null +++ b/tests/ui/features/bootstrap/FeatureContext.php @@ -0,0 +1,11 @@ +. +* +*/ + +use Behat\Behat\Context\Context; +use Behat\MinkExtension\Context\RawMinkContext; + +use Page\LoginPage; + +require_once 'bootstrap.php'; + +/** + * Login context. + */ +class LoginContext extends RawMinkContext implements Context +{ + private $loginPage; + private $filesPage; + public function __construct(LoginPage $loginPage) + { + $this->loginPage = $loginPage; + } + + /** + * @Given I am on login page + */ + public function iAmOnLoginPage() + { + $this->loginPage->open(); + } + + /** + * @When I login with username :username and password :password + */ + public function iLoginWithUsernameAndPassword($username, $password) + { + $this->filesPage = $this->loginPage->loginAs($username, $password); + $this->loginPage->waitTillPageIsloaded(10); + } + + /** + * @Then a file with the name :filename should be listed + */ + public function aFileWithTheNameShouldBeListed($filename) + { + $this->filesPage->findFileInList($filename)->isVisible(); + } +} diff --git a/tests/ui/features/bootstrap/UsersContext.php b/tests/ui/features/bootstrap/UsersContext.php new file mode 100644 index 000000000000..f4a6cd8a3376 --- /dev/null +++ b/tests/ui/features/bootstrap/UsersContext.php @@ -0,0 +1,102 @@ +. +* +*/ + +use Behat\Behat\Context\Context; +use Behat\MinkExtension\Context\RawMinkContext; +use Behat\Mink\Exception\ExpectationException; + +use Page\LoginPage; +use Page\UsersPage; + +require_once 'bootstrap.php'; + +/** + * Users context. + */ +class UsersContext extends RawMinkContext implements Context +{ + private $loginPage; + private $filesPage; + private $usersPage; + public function __construct(LoginPage $loginPage, UsersPage $usersPage) + { + $this->loginPage = $loginPage; + $this->usersPage = $usersPage; + } + + /** @BeforeScenario @AdminLogin*/ + public function setUpScenario() + { + $this->loginPage->open(); + $this->filesPage = $this->loginPage->loginAs("admin", "admin"); + $this->usersPage->open(); + $this->usersPage->waitTillPageIsloaded(10); + } + + /** + * @Given quota of user :username is set to :quota + */ + public function quotaOfUserIsSetTo($username, $quota) + { + $this->usersPage->setQuotaOfUserTo($username, $quota); + } + + /** + * @When quota of user :username is changed to :quota + */ + public function quotaOfUserIsChangedTo($username, $quota) + { + $this->usersPage->setQuotaOfUserTo($username, $quota); + } + + /** + * @When page is reloaded + */ + public function pageIsReloaded() + { + $this->getSession()->reload(); + $this->usersPage->waitTillPageIsloaded(10); + } + + /** + * @Then quota of user :username should be set to :quota + */ + public function quotaOfUserShouldBeSetTo($username, $quota) + { + $setQuota=trim($this->usersPage->getQuotaOfUser($username)); + if ($setQuota!==$quota) { + throw new ExpectationException( + 'Users quota is set to "'.$setQuota. '" expected "' . + $quota . '"', $this->getSession() + ); + } + } + + /** + * @Given I am logged in as :username using the password :password + */ + public function iAmLoggedInAsUsingThePassword($username, $password) + { + $this->loginPage->open(); + $this->loginPage->loginAs($username, $password); + } +} diff --git a/tests/ui/features/bootstrap/bootstrap.php b/tests/ui/features/bootstrap/bootstrap.php new file mode 100644 index 000000000000..228ba2438689 --- /dev/null +++ b/tests/ui/features/bootstrap/bootstrap.php @@ -0,0 +1,7 @@ +addPsr4("Page\\", __DIR__. "/../lib", true); + +$classLoader->register(); \ No newline at end of file diff --git a/tests/ui/features/lib/FilesPage.php b/tests/ui/features/lib/FilesPage.php new file mode 100644 index 000000000000..bfac3977624f --- /dev/null +++ b/tests/ui/features/lib/FilesPage.php @@ -0,0 +1,39 @@ +. +* +*/ + +namespace Page; + +use SensioLabs\Behat\PageObjectExtension\PageObject\Page; + +class FilesPage extends OwnCloudPage +{ + /** + * + * @var string $path + */ + protected $path = '/index.php/apps/files/'; + public function findFileInList($filename) + { + return $this->findLink($filename); + } +} \ No newline at end of file diff --git a/tests/ui/features/lib/LoginPage.php b/tests/ui/features/lib/LoginPage.php new file mode 100644 index 000000000000..9fc712203a04 --- /dev/null +++ b/tests/ui/features/lib/LoginPage.php @@ -0,0 +1,41 @@ +. +* +*/ + +namespace Page; + +use SensioLabs\Behat\PageObjectExtension\PageObject\Page; + +class LoginPage extends OwncloudPage +{ + /** + * @var string $path + */ + protected $path = '/index.php/login'; + + public function loginAs($username, $password) + { + $this->fillField("user", $username); + $this->fillField("password", $password); + $this->findById("submit")->click(); + return $this->getPage('FilesPage'); + } +} \ No newline at end of file diff --git a/tests/ui/features/lib/OwncloudPage.php b/tests/ui/features/lib/OwncloudPage.php new file mode 100644 index 000000000000..6b4c6ea5078a --- /dev/null +++ b/tests/ui/features/lib/OwncloudPage.php @@ -0,0 +1,80 @@ +. +* +*/ + +namespace Page; + +use SensioLabs\Behat\PageObjectExtension\PageObject\Page; + +class OwncloudPage extends Page +{ + public function waitTillPageIsloaded($timeout) + { + + for ($counter=0;$counter <= $timeout;$counter++) { + $lodingIndicator=$this->find("css", '.loading'); + $visibility = $this->elementHasCSSValue( + $lodingIndicator, 'visibility', 'visible' + ); + if ($visibility===FALSE) { + break; + } + + sleep(1); + } + + } + + /** + * Determine if a Mink NodeElement contains a specific + * css rule attribute value. + * + * @param NodeElement $element + * NodeElement previously selected with + * $this->getSession()->getPage()->find(). + * @param string $property + * Name of the CSS property, such as "visibility". + * @param string $value + * Value of the specified rule, such as "hidden". + * + * @return NodeElement|bool + * The NodeElement selected if true, FALSE otherwise. + */ + protected function elementHasCSSValue($element, $property, $value) + { + $exists = FALSE; + $style = $element->getAttribute('style'); + if ($style) { + if (preg_match( + "/(^{$property}:|; {$property}:) ([a-z0-9]+);/i", + $style, $matches + )) { + $found = array_pop($matches); + if ($found == $value) { + $exists = $element; + } + } + } + + return $exists; + } +} \ No newline at end of file diff --git a/tests/ui/features/lib/UsersPage.php b/tests/ui/features/lib/UsersPage.php new file mode 100644 index 000000000000..be0e6f364099 --- /dev/null +++ b/tests/ui/features/lib/UsersPage.php @@ -0,0 +1,67 @@ +. +* +*/ + +namespace Page; + +use SensioLabs\Behat\PageObjectExtension\PageObject\Page; + +class UsersPage extends OwncloudPage +{ + /** + * + * @var string $path + */ + protected $path = '/index.php/settings/users'; + + public function findUserInTable($username) + { + $userTrs = $this->findAll('xpath', ".//table[@id='userlist']/tbody/tr"); + + foreach ( $userTrs as $userTr ) { + $user = $userTr->find("css", ".name"); + if ($user->getText() === $username) { + return $userTr; + } + } + throw new \Exception("Could not find user '$username'"); + } + + public function getQuotaOfUser($username) + { + $userTr = $this->findUserInTable($username); + $selectField = $userTr->find( + 'xpath', + ".//select[@class='quota-user']//option[@selected='selected']" + ); + return $selectField->getText(); + } + + public function setQuotaOfUserTo($username, $quota) + { + $userTr = $this->findUserInTable($username); + $selectField = $userTr->find( + 'xpath', + ".//select[@class='quota-user']//option[contains(text(), '".$quota."')]" + ); + $selectField->click(); + } +} \ No newline at end of file diff --git a/tests/ui/features/login.feature b/tests/ui/features/login.feature new file mode 100644 index 000000000000..2d2b4d805bb4 --- /dev/null +++ b/tests/ui/features/login.feature @@ -0,0 +1,6 @@ +Feature: login + + Scenario: simple login + Given I am on login page + When I login with username "admin" and password "admin" + Then a file with the name "welcome.txt" should be listed \ No newline at end of file diff --git a/tests/ui/features/users.feature b/tests/ui/features/users.feature new file mode 100644 index 000000000000..c48be59c1a70 --- /dev/null +++ b/tests/ui/features/users.feature @@ -0,0 +1,16 @@ +Feature: users + + @AdminLogin + Scenario Outline: change quota to a value from dropdown list + Given quota of user "admin" is set to "" + When quota of user "admin" is changed to "" + And page is reloaded + Then quota of user "admin" should be set to "" + + Examples: + |start_quota|wished_quota| + |Unlimited |5 GB | + |Unlimited |1 GB | + |1 GB |5 GB | + |5 GB |Unlimited | + |1 GB |Unlimited | \ No newline at end of file