roundcubemail/tests/Browser
Pablo Zmdl 7d408ddb6e
Some checks are pending
E2E / Linux / PHP ${{ matrix.php }} (8.1) (push) Waiting to run
E2E / Linux / PHP ${{ matrix.php }} (8.3) (push) Waiting to run
CI / Coding Style (push) Waiting to run
CI / Static Analysis (push) Waiting to run
Message Rendering / Linux / PHP 8.3 (push) Waiting to run
Unit / Linux / PHP ${{ matrix.php }} (8.1) (push) Waiting to run
Unit / Linux / PHP ${{ matrix.php }} (8.2) (push) Waiting to run
Unit / Linux / PHP ${{ matrix.php }} (8.3) (push) Waiting to run
Unit / Linux / PHP ${{ matrix.php }} (8.4) (push) Waiting to run
Unit / Windows / PHP ${{ matrix.php }} (8.1) (push) Waiting to run
Unit / Windows / PHP ${{ matrix.php }} (8.2) (push) Waiting to run
Unit / Windows / PHP ${{ matrix.php }} (8.3) (push) Waiting to run
Unit / Windows / PHP ${{ matrix.php }} (8.4) (push) Waiting to run
Fix flaky browser test
2025-09-05 00:24:53 +02:00
..
Components Rename test files for PHPUnit 10+ (#9477) 2024-06-05 07:46:51 +02:00
Contacts wait for list to load in Browser\Contacts\ExportTest::testExportSelected test 2025-01-03 14:55:33 +00:00
data Fix database initialization for the browser tests 2021-10-03 17:01:32 +02:00
downloads Docker compose for testing (#9525) 2024-07-22 11:44:09 +02:00
Logon Rename test files for PHPUnit 10+ (#9477) 2024-06-05 07:46:51 +02:00
Mail Fix flaky browser test 2025-09-05 00:24:53 +02:00
Settings CS-Fixer: Enable modernize_strpos 2025-08-15 13:20:24 +02:00
bootstrap.php Rename test files for PHPUnit 10+ (#9477) 2024-06-05 07:46:51 +02:00
Browser.php Docker compose for testing (#9525) 2024-07-22 11:44:09 +02:00
install.php Bump laravel/dusk version 2025-03-16 13:46:29 +01:00
phpunit.xml Add phpunit slow detector (#9320) 2024-04-10 12:29:58 +02:00
README.md Tests: Fix compatibility with Dusk 7.9 2023-07-30 10:34:04 +02:00
TestCase.php Fix new phpstan errors 2025-04-29 15:43:50 +02:00

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 and Chrome WebDriver. PHP server is used to serve Roundcube instance on tests run.

INSTALLATION

Installation:

  1. Install Laravel Dusk with all dependencies.
composer require "laravel/dusk:^7.9"
  1. 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]
  1. 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 imap_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:

  // 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: Do not use devel_mode=true (i.e. you should build Elastic styles), it makes chrome-driver to behave weird, timing out when using iframes (which we do a lot).

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
  TESTS_MODE=desktop phpunit
  TESTS_MODE=phone phpunit
  TESTS_MODE=tablet phpunit