Testing

There are several aspects to the testing of widgets that pose different challenges to the developer or tester. The developer must:

The best way to get started is to create a UIM page to host the widget. Sometimes, several test pages are required for the different use cases of the widget, though sometimes these can be combined in to a single UIM page. On building and running the application, open the page to check that the widget is presented correctly.

There are several testing tools available that can automate the process of checking the structure of the HTML produced by the widget. Tools such as Canoo WebTest can be run from Apache Ant build scripts and can be integrated into the build and test process. Alternatively, the structure can be checked manually by viewing the source of the HTML page.

Manual testing is required when checking that the HTML is presented correctly after the CSS styles are applied. This also has to be repeated in all browsers and versions of browsers that will be supported, as each browser has its own way of interpreting and implementing the CSS standards.

JavaScript, similarly, can behave differently in different browsers. Testing tools exist for testing both the JavaScript code directly and testing the behavior of the JavaScript with the browser environment. The performance of JavaScript code can also vary dramatically between different browsers. It is important to establish early on if any of the supported browsers may exhibit performance problems and to change the approach early in the development cycle if necessary.

Cross-browser support is often the most difficult aspect of renderer development to get right. When problems arise, search Internet forums and web sites for others who may have had the same problem. Sometimes there is an easy solution to the problem that would have taken a long time to figure out alone. However, sometimes there is no such magic bullet and compromises in the quality of the rendering on some browsers have to be accepted.