Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

[UI Script] Add a new button to the toolbar of test runs


#1

The following UI script adds a new button to the toolbar of test runs.

[code]name: Add a button to the test run toolbar
description: Adds a new button to the toolbar of test runs
author: Gurock Software
version: 1.0
includes: ^runs/view
excludes:

js:
(document).ready( function() { /* Create the button */ var image = uiscripts.env.resource_base + "images/icons/running.png"; var button = ("<span class=“actions”><a href=“javascript:void(0)”><img width=“8” height=“16” src="" + image + “”/> New Button");

    /* Add it to the toolbar */
    $("div#contentHeader span.actions:last").before(button);

    /* Bind the click event */
    $("a", button).click(
        function()
        {
            alert('Clicked!');
        }
    );
}

);[/code]

Regards,
Tobias