Running Acceptance Tests



All dependencies except for Firefox 3 are installed automatically via Maven dependencies. Selenium may be able to find and start Firefox automatically, but if not, put one of the following lines in your local properties depending on which version of Firefox your Ubuntu defaults to:

  • If the default is Firefox 2 (Ubuntu 8.04 or earlier):
    selenium.browser.start.command=*chrome /usr/lib/firefox/firefox-2-bin
  • If the default is Firefox 3 (Ubuntu 8.10 or later) AND you've manually installed Firefox 2:
    selenium.browser.start.command=*chrome /home/keith/dist/firefox-2/firefox-bin

NOTE: The version selenium we use supports upto Firefox 3.5, Firefox 3.6 or later won't run acceptance tests.


Acceptance tests currently run against port 8083, so stop any app server you have running on port 8083 prior to executing the acceptance tests.

Running from the command line

  • cd to acceptanceTests directory
  • Run all the tests:
    • mvn clean install
  • Run one test:
    • Start your app server, or start cargo from the command line: mvn jetty:run-war ( you may need to set the MAVEN_OPTS variable to increase the memory available to jetty like so - 
    • $: export MAVEN_OPTS="-Xms512m -Xmx1024m -XX:MaxPermSize=512m"
    • Start Selenium: mvn selenium:start-server -Pdev
    • If your test requires initial sql data: mvn pre-integration-test
    • mvn integration-test -Dtest=TheNameOfYourTestClass

You may would like to adapt Maven Settings Xml to avoid Cargo re-downloading the app server after every clean.

Running from Eclipse

  • start your "acceptance mode" server (see launchers in the "server-workspace" project)
  • start the Selenium server
    • in a terminal, cd to the acceptanceTests directory (dev profile keeps the server running until stopped by a control-C)
mvn selenium:start-server -Pdev
  • Due to MIFOS-4177, you may have to override two properties in your ~/.mifos/ (and remove them when Running From The Commandline, see bug)
  • If your test requires initial sql data, in acceptanceTests directory run: mvn pre-integration-test
  • In Eclipse:
    • run the TestNG acceptance test (bring up the test class, right-click on the editor, select "Run as test".)
    • Note that if you don't have a Run Configuration for the test, you may need to make one: Run → Run Configurations, select TestNG, click the New Configuration icon.

Slowing down the Selenium tests

  1. Open the Run Configuration entry for your TestNG test. (Run → Run Configurations, select the test you want to slow down.)
  2. Select the Arguments tab.
  3. Paste the following in the VM Arguments box: -Dmifos.selenium.delay="500"
  4. Click Apply, then Run.

This will take effect until you remove this argument.

The number is in milliseconds. This will add a 500ms delay to every action taken by Selenium by the acceptance test. You can change the "500" to any integer number of milliseconds you want.

How it works:

Spring now instantiates the DefaultSelenium bean called "selenium" that is used by the tests. SeleniumSpeedControl is an aspect that is applied to the selenium bean. It has a delay after every public method invocation. To activate it, you set a Java System Property called mifos.selenium.delay

Slowing/Debugging a specific test operation

Occasionally you may wish to slow down a test at a critical moment of the test exection without delaying the entire test or set of tests.

  1. Find the location in your test class where the test should be delayed.
  2. Add a sleep from the UiTestUtils class to the test. Example of a 30 second sleep: UiTestUtils.sleep(30000);
  3. Execute the test and watch the browser to collection the information you need.
  4. Remove the sleep. Enabled acceptance tests should not include sleep commands as this slows down the test framework for all test runs.


  • If your tests are running exceptionally slow, check the MySQL property innodb_flush_log_at_trx_commit. If it is set to "1", change it to "0" and restart MySQL. The my.ini file describes the behavior for each setting.
  • When running from the commandline, if the cargo app server start hangs, this means you probably already have a server running (in Eclipse or somewhere else). Stop it, stop the build, and try again.
  • If you want to manually verify things in the container are working, use maven to start it: mvn jett:run-war This will start cargo and leave it running. You can then connect to it using a web browser.
  • Running acceptance tests through the "Run as test" option noted above occasionally has launch configuration errors due to changes the project configuration. If you encounter this error, delete the existing configuration by selecting the TestNG configuration on the Run Configurations dialog, then right-click and delete the existing configuration. Then create a new configuration for the test as described above. It may also be necessary to delete ECLIPSE_WORKSPACE/.metadata/.plugins/org.eclipse.debug.core/.launches/* while Eclipse is not running.
  • If the acceptance test suite seem to "pause" between different tests (for more than a few seconds), the problem is most likely your MySQL configuration. Try using the my-medium.ini that comes with MySQL (attached at the bottom of this page as my.ini), instead of the default my.ini/my.cnf.
  • If the acceptance test suite takes many hours to run, see the point above.
  • If a test gets a "page not found" response to initializeApplication.ftl, make sure mifos.mode is set to "acceptance" as mentioned above in Running From Eclipse
  • Ensure that loggerconfiguration.xml is present in HOME/.mifos configuration folder

Developing Acceptance Tests

See WritingAcceptanceTests. Additionally:

  • Gazelle and Cheetah
    • Work in progress tests: tests in the "workInProgress" TestNG group will not be run as part of the build, and can safely be checked in without breaking the build. Remember to remove the test from this group when you are done with the test!
  • Cheetah
    • Initial data can be loaded into the database by adding sql scripts to the root pom.xml's insert-data profile. These scripts should NOT alter the database structure.
    • Not seeing your changes? The acceptance tests use the latest war file from the local Maven repository, which is placed there by a mvn clean install in the application/ module.

Customizing Application Behavior

An application configuration that controls how Mifos operates during acceptance tests is possible by creating and placing the file in one of the MifosConfigurationLocations. This file may customize any of the settings present in, similarly to how applicationConfiguration custom properties works for customizing normal Mifos runtime behavior