In order to facilitate testing of the software we are producing and releasing we automate part of the tests that we frequently do on the system to verify that it works as expected.
This document presents the basics about Test Automation as is done on Openbravo ERP.
If you are looking a fast way to start automating, please read the Quick start guide
For integration testing we refer to the tests that are executed against all different parts of the software, combined to form the complete, integrated system.
Current automation test cases are managed in Testlink. You need to register in order to view the Smoke Test.
The main tool we use to automate ERP integration tests is Selenium, a free software testing framework for web applications.
Ant is used for the build process and command line tests execution. For example, we have an ant task that runs daily to perform a smoke test on pre-integration code. And we can also use it to define the series of preconditions required by a test. Thus we could test every functionality by separate.
We use JUnit as a testing framework to define test cases, test suites, parameters; and to assert that the expected behaviour matches the one shown by the application. With Junit we can define abstract test cases adding the Test annotation to functions. And we can define the parameters in a separate class using the Parameters annotation. The main benefit of this is that we can reuse the test cases with different parameters for different contexts. And with Junit assertions we can code in a readable way what is the expected result of the test.
In addition to that, Junit collects the results of the tests and all system variables present during the execution. It presents the results in a nice formatted way that allows us to inspect them after execution and understand the failed assertions.
Sometimes we also use DbUnit, a Junit extension for database testing, to insert the dependencies of tests into the database.
Then we prefer the Eclipse IDE to code our tests because it allows to run and debug junit tests in an easy way. So while doing a new test we can check that selenium is running what we expect and that junit is doing all the required assertions.
Finally there are other optional tools that we use to ease the automation.
There is a Quick Start Guide that explains how to start using all these tools to automate and execute tests on Openbravo ERP.
Daily build execution
The automation is executed on a daily basis. See more details.
Branches and code promotion
There are multiple branches to develop automation tests. Those developments are then integrated and promoted to a stable branch.
Dealing with screenshots
Selenium executions finding errors will generate an screenshot for helping to understand what went wrong. See more details.
Totally Data-Driven Automated Testing.