Running Tests From Extensions

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with 'This page explains how to run tests from Firebug extensions. == Run Tests From Extensions == Firebug test harness allows also running tests from all installed extensions at once…')
(Run Tests From Extensions)
Line 4: Line 4:
Firebug test harness allows also running tests from all installed extensions at once. This make possible to not only test Firebug itself, but also all installed extensions and possible conflicts among them.
Firebug test harness allows also running tests from all installed extensions at once. This make possible to not only test Firebug itself, but also all installed extensions and possible conflicts among them.
-
In order to automatically load exposed test suites from extensions into the test console you need to write following URL into the address bar and press enter.
+
In order to automatically load exposed test suites from extensions into the test console you need to write following URL into the FBTest Console's address bar (test list url) and press enter.
<code>fbtest:all</code>
<code>fbtest:all</code>
-
The second option is to right click on the address bar and pick ''Load Registered Tests''.
+
The second option is to right click on the above address bar and pick ''Load Registered Tests''.
-
 
+
-
As soon as you see all tests loaded (tests from Firebug itself are loaded too), you can press ''Run All'' on the toolbar as usual.  
+
 +
As soon as you see all tests loaded (tests from Firebug itself are loaded too), you can press ''Run All'' on the toolbar as usual.
== Expose Tests From an Extension ==
== Expose Tests From an Extension ==

Revision as of 21:48, 2 November 2010

This page explains how to run tests from Firebug extensions.

Run Tests From Extensions

Firebug test harness allows also running tests from all installed extensions at once. This make possible to not only test Firebug itself, but also all installed extensions and possible conflicts among them.

In order to automatically load exposed test suites from extensions into the test console you need to write following URL into the FBTest Console's address bar (test list url) and press enter.

fbtest:all

The second option is to right click on the above address bar and pick Load Registered Tests.

As soon as you see all tests loaded (tests from Firebug itself are loaded too), you can press Run All on the toolbar as usual.

Expose Tests From an Extension

In order to get test-list URLs from installed extensions, the test console dispatches an event to all modules as follows:

var testLists = [];
dispatch(Firebug.modules, "onGetTestList", [testLists]);

An extension can handle the event and expose its test-list URL:

Firebug.FireCookieModule = extend(Firebug.Module,
{
    ...
    onGetTestList: function(testLists)
    {
        testLists.push({
            extension: "Firecookie",
            testListURL: "chrome://firecookie/content/testList.html"
        });
    }

}
Personal tools