Dojo Object Harness (DOH) test tools help you evaluate
your JavaScript and your
web page user interface. Using the DOH test tools, you can create
automated tests for your Dojo web applications.
Procedure
- In the Enterprise Explorer, right-click
the Dojo class or widget that you want to test and then select .
The New DOH test wizard opens.
- In the Class under test, if your class name is not listed,
type the initial letter and click Browse to
select it. In the Available methods list, select the methods that
you want to test. A test method is generated for each method that
you select.
- In the Types of test field, select the type of file that
you want to use for the test:
- HTML - UI support (mostly used to test Dijit widgets)
- The generated test is an HTML file. This type of test is selected
when testing Dojo widgets to include DOM elements in the test.
- JavaScript - No UI
support
- The generated test is a JavaScript file.
This type of test is selected when testing Dojo classes.
- Click Finish to generate the DOH
test. The Dojo module path mappings and the test
file are generated. The test file contains one test method for each
method that is selected in the wizard and contains asynchronous support
(if the asynchronous support was selected). If the DOH module does
not exist, the module is created. If the DOH module exists, an inclusion
statement is added to the DOH module file to include the test as part
of the test suite.
- For each method that you selected in the Available methods
list, add code to test the method.
- Save the file.
What to do next
Test your Dojo application.
For more information
on the Dojo Object Harness, refer to the Dojo Toolkit documentation for DOH.