Why selenium 2 ?
Selenium 2.0 is including htmlUnit, which makes it easy to run on an headless server. The driver used (htmlUnit, firefox, …) can be changed, and then drive a real browser.
Functional testing is missing in Apache OFBiz. We already have a lot of unit and services testing, but nothing in a functional way.
Adding webDriver to the project, and making it easy to use will help ensuring a better project consistency, as well as a bigger functionality coverage.
A further development will be the use of the simple method DSL for the functional testing, like the one already existing. This part won’t be covered by this year’s GSoC.
How to ?
the goal is to have an ant task dedicated to this job. In a first iteration, we’ll only concentrate our efforts on making it run with HtmlUnit. Then, we’ll add some options, so the driver can be chosen.
The code will be written in framework/testtools
The architecture will be copied on the existing run-tests task.
Tests will be listed in each component in the ofbiz-component.xml file. A new type will be created for those : func-test-suite
In the NameOfTestSuite.xm file, the syntax will remain the same:
The java class will only contain the test, all the preparation will be handled by the framework.
What will be used:
- selenium webdriver 2.1 : http://code.google.com/p/selenium/downloads/list
- Junit 3.8 : already included in Apache OFBiz