Creating Dojo Object Harness (DOH) tests for Dojo test automation

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

  1. In the Enterprise Explorer, right-click the Dojo class or widget that you want to test and then select New > DOH test. The New DOH test wizard opens.
  2. 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.
  3. 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.
  4. 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.
  5. For each method that you selected in the Available methods list, add code to test the method.
  6. 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.

Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tdohcrttest.html