Get help with testing, discuss unit testing strategies etc.


Post by Goose »

Mats, I've sent you a complete and runable standalone test suite! Thank you!

Post by mats »

You made a few errors:

1. You included Ext JS in the preloads, which meant you had multiple copies of Ext JS in your page. If using hostPageUrl option, that page should include all scripts etc, don't combine with the preload option. Cleaned up:
var Harness = Siesta.Harness.Browser.ExtJS;

Harness.configure({
    title: 'Gooses Test Suite',
    overrideSetTimeout: false
});

Harness.start(
    {
        group: 'Manage Vehicle Rates',

        items: [
            {
                url: 'ManageVehicleRates.t.js',
                hostPageUrl: 'ManageVehicleRates.php'
            }
        ]
    }
);

//console.trace();

2. Test code was messy. Cleaned up:
StartTest(function (t) {
    t.waitForComponentQuery('textfield[id=HourlyRate]', function() {
        t.chain(
            {
                action: 'type',
                target: Ext.getCmp('HourlyRate'),
                text: '5'
            }, {
                action: 'type',
                target: Ext.getCmp('MilageRate'),
                text: '42'
            }, {
                action: 'type',
                target: Ext.getCmp('MilageMinimum'),
                text: '15'
            }
        )
    })
})


Post by Goose »

Fantastic! Everything is being entered into the form properly!

Mats thanks so much :D

It's still saying that 0 tests have passed and 0 have failed, but no errors are being returned. It seems everything is working though, I'll figure it out ;)

Post Reply