Prerequisites

Selenium

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:

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

HTTP Port

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

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

Running from Eclipse

mvn selenium:start-server -Pdev

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.

Troubleshooting

Developing Acceptance Tests

See WritingAcceptanceTests. Additionally:

Customizing Application Behavior

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

!my.ini