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
- Download from Mozilla Add-ons
- Subversion repository: Trunk, Branches, Tags
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