Testing in Firefox- Mochitest!

You’ve just written a feature or changed a large number of file including javascript- hopefully! you want to test it.  So I am back this week with a testing tool that Firefox use for testing 🙂   I will try my hard to explain my experience 😛


Mochitest is an automated testing framework built on top of the MochiKit JavaScript libraries. It’s just one of the automated regression testing frameworks used by Mozilla. Tests report success or failure to the test harness using JavaScript function calls.

Mochitest’s use JavaScript function calls to communicate test success or failure that can make it unsuitable for certain types of test. Only things that can in some way be tested using JavaScript (with chrome privileges!) can be tested with this framework. Firefox uses a little part of Selenium testing tool.

How to Run Mochitest

So as we always do- Run  ./mach build after your changes.

The Mozilla build machines run Mochitest as part of the build and test process, so we get to know pretty quickly if someone commits a change to the source code that breaks something. However, you still run Mochitest yourself before you commit any risky new code. You don’t want to be the one who wastes everyone’s time by breaking the tree   😛

For Running Mochitest:

./mach mochitest

Run the above command after your build is completed and wait until the completion of tests. Avoid using Keyboard and mouse while running Mochitest. I will update the blog with a screenshot ASAP. As I don’t have any screenshot yet.

I am in my Computer lab- there is no professor around!  so I thought- why not I use this time to write a  blog 😀

It has been so long I haven’t written anything about my work. Currently, I am working on Few Reader mode bugs.  I will write about this on my next blog. Stay tuned  🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s