I am trying to pass a function from my testClass into a wait for, but it doesn't work.
Take the following chain for example.
StartTest(function(t) {
t.chain(
{
waitFor:
function() {
t.diag("wait for mask...");
var load_mask = t.global.Ext.ComponentQuery.query("loadmask[msg=Retrieving firmware information...]")[0];
if (load_mask == null || load_mask.hidden == true) {
return true;
}
return false;
}
}
What I would like to do is move the code that is in the chain into it's own function. When I do this I get the following exception.
TypeError: waitFor.replace is not a function
StartTest(function(t) {
t.chain(
{
waitFor: t.wait_for_load_mask()
}
Class('Utils', {
isa : Siesta.Test.ExtJS,
methods : {
wait_for_load_mask : function() {
this.diag("wait for mask...");
var load_mask = this.global.Ext.ComponentQuery.query("loadmask[msg=Retrieving firmware information...]")[0];
if (load_mask == null || load_mask.hidden == true) {
return true;
}
return false;
}
}
})