QA/TDAI/MozMillTestTool/JSTestObject
Javascript Based Test Objects
The object infrastructure within the application is created through an extension (currently named MozMill in the source). This extension loads the ported Windmill libraries for detection, control, and access to the UI elements. Tests are simply scripts that make use of these elements to drive the application.
Additionally, some test harness infrastructure is loaded to surround the tests and to capture their results so that this can be reported through MozRepl back to the Python Controller.
Test Harness Object Hierarchy
Test Manager
- Loads Tests
- Contains a List of Result Objects (one from each test)
- Runs Tests
- Gets result object from test
Test
- Parent object for all actual tests
- Contains helper functions for tests like is(someconditionor-UI-state)
- Maintains the result object for this test
- Provides result object when the test ends
- Maintains a time out in case test stalls
Result Object
- Contains a result tuple from various assertions made during a test
- For example one tuple could be: (ObjId:URLBar, Value:Exists, "Check to be sure URL Bar exists (user defined statement)", Status: PASS)
- Sample values: Matches (to some variable), Exists, NotExists, NULL, (null might be used if the test threw an unexpected error and we want to catch that contingency in our test).
JS Bridge interface
Might not be needed since MozRepl handles so much of the communication we might be able to handle this with simple serialized JSON from the Test Manager directly to the wire. But, since abstraction is usually good, let's say it does exist
- Sends serialized JSON onto the MozRepl telnet session for the Python Controller to pick up.
- Receives serialized JSON commands to and interprets those for use in testing.
- Instantiates and destroys the Test Manager
- Has a Debug Mode that prints tons of information to the MozRepl telnet interface for debugging.
Windmill Object Hierarchy
The Windmill objects and their interactions are probably better described in the Windmill book. We will describe here whatever changes we must do to these interfaces in order to make them work from inside chrome and pointing at both XUL and content elements.