User:Jminta:QA Scratchpad

From MozillaWiki
Jump to: navigation, search

The Calendar-QA extension

The Calendar-QA extension adds easy-access to commonly performed QA functions. Development is ongoing and your feedback is encouraged.

Report a Bug

A quick link to the front-page of Bugzilla. (Note that we don't link to the bug-filing page, because you should always search for duplicates first!)

Confirming the Unconfirmed

Links to all the unconfirmed bugs in Calendar.

Verifying Fixed Bugs

Links to recently fixed Calendar bugs.

Run User Tests

Links to Litmus

Run Automated Tests

This is the most unique area of the Calendar-QA extension. By default, the extension ships with several dozen automated tests you can run. Some are known to currently fail. New tests will be added as time allows.

Running the tests

Simply click 'Run' on any single test, or choose 'Run All'.

Adding your own tests

The Calendar-QA extension makes it easy to write your own tests. Simply create a tests.js file in your profile directory. This file should have a getTests() function that will return an array of tests. Each test should have the following properties:

  • title - the name of the test
  • description - (optional) a description of the test
  • bug - (optional) the bug number the test was inspired by
  • run - a function to actually run the test. This function will receive a single argument, a 'callback' object. You should finish the test by either doing callback('passed') or callback('failed').

An example tests.js file is below:

/**
 * This function _must_ be present for drop-in tests to work
 * correctly.  It should return an array of test-objects
 */
function getTests() {
    return [exampleTest];
}

var exampleTest = {
    title: "Example test1",
    description: "A cool test I wrote!  Tests event titles",
    bug: null,
    run: function(aCallback) {
        LOG("Running dropped in test");
        var myEvent = createEvent();
        myEvent.title = "Test event";
        if (myEvent.title == "Test event") {
            aCallback("passed");
        } else {
            aCallback("failed");
        }
    }
};