Test Rollup
addScript rollup
open ../tests/html/test_rollup.html  
rollup cake
rollup biscuits n=1
verifyNotChecked name=one
verifyChecked name=dos
verifyChecked name=san
rollup biscuits n=2
verifyChecked name=one
verifyNotChecked name=dos
verifyChecked name=san
rollup biscuits n=3
verifyNotChecked name=one
verifyChecked name=dos
verifyNotChecked name=san
rollup steamed spinach
removeScript rollup  
var rm = new RollupManager();

rm.addRollupRule({
    name: 'cake'
    , description: "Why we're all here"
    , commandMatchers: []
    , expandedCommands: [
          new Command('verifyNotChecked', 'name=one')
        , new Command('verifyNotChecked', 'name=dos')
        , new Command('verifyNotChecked', 'name=san')
        , new Command('click', 'name=san')
        , new Command('click', 'name=dos')
        , new Command('click', 'name=one')
        , new Command('verifyText', 'id=message', 'HAPPY BIRTHDAY!')
    ]
});

rm.addRollupRule({
    name: 'biscuits'
    , description: "The rest of the time"
    , commandMatchers: []
    , getExpandedCommands: function(args) {
        var commands = [];
        if (args.n >= 1) {
            commands.push(new Command('click', 'name=one'));
        }
        if (args.n >= 2) {
            commands.push(new Command('click', 'name=dos'));
        }
        if (args.n >= 3) {
            commands.push(new Command('click', 'name=san'));
        }
        return commands;
    }
});

rm.addRollupRule({
    name: 'steamed spinach'
    , description: "No complaints"
    , commandMatchers: []
    , expandedCommands: [
          new Command('rollup', 'biscuits', 'n=2')
        , new Command('rollup', 'biscuits', 'n=1')
        , new Command('rollup', 'cake')
    ]
});