RoundCube Webmail
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.3 KiB

  1. In-Browser Tests
  2. ================
  3. The idea of these testing suite is to make it as simple as possible to execute
  4. the tests. So, you don't have to run any additional services, nor download
  5. and install anything manually.
  6. The tests are using [Laravel Dusk][laravel-dusk] and Chrome WebDriver.
  7. PHP server is used to serve Roundcube instance on tests run.
  8. INSTALLATION
  9. ------------
  10. Installation:
  11. 0. Note that the suite requires PHP >= 7.2 and PHPUnit >= 7.5.
  12. 1. Install Laravel Dusk with all dependencies.
  13. ```
  14. composer require "laravel/dusk:~6.17.0"
  15. ```
  16. 2. Install Chrome WebDriver for the version of Chrome/Chromium in your system. Yes,
  17. you have to have Chrome/Chromium installed.
  18. ```
  19. php tests/Browser/install.php [version]
  20. ```
  21. 3. Configure the test account and Roundcube instance.
  22. Create a config file named `config-test.inc.php` in the Roundcube config dir.
  23. That file should provide specific `db_dsnw` and
  24. `default_host` values for testing purposes as well as the credentials of a
  25. valid IMAP user account used for running the tests with.
  26. Add these config options used by the Browser tests:
  27. ```php
  28. // Unit tests settings
  29. $config['tests_username'] = 'roundcube.test@example.org';
  30. $config['tests_password'] = '<test-account-password>';
  31. ```
  32. WARNING
  33. -------
  34. Please note that the configured IMAP account as well as the Roundcube database
  35. configred in `db_dsnw` will be wiped and filled with test data in every test
  36. run. Under no circumstances you should use credentials of a production database
  37. or email account!
  38. Please, keep the file as simple as possible, i.e. containing only database
  39. and imap/smtp settings needed for the test user authentication. We would
  40. want to test default configuration. Especially only Elastic skin is supported.
  41. NOTE: Do not use devel_mode=true (i.e. you should build Elastic styles),
  42. it makes chrome-driver to behave weird, timing out when using iframes (which we do a lot).
  43. NOTE: See `.ci` directory for sample config and scripts we use for in-browser
  44. tests on Travis.
  45. EXECUTING THE TESTS
  46. -------------------
  47. To run the test suite call `phpunit` from the tests/Browser directory:
  48. ```
  49. cd <roundcube-dir>/tests/Browser
  50. TESTS_MODE=desktop phpunit
  51. TESTS_MODE=phone phpunit
  52. TESTS_MODE=tablet phpunit
  53. ```
  54. [laravel-dusk]: https://github.com/laravel/dusk