Automated Testing/Execute from command line
First, you need to have a working installation of Openbravo ERP.
Contents |
Check out Openbravo ERP automation source code
To be able to clone Openbravo ERP testing code from main you need to install Mercurial.
Once Mercurial client is installed, move to the directory where you want to clone the last testing code tag and type in command line:
hg clone https://code.openbravo.com/tools/automation/main/ main
Move to main/config directory and configure OpenbravoERPTest.properties.
Then, you need to install some things:
Execute Openbravo ERP tests
Now, you can move to the directory and use ant to execute the different tests already automated.
For example, with:
ant test.integration.smoke
ant will run the smoke test suite.
There are more possible ant tasks. Some are specific to a section of the application; and you can choose to run just one test and all it's preconditions.
You can also run a specific test class with:
ant test.integration -Dtestclass=com.openbravo.test.integration.smoke.masterdata.A_01_InitialClientSetup
replacing com.openbravo.test.integration.smoke.masterdata.A_01_InitialClientSetup with the test class you want to run.
Note: If you run just one test class and not it's corresponding ant task, the preconditions for the Iclass are not going to be run. |
Running on a server without and X Window System
X virtual framebuffer can be used if the server that will be used to execute selenium tests has no X Window System.
To run the virtual framebuffer as display ":1", execute:
startx -- `which Xvfb` :1 -screen 0 1024x768x24 2>&1 >/dev/null &
Then, to run the tests do something like this:
DISPLAY=:1 ant test.integration.smoke
On a ubuntu system
If you are like me who is going to run the headless system on ubuntu (I tried in jaunty x86_64). The following instruction will help.
- Install the required package
apt-get install tightvncserver icewm
- Create a user name (i created user openbravo) and create xstartup
mkdir ~/.vnc touch ~/.vnc/xstartup chmod a+x ~/.vnc/xstartup
- Add the following content in ~/.vnc/xstartup
#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid black exec icewm-session
- Start the vncserver
vncserver -geometry 1280x960 -depth 8
- Stop the vncserver
vncserver -kill :1
- Try connecting from your machine
vncviewer dns.yourmachine.com:5901
- If not connecting do the following
- Make sure vncserver is running (cmd:pgrep Xtightvnc)
- Check on what port its listening (cmd: netstat -anpt | grep Xtightvnc)
- Make sure that the required policy is added in the firewall
Category: Automated Testing ERP

