Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F257084
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/.ci/install.sh b/.ci/install.sh
new file mode 100755
index 000000000..37d21fb9c
--- /dev/null
+++ b/.ci/install.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# The script is intended for use on Travis with Trusty distribution
+
+set -x
+
+DIR=$(dirname $0)
+
+# Enable xdebug for code coverage
+if [ "$CODE_COVERAGE" != 1 ]; then phpenv config-rm xdebug.ini || true; fi
+
+cd $DIR/..
+
+cp composer.json-dist composer.json
+
+# Add laravel/dusk for Browser tests
+if [ "$BROWSER_TESTS" = 1 ]; then composer require "laravel/dusk:~5.7.0" --no-update; fi
+
+# Remove qr-code as it requires php-gd which is not always available on Travis
+# and we don't really need it for tests
+composer remove endroid/qr-code --no-update
+
+# Install PHP dependencies
+composer install --prefer-dist
diff --git a/.travis.yml b/.travis.yml
index 34e8fa542..9aceae007 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,38 +1,34 @@
language: php
dist: trusty
sudo: false
matrix:
fast_finish: true
include:
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
env: CODE_COVERAGE=1
- php: 7.2
- php: 7.3
env: BROWSER_TESTS=1
addons:
chrome: stable
- php: 7.4
cache:
directories:
- $HOME/.composer
install:
- - if [ "$CODE_COVERAGE" != 1 ]; then phpenv config-rm xdebug.ini || true; fi
- - cp composer.json-dist composer.json
- - if [ "$BROWSER_TESTS" = 1 ]; then composer require "laravel/dusk:~5.7.0" --no-update; fi
- - composer remove endroid/qr-code --no-update
- - composer install --prefer-dist
+ - .ci/install.sh
script:
- if [ "$CODE_COVERAGE" = 1 ]; then CODE_COVERAGE_ARGS="--coverage-text"; fi; vendor/bin/phpunit -c tests/phpunit.xml $CODE_COVERAGE_ARGS
- if [ "$BROWSER_TESTS" = 1 ]; then .ci/setup.sh && vendor/bin/phpunit -v -c tests/Browser/phpunit.xml; fi
notifications:
email: false
diff --git a/tests/Browser/README.md b/tests/Browser/README.md
index 56f5d10ca..3c7b2c5ef 100644
--- a/tests/Browser/README.md
+++ b/tests/Browser/README.md
@@ -1,60 +1,63 @@
In-Browser Tests
================
The idea of these testing suite is to make it as simple as possible to execute
the tests. So, you don't have to run any additional services, nor download
and install anything manually.
The tests are using [Laravel Dusk][laravel-dusk] and Chrome WebDriver.
PHP server is used to serve Roundcube instance on tests run.
INSTALLATION
------------
Installation:
1. Add `"laravel/dusk": "~5.7.0"` to your composer.json file and run `composer update`.
2. Install Chrome WebDriver for the version of Chrome/Chromium in your system. Yes,
you have to have Chrome/Chromium installed.
```
php tests/Browser/install.php [version]`
```
3. Configure the test account and Roundcube instance.
Create a config file named `config-test.inc.php` in the Roundcube config dir.
That file should provide specific `db_dsnw` and
`default_host` values for testing purposes as well as the credentials of a
valid IMAP user account used for running the tests with.
Add these config options used by the Browser tests:
```php
// Unit tests settings
$config['tests_username'] = 'roundcube.test@example.org';
$config['tests_password'] = '<test-account-password>';
```
WARNING
-------
Please note that the configured IMAP account as well as the Roundcube database
configred in `db_dsnw` will be wiped and filled with test data in every test
run. Under no circumstances you should use credentials of a production database
or email account!
Please, keep the file as simple as possible, i.e. containing only database
and imap/smtp settings needed for the test user authentication. We would
want to test default configuration. Especially only Elastic skin is supported.
+NOTE: See `.ci` directory for sample config and scripts we use for in-browser
+tests on Travis.
+
EXECUTING THE TESTS
-------------------
To run the test suite call `phpunit` from the tests/Browser directory:
```
cd <roundcube-dir>/tests/Browser
phpunit # or ../../vendor/bin/phpunit
```
[laravel-dusk]: https://github.com/laravel/dusk
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Jun 10, 2:15 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
197134
Default Alt Text
(4 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment