Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117881463
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
9 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/.github/run.sh b/.github/run.sh
index 6a16b2b53..e15fbe47e 100755
--- a/.github/run.sh
+++ b/.github/run.sh
@@ -1,38 +1,38 @@
#!/bin/bash
# The script is intended for use on Travis with Trusty distribution
# It installs in-browser tests dependencies and prepares Roundcube instance
-GMV=1.5.11
-CHROMEVERSION=$(google-chrome-stable --version | tr -cd [:digit:]. | cut -d . -f 1)
+GMV=1.6.13
+CHROMEVERSION=$(google-chrome-stable --version | tr -cd [:digit:].)
GMARGS="-Dgreenmail.setup.all -Dgreenmail.users=test:test -Dgreenmail.startup.timeout=3000"
# Make temp and logs writeable
sudo chmod 777 temp logs
# Install javascript dependencies
bin/install-jsdeps.sh
# Compile Elastic's styles
lessc --clean-css="--s1 --advanced" skins/elastic/styles/styles.less > skins/elastic/styles/styles.min.css
lessc --clean-css="--s1 --advanced" skins/elastic/styles/print.less > skins/elastic/styles/print.min.css
lessc --clean-css="--s1 --advanced" skins/elastic/styles/embed.less > skins/elastic/styles/embed.min.css
# Use minified javascript files
bin/jsshrink.sh
# Install proper WebDriver version for installed Chrome browser
php tests/Browser/install.php $CHROMEVERSION
# GreenMail server download, setup and start
wget https://repo1.maven.org/maven2/com/icegreen/greenmail-standalone/$GMV/greenmail-standalone-$GMV.jar \
&& (sudo java $GMARGS -jar greenmail-standalone-$GMV.jar &) \
&& sleep 10
# Run tests
echo "TESTS_MODE: DESKTOP" \
&& TESTS_MODE=desktop vendor/bin/phpunit -c tests/Browser/phpunit.xml --exclude-group=failsonga \
&& echo "TESTS_MODE: PHONE" \
&& TESTS_MODE=phone vendor/bin/phpunit -c tests/Browser/phpunit.xml --exclude-group=failsonga-phone \
&& echo "TESTS_MODE: TABLET" \
&& TESTS_MODE=tablet vendor/bin/phpunit -c tests/Browser/phpunit.xml --exclude-group=failsonga-tablet
diff --git a/.github/workflows/browser_tests.yml b/.github/workflows/browser_tests.yml
index 63884f79a..6c4c0cb40 100644
--- a/.github/workflows/browser_tests.yml
+++ b/.github/workflows/browser_tests.yml
@@ -1,67 +1,64 @@
name: browser_tests
on:
push:
pull_request:
jobs:
browser_tests:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: true
name: Browser Tests
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: dom, curl, fileinfo, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, ldap, intl, pspell
tools: composer:v2
coverage: none
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '8'
- name: Setup problem matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Aspell
run: sudo apt-get -y install aspell aspell-en aspell-de
- name: Setup composer
run: |
cp composer.json-dist composer.json
- composer require "laravel/dusk:~6.9.0" --no-update
-
- - name: Fix PHPUnit for PHP8
- run: composer config platform.php 7.4
+ composer require "laravel/dusk:^7.9" --no-update
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Roundcube configuration
run: cp .github/config-test.inc.php config/config-test.inc.php
- name: Setup NPM
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Setup NPM deps
run: |
npm install --force -g less
npm install --force -g less-plugin-clean-css
npm install --force -g uglify-js
- name: Execute tests
run: .github/run.sh
diff --git a/tests/Browser/README.md b/tests/Browser/README.md
index b761e6eba..e67861515 100644
--- a/tests/Browser/README.md
+++ b/tests/Browser/README.md
@@ -1,72 +1,72 @@
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:
-0. Note that the suite requires PHP >= 7.2 and PHPUnit >= 7.5.
+0. Note that the suite requires PHP >= 8.0 and PHPUnit >= 7.5.
1. Install Laravel Dusk with all dependencies.
```
-composer require "laravel/dusk:~6.17.0"
+composer require "laravel/dusk:^7.9"
```
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
`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:
```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: 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
```
[laravel-dusk]: https://github.com/laravel/dusk
diff --git a/tests/Browser/install.php b/tests/Browser/install.php
index 2fae36a05..7788fb210 100644
--- a/tests/Browser/install.php
+++ b/tests/Browser/install.php
@@ -1,75 +1,78 @@
<?php
/*
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| |
| Copyright (C) The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
| |
| PURPOSE: |
| Chrome WebDriver download tool |
+-----------------------------------------------------------------------+
| Author: Aleksander Machniak <alec@alec.pl> |
+-----------------------------------------------------------------------+
*/
if (php_sapi_name() != 'cli') {
die("Not in shell mode (php-cli)");
}
if (!defined('INSTALL_PATH')) {
define('INSTALL_PATH', realpath(__DIR__ . '/../../') . '/' );
}
require_once(INSTALL_PATH . 'program/include/iniset.php');
class Installer extends Laravel\Dusk\Console\ChromeDriverCommand
{
/**
* Execute the console command.
*
* @param string $version
*
* @return void
*/
- public function install($version = null)
+ public function install($version = '')
{
- $version = $version ? preg_replace('/\..*/', '', $version) : $this->latestVersion();
- $version = trim($this->getUrl(sprintf($this->versionUrl, $version)));
- $currentOS = Laravel\Dusk\OperatingSystem::id();
+ $os = Laravel\Dusk\OperatingSystem::id();
+ $version = trim($version);
+ $archive = $this->directory . 'chromedriver.zip';
- foreach ($this->slugs as $os => $slug) {
- if ($os === $currentOS) {
- $archive = $this->download($version, $slug);
- $binary = $this->extract($archive);
+ $url = $this->resolveChromeDriverDownloadUrl($version, $os);
- $this->rename($binary, $os);
- }
- }
+ $client = new \GuzzleHttp\Client();
+
+ $response = $client->get($url);
+
+ $data = file_put_contents($archive, $response->getBody());
+
+ $binary = $this->extract($version, $archive);
+
+ $this->rename($binary, $os);
echo "ChromeDriver binary successfully installed for version $version.\n";
}
/**
* Get the contents of a URL
*
* @param string $url URL
*
* @return string|bool
*/
protected function getUrl(string $url)
{
return file_get_contents($url);
}
}
if (empty($argv[1])) {
rcube::raise_error("Chrome driver version is a required argument of this script.", false, true);
}
$installer = new Installer;
$installer->install($argv[1]);
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Apr 5, 11:56 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18831639
Default Alt Text
(9 KB)
Attached To
Mode
R113 roundcubemail
Attached
Detach File
Event Timeline