commit | author | age
|
d220eb
|
1 |
Running Selenium Tests |
TB |
2 |
====================== |
|
3 |
|
|
4 |
In order to run the Selenium-based web tests, some configuration for the |
|
5 |
Roundcube test instance need to be created. Along with the default config for a |
|
6 |
given Roundcube instance, you should provide a config specifically for running |
|
7 |
tests. To do so, create a config file named `config-test.inc.php` in the |
|
8 |
regular Roundcube config dir. That should provide specific `db_dsnw` and |
|
9 |
`default_host` values for testing purposes as well as the credentials of a |
|
10 |
valid IMAP user account used for running the tests with. |
|
11 |
|
|
12 |
Add these config options used by the Selenium tests: |
|
13 |
|
|
14 |
```php |
|
15 |
// Unit tests settings |
|
16 |
$config['tests_username'] = 'roundcube.test@example.org'; |
|
17 |
$config['tests_password'] = '<test-account-password>'; |
|
18 |
$config['tests_url'] = 'http://localhost/roundcube/index-test.php'; |
|
19 |
``` |
|
20 |
|
|
21 |
The `tests_url` should point to Roundcube's index-test.php file accessible by |
|
22 |
the Selenium web browser. |
|
23 |
|
|
24 |
WARNING |
|
25 |
------- |
|
26 |
Please note that the configured IMAP account as well as the Roundcube database |
|
27 |
configred in `db_dsnw` will be wiped and filled with test data in every test |
|
28 |
run. Under no circumstances you should use credentials of a production database |
|
29 |
or email account! |
|
30 |
|
|
31 |
|
|
32 |
Run the tests |
|
33 |
------------- |
|
34 |
|
|
35 |
First you need to start a Selenium server. We recommend to use the |
|
36 |
[Selenium Standalone Server][selenium-server] but the tests will also run on a |
|
37 |
Selenium Grid. The tests are based in [PHPUnit_Selenium][phpunit] which can be |
|
38 |
installed through [PEAR][pear-phpunit]. |
|
39 |
|
|
40 |
To start the test suite call `phpunit` from the Selenium directory: |
|
41 |
|
|
42 |
``` |
|
43 |
cd <roundcube-dir>/tests/Selenium |
|
44 |
phpunit |
|
45 |
``` |
|
46 |
|
|
47 |
[phpunit]: http://phpunit.de/manual/4.0/en/selenium.html |
|
48 |
[pear-phpunit]: http://pear.phpunit.de/ |
|
49 |
[selenium-server]: http://docs.seleniumhq.org/download/ |