UnitTest.XUL, aka UxU (pronounced as "wu-zu"), is an xUnit testing framework for developers of Firefox/Thunderbird addons and XULRunner applications.
- How to write testcases for UxU?
- Testing Greasemonkey scripts by UxU
- Helper methods for testcases
- How to write testcases with mocks?
- How to control UxU from remote?
- Command line options
Download
All Versions
- UxU 1.0.1 (2012.8.7)
- General
- Support
requiredAddons(akadependingAddons) option for test cases. Now you can specify required addons for the test case as an array of ID strings. - Inherit installed addons to the temporary profile, when the test case has both specified profile and
requiredAddons.
- Support
- UxU 1.0.0 (2012.7.24)
- General
- Support Firefox 10 ~ 16
- Drop support for Firefox under 9
- Add assertions: assert.same() and assert.notSame()
- Check strict equality (===)
- Extend Greasemonkey helper methods
- Support GM_listValues()
- Support GM_deleteValue()
- Add an option "ignoreLastResult" to the TestCase class
- If the option is true, the last result of a test in the test caseis not regarded while checking if the test should be run or not
- Allow users to limit the number of test cases running concurrently from the configuration dialog
- Initialize file fields in the configuration dialog correctly
- Support Firefox 10 ~ 16
- Test Runner
- Now tests results can be filtered by the type of the each test
- Now stack traces are resizable
- Now lines correspond to internal functions in stack traces are displayed in a pale color
- Command Line
- Now tests can be aborted by sending a SIGINT signal
- Add a
--run-alloption- Forces all tests to run regardless of the priority of the each test
- Add a
--uxu-max-parallel-countoption- Limits the number of test cases running concurrently
Abstract
UxU is an testing framework for Mozilla addons, based on MozLab. Features:
- You can write testcases in xUnit format.
- Multiple testcases are available. When you specify a folder, UxU collects all testcases from the folder recursively and runs them.
- Many useful features, "yield" which like a "sleep" and number of helper methods, are available for automated test around GUI and deferred page-load. UxU is useful not only for unit testing but for functional testing.
- UxU can test Greasemonkey scripts.
- UxU can run testcases written for MozUnit. UxU's Test Runner GUI is compatible to MozUnit, so you can test your addons by XUL just now.
How to start
Test Runner GUI: "Tools" -> "UnitTest.XUL" -> "Test Runner"
UxU Server, to control UxU from other processes: turn on the checkbox "Server" bottom left of the Test Runner window. You can connect to UxU Server as "localhost:4444" by telnet or other programs. See also How to control UxU from remote?
See How to write testcases for UxU? to study writing rules of testcases.
Test Runner
"Diff" of expected vs actual, for assertions