Tips

Last modified by Guillaume Delhumeau on 2023/03/09 11:37

Feb 08 2016

How I run functional tests

In XWiki, we use Selenium to run functional tests. It opens a browser window (firefox), goes to your wiki, and verifies that the UI works as expected.

However, the last version of Firefox is not always supported by Selenium. Most of the time, this is the case when you run functional tests on a old version of XWiki (old meaning here "not the last one").

The workaround is to have an old version of firefox installed on your computer, in addition with the one you use for your everyday life.

You can get an old firefox on the mozilla ftp directory.

I currently use the version 35 for this use-case.

Then, you need to tell bash to use it, like this:

export PATH=/home/gdelhumeau/downloads/firefox:$PATH
## replace /home/gdelhumeau/downloads/firefox by the path where you have installed firefox

But you should enable this old firefox only to run functional tests. For this reason, I actually have added a new alias in .bash_aliases:

alias mvn='export PATH=/home/gdelhumeau/downloads/firefox:$PATH && mvn'

Now, the old firefox will be used each time you run a Maven command, but it won't affect your default browser configuration.

How I run IntellIJ

IntellIJ IDEA is an excellent IDE for Java and I enjoy using it when I work for XWiki.

To install it, I've just uncompressed the package in some places, and then I have written the following script to start it:

#!/bin/sh
## Use the old firefox when running functional tests from Intellij
export PATH=/home/gdelhumeau/downloads/firefox:$PATH
## Fix a bug with the keyboard on Ubuntu (see: http://askubuntu.com/questions/501907/keyboard-locks-in-intellij-idea-on-ubuntu-14-04)
export XMODIFIERS=idea.sh
## Change the current dir and start IDEA
cd /home/gdelhumeau/bin/idea-IU-143.1821.5/bin && sh idea.sh

To do an upgrade if the IDE, I just uncompress the archive and replace the path in my script.

How I write complex content in XWiki (Velocity, JavaScript, etc...)

When I need a good editor to edit some content in a running XWiki, I use the It's all text plugin for Firefox. Then I can use gedit.

I hope it helps! ...