Get help with testing, discuss unit testing strategies etc.


Post by zombeerose »

I am having problems with tests that require clicking on a tool in the panel header. The component query finds it and when I inspect the tool, it has been rendered and is visible. The test moves to the correct location and appears to click on it. However, the event is never fired when run by the test. If you click on the tool manually while the test is still running, everything completes as expected. Any ideas?
StartTest(function (t) {
    var Ext = t.getExt();
    
    function testTool(cb){
        var cmp = Ext.create('Ext.panel.Panel',{
            collapsed: true,
            collapsible: true,
            html: "Initially collapsed panel",
            height: 200, 
            width: 400,
            title: 'Tool Test',
            renderTo: Ext.getBody()
        });

        t.waitForEvent(cmp,'expand',function(){
            t.pass('Expand event fired');
            cb();
        });
        
        t.clickCQ('tool[type="expand-bottom"]',cmp);
    }
    
    t.chain(
        testTool,
        { action:'done' }
    );
});
Ext 4.1.1 and 4.1.3
Siesta 1.1.4

Post by mats »

Works fine for me, browser/OS?

Post by zombeerose »

Doh! I hate it when I post a bug that is self-inflicted! I finally found the cause - I had added an override to the click method in my test class that would warn if the element was not visible. Unfortunately, the API for click changed with a new param (options) that I wasn't including. Works fine now. Thanks and sorry for the trouble.

Post Reply