Get help with testing, discuss unit testing strategies etc.


Post by Derek.Adair »

I'm writing some tests for a dynamic MVC app in Ext. In the app, I click a button, which then creates a window which has a form and a input field. I need to click the button, wait for the window to load, then type something into the input field.

This chunk of code works just fine
t.click('#addOrgBtn', function(){
    t.waitForComponentQuery('textfield[itemId=newOrgName]',  function(orgName){
        t.chain({
            action  : 'type',
            text    : 'testing',
            target  : orgName[0].inputEl
        }); 
    }); 
});
This is how i'd like to do it, however, it throws an Error
t.chain({
    action  : 'click',
    target  : '#addOrgBtn'
},{ 
    waitFor  : 'waitForComponentQuery', 
    args    : ['textfield[itemId=newOrgName]']
}, function (next) {
    t.type(Ext.ComponentQuery.query('textfield[itemId=newOrgName', 'testing'));
}); 

Error
Uncaught Need to pass `action` property for step config | siesta-all.js:8264
Class.my.methods.create | siesta-all.js:8264
override | siesta-all.js:810
c.(anonymous function) | siesta-all.js:2561
queue.addAsyncStep.processor | siesta-all.js:7120
Class.methods.doSteps | siesta-all.js:5818
override | siesta-all.js:810
step.next | siesta-all.js:5814
nextFunc | siesta-all.js:7102
(anonymous function) | siesta-all.js:19409
According to the siesta docs, I should be able to do this:
t.chain({
  waitFor : 'componentQuery', // or any other waitFor* functions
  args    : ['textfield[itemId=newOrgName]
});
Thanks in advance for any help!

Cheers!

Post by nickolay »

hi Derek,

What version of Siesta do you use? Looks like its outdated, exception should say: "Need to include `action`, `verify` or `waitFor` property in the step config"

Post Reply