Get help with testing, discuss unit testing strategies etc.


Post by fredric berling »

var toolbar = app.down('toolbar');
if(!toolbar){
   t.fail('Could not find toolbar')
   t.done();
   return;
}
Is this the correct way of aborting if a component isn't there?

Post by nickolay »

Yes, everything is correct.

Post by mats »

Or more shorthand:
var toolbar = app.down('toolbar');
t.ok(toolbark, 'Toolbar found');

Post by fredric berling »

But i would not get a meaningful message in the log if it failed right? .. Just a script line

Post by mats »

It would say that it failed in the assertion list and the message would be "'Toolbar found'". What would ye like?

Post by fredric berling »

Oh...ok.. Thats good. Must have missed that feature :)

Post Reply