I'm trying to call a method on an object in window which can have a callback, like this:
it('should be logged in into Facebook', function(done){
browser.visit('/test').then(function(){
browser.window.FB.getLoginStatus(function(response) {
if (response.status === 'connected') done();
});
});
});
But the callback is never executed, although I can see the requests in resources. Furthermore, I tried with eval and it does not work either:
it('should be logged in into Facebook', function(done){
browser.visit('/test').then(function(){
browser.evaluate( 'FB.getLoginStatus(function(response) { console.log("connected") // does not print; })' );
});
});
What can be the problem?