Hi All,
I am using async calls in jasmine test using done() still my expects are always getting passed.
getDetails: {
value: functoin(args,cb) {
return browser.controlFlow().execute(function() {
return Q.ninvoke(browser,'getDetails',args).then(function() {
//processing
var data = ...
cb(data);
})
})
}
}
getCount: {
value: function(cb) {
return this.getDetails(args,function() {
//processing
var data = ...
cb(data);
})
}
}
......spec.........................
it('test',function(done) {
instance.getCount(function() {
expect(element(by.css(".input2")).isDisplayed()).toBe(true);
done();
})
})
the above expect gets passed everytime even if the element is not present on the page.